Wiring a separate power supply for the radio


  • Hero Member

    Has anyone tried to wire the AMS1117 DC 5 to 3.3 volt module in order to provide a separate 3.3V supply to the radio for the gateway. I wanted to use an old 5V phone usb charger which I connected to the AMS1117. I checked that the output was 3.3 volts. I also connected the separate supply ground wire to the arduino ground. Could not get it to work properly. Also my computer would not connect to the arduino unless I uplugged the separate power supply first and then plugged it back in after connecting. Serial monitor then showed normal gateway startup but could not get it to communicate with a sensor monitor. Reconnected without the external power supply and everything works fine. Any suggestions?



  • (Haven't used the particular component, yet) Did you connect the grounds of different power sources together?


  • Hero Member

    @Dan-S. said:

    Also my computer would not connect to the arduino unless I uplugged the separate power supply first and then plugged it back in after connecting. S

    strange... anyway if you power from USB the arduino, it won't accept an external power source in addition to that.

    When you linked the grounds, did you did it on the raw close ground ?


  • Hero Member

    @epierre Did link the grounds. But need to check if it was raw close ground. Which one is that? I thought that the 2 nano grounds were the same in that a ground is a ground.


  • Hero Member

    I am not sure, better check...

    since on raw you can apply any voltage, I would thing those two are not, but I may be wrong...


  • Hero Member

    @epierre I'll definitely double check my ground connections.


  • Hero Member

    Well the plot thickens. Checked that all the grounds were OK. Even took off the cap I had on the radio. It seemed to me that the separate power supply was feeding something back to the Nano that was causing a problem. So with the separate power supply hooked up to the radio, I checked the voltage on all the pins, the power pin registered 3.3V. But the IRQ pin also registered 3.3V. In checking into this I found that the IRQ is normally set to high. Which means the radio was feeding 3.3V from the separate power supply via the IRQ back into the NANO pin 2. I disconnected the IRQ line and fired it up and everything worked fine including receiving signals from my test light sensor module. So, it seems that the Nano doesn't like getting a voltage input from outside on pin 2. In addition, do I really need the IRQ line?


  • Hero Member

    Maybe the problem is what level the interrupt is (high @ 3.3v or low @ 0 volts) when the nano is connected. If the separate power supply is plugged in first, the nano starts with the interrupt set to high. If the separate power supply is plugged in after the nano, the nano starts with the interrupt at low. Don't know enough about the nano radio programming to interpret this.


  • Hero Member

    Did some more troubleshooting. Reconnected the IRQ line.

    If I power the AMS1117 DC 5 to 3.3 volt module by connecting it to the nano 5V pin everything works fine.

    If I power the AMS1117 DC 5 to 3.3 volt module via the external phone USB power plug, windows says "USB device not recognized, one or more USB devices attached to this computer has malfunctioned etc..."

    If I disconnect the external power source (leaving the radio unpowered), windows recognizes the nano and if I then power up the radio with the external power source, everything works fine.

    Don't know if Vera would have the same problem, i.e., not recognizing the Nano if the radio is powered up before the nano is plugged in.

    Bottom line is: Don't power up the radio with the external power before powering up the NANO. Can't explain why, but that's the way it is. Something happens to the nano if it is powered up after the radio is powered up and it seems to be related to the IRQ line.


  • Hero Member

    Just to clarify. It seems that having the IRQ pin of the radio providing 3.3V to the Nano 2 pin before the nano powerup causes problems with the Nano initialization. If I unplug the IRQ line, the nano connects to the computer just fine, even if the radio is powered up before the Nano. If I then reconnect the irq line will everything is still powered up, it works fine.


  • Mod

    @Dan-S. Could you try connecting the IRQ line through a small resistor (e.g 100 ohms) to the Arduino to limit the current to the Arduino and see if this solves your problem?


  • Hero Member

    @Yveaux

    Good suggestion. Certainly worth a try. Will let you know how it works out.


  • Hero Member

    @Yveaux

    Didn't work with 100 o 1k, but did work with 10k. Wonder if the interrupt would still function with that value of a resistor in line?


  • Hero Member

    @Dan-S. last message should read Didn't work with 100 or 1k ohm



  • @DAN S "...do I really need the IRQ line?"

    As far as I can see the IRQ is not used by the NRF24 radio library. I don't ever wire it to the radio.


  • Mod

    @a-lurker the current implementation of the library does not use the interrupt, but future implementations might.
    Still it is an interesting case why connecting it causes the setup to fail.


  • Hero Member

    Hmm. I remember connecting two Arduino Uno's via the serial lines to test that inter-uC communication; each was powered by a USB connection to a different laptop. ONLY ground, TC and RX connected between the two Unos. It worked fine.

    But I was surprised to see that even after I unpowered one of the Unos after the test (removed the USB cable), it was still operating and blinking an LED. It would even echo back characters it received from the powered Uno, as it had been programmed to do. All this with no power supply, period. I was a bit puzzled!

    It turns out that the nominally unpowered ATMega328P was receiving power THROUGH the powered Uno's TX digital pin connected to the unpowered Uno's RX digital pin, probably through the latter's static protection diode. (TX was high most of the time). The powered Uno's digital output pin can supply up to 40 ma. The supposedly unpowered Uno was runnning at lower than 5V (due to the diode drop) but still had enough voltage and power for the uC to operate, as well as to light the led on the Uno board (ie: power flowed into the digital pin and back out the VCC pin of the processor.

    I wonder if something similar is happening here, with the nRF24L01+ IRQ output feeding power into the Nano via the latter's digital pin, such that the Nano at least partially operates, and then does not do a clean startup when it receives its own normal power. Given that the Nano would be running on 3.3v minus the protection diode drop, it may not run as well as the Uno did. Also the nRF's IRQ output may not supply as much current as another ATMega pin, but the ATMega can run on surprisingngly low voltage and current, so maybe it at least achieved some kind of zombie state using power from the nRF's IRQ.

    The nRF may not have this tendency to run with no VCC supplied power by relying instead on parasitic power from a digital input, so powering the Nano first is OK.



  • Nice analysis - powering up devices in an appropriate order can definitely cause problems such as via the (parasitic) static protection diodes seen on various pins. Presumably this invokes Yveaux's interest in current limiting resistors.

    It's a bit unclear how the layout under discussion is actually powered. A cct diagram would be useful here but generally speaking, everything should be powered up pretty much simultaneously, if possible. Regardless the various arduino ccts in existence seem to provide a variety of power paths, many of which are perhaps undesirable. eg supplying power directly to power lines that have on board regulators and hoping that "back driving" those regulators will not cause problems. Likewise various arduinos use the serial chip to provide some power and it's quickly overloaded.

    A detailed cct is required to provide any definitive PSU analysis.


  • Hero Member

    Thanks to everyone for their input. Was a great help. In the end I decided to connect the IRQ line even thought it is not used now, since as pointed out by A-LURKER, it may be in the future. Thanks to Yveaux's suggestion I ended up using a 10k ohm resistor on the IRQ line and now everything works, even if the separate power supply to the radio is fired up first. I think, although I didn't prove it, that the IRQ should work fine even with a 10k ohm resistor in series. A 10k ohm resistor value is usually recommended for use in Arduino as a pull down/up resistor so I think it should work fine here also.



  • Hi,
    I think this is a good thread since power supply seems to be the most tricky one in this. Shouldn't it be possible to have a "reference architecture" for power supply to eliminate 80-90% of the issues people (including me) run into?!

    I made some tests on a problematic sensor yesterday and sicne I use NRF24L01+PA+LNA (Antenna version) I added 5V external supply and AMS1117 5V-3.3V Step Down Module, with IRQ connected over 10k resistor but got a number of problems e.g. MySensors complaining "check wires". Maybe it's possible/ok (the logic detecting presence of the radio) if the radio isn't alive before Arduino starts?!

    Got tired of it and setup a new sensor...


  • Hero Member

    @jocke4u I have since put the set up I have described above in permanent operation as my Vera gateway and have not had any problems with it. I do have a cap across the NRF24L01+PA+LNA power and ground terminals--that may make a difference, even with external power. I did power up the radio before the Arduino.


Log in to reply
 

Suggested Topics

  • 3
  • 5
  • 8
  • 6
  • 6

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts