Go Down

Topic: Powering the arduino with a 5V power supply (Read 92953 times) previous topic - next topic

MeatPlatter


Hey all,

Firstly, apologies for these basic questions.

I've got a 10A V5 power supply that's primarily there to power a bunch of LEDs but I wanted to also use it to power an arduino mega 2560. I read that:

Quote
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.


I'm a bit concerned that it's not advisable to supply power to the 5V pin. Is it just because you could get the polarity and voltage wrong and wreck your arduino or is there something else to be concerned about? If it's the later , should I create a USB B cable with 5V coming from my power supply?

The next question I have is, if I'm powering the arduino through 5V and then want to program it through the USB can I keep the 5V pin connected and let the arduino choose the power source or must I always disconnect it before connecting the USB cable?

(I'm trying not to blow up my arduino mega)

Thanks!

MeatPlatter

fungus


I'm a bit concerned that it's not advisable to supply power to the 5V pin. Is it just because you could get the polarity and voltage wrong and wreck your arduino


Yes.


or is there something else to be concerned about?


No.


PS: An even better way is to connect your 5V to the USB connector (get an old USB cable and cut the plug off the other end).

This way you get:
a) A better connector than the crappy header pins (which can fall out, make poor contact, etc).
b) An extra fuse that the 5V pin doesn't have (see schematic).

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

MeatPlatter


Thanks Fungus, using an old USB cable is a great tip!

Do you know what happens if I supply voltage to the 5V pin and also have the USB connected to my computer? I'm hoping this will be fine as otherwise I'd need to put a switch on my enclosure to turn off the 5V pin supply.

fungus


Do you know what happens if I supply voltage to the 5V pin and also have the USB connected to my computer?


You can't do it. The different power supplies will fight each other.

(Never connect the outputs of two power supplies together...)

That's why the USB cable method is doubleplusgood. You have to remove power to be able to connect your PC.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

MeatPlatter


Thanks Fungus! That's a shame, I was hoping it would select which power supply to use. This means I'll have to open the enclosure to switch the USB connection when I just want to upload the latest program.

CrossRoads

If USB is not connected, you can power the Mega from the 5V header. Be sure to connect a diode from 5V (anode) to Vin (cathode) to avoid totally reverse biasing the 5V regulator. See page 10 here:
http://www.onsemi.com/pub_link/Collateral/NCP1117-D.PDF

Earlier boards like the Duemilanove used a different 5V regulator that wasn't susceptible to being damaged by reverse driving.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

djsfantasi

Sorry for necro'ing this thread, but I have the same question.

How do I power the Arduino Mega Rev 3 from a regulated 5VDC power source (a PC power supply). I have customized the supply header to only provide 5VDC and are using it to power several other boards From the description on the product page, it seems possibly, but searching the forum results state that you shouldn't do this? Which is right?

I am guessing that I CAN power with my power supply though the 5VDC pin, if I connect a diode between Vin and 5VDC, cathode to Vin.

Quote
The power pins are as follows:

VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V. The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.
3V3. A 3.3 volt supply generated by the on-board FTDI chip. Maximum current draw is 50 mA.
GND. Ground pins.
Quote
The reason was discussed a while ago. The 1117 5V regulator is susceptibe to damage when reverse driven. The earlier posts discussed bricked boards after putting 5V into the board via the header pin. A member of the team discussed it with us. http://forum.arduino.cc/index.php?topic=141639.0

cipri92

I read that a suitable voltage to power a board thorough the Vin pin is 9V but I don't know how much current is enough. Will a 9V 1A supply be enough? I have a 5V supply but I wouldn't occupy the USB port.

evildave_666

I read that a suitable voltage to power a board thorough the Vin pin is 9V but I don't know how much current is enough. Will a 9V 1A supply be enough? I have a 5V supply but I wouldn't occupy the USB port.
1A is more than any standard Arduino board will ever draw.
This is of course assuming the specced amp of the supply is a real amp and not a China amp, because China.

cipri92

I have a Yun so 9V is not applicable as stated on it's page.

Brizee

Hi all. I have powered an Arduino Uno compatible board directly from the 5v pin, with no problems. It seems the only way (other than USB) to stop heat from the onboard regulator interfering with temperature sensors near the board. I draw any needed supply from the same pin, not the Vin pin. As long as you take care, and use a good quality regulated supply.

windgassen

I am doing a project that uses a high powered servo, and I want to run the Arduino Uno and the servo off of the same 5V power supply but I still want to be able to safely connect my PC to the USB port without risk of back feeding my computer with 5V from the Arduino.

After looking at the schematic for the Arduino, I simply removed  used a hot air pen to remove the MOSFET T1 on the Arduino Uno which allows USB power to feed the +5V net.  The only downside to this is that I need to have my external 5V power supply on in order to program the Arduino with the PC.  I marked my board as modified and then taped the MOSFET to the board so I can reinstall it later if I want to.  The MOSFET is a SOT-23 packaged part, so it is pretty easy to remove.

I first tried removing the polyfuse, but this prevented the USB from connecting since the USBVCC is used by the USB microcontroller so that did not work.

I also considered changing the threshold of the comparator so it would turn off the MOSFET when 5V was applied and it back feeds to Vin.  I was going to do this by changing one of the 10k resistors to a different value, but this was impractical since they are arrays and you can't change only one resistor.

Removing T1 was a simple fix that will keep my PC safe when back feeding 5V.

If you wan to add reverse polarity protection without the higher voltage drop of either a PN diode like the M7 diode (~0.7V) or a good schottky (~0.5V), you can always play the trick of using a backwards connected P-channel mosfet.  See this article:

http://hackaday.com/2011/12/06/reverse-voltage-protection-with-a-p-fet/

This circuit is simple enough to add to the breadboard area of many boards, so if this is important to you, it's worth considering.  I have used this trick in some of the boards I design at work.

Best of luck, and I hope this post gives some good ideas !

Paul__B

The proposition that "backfeeding" the PC with 5V via the USB is bad, is vastly over-rated, basically nonsense.

If you ever use a powered USB hub, that is precisely what you could be doing - if it were ever a problem - as the vast majority of these have all the 5V lines; the USB host and slaves and the 5V input from the plug pack; directly connected.  Some have "activity" lights corresponding to the ports, which would be indicating status from the hub chip(s), not power usage.

Further, the polyfuse in the USB line which protects whatever it protects in the UNO, actually protects the PC from harm through "backfeeding".  As long as the power supply you are using is actually regulated 5V, there will be no problem at all.

tinkerbear

If USB is not connected, you can power the Mega from the 5V header. Be sure to connect a diode from 5V (anode) to Vin (cathode) to avoid totally reverse biasing the 5V regulator. See page 10 here:
http://www.onsemi.com/pub_link/Collateral/NCP1117-D.PDF

Earlier boards like the Duemilanove used a different 5V regulator that wasn't susceptible to being damaged by reverse driving.
Ok, I've read the datasheet page 10, and it says: "The NCP1117 family has two internal low impedance diode paths that normally do not require protection when used in the typical regulator applications. The first path connects between Vout and Vin, and it can withstand a peak surge current of about 15 A."

Isn't that saying it already has a diode between the output and input, so that adding one would be unnecessary?

Paul__B

As I have said immediately above, it is all relative.

I do believe the datasheet also indicates that this is only a concern if the input capacitor that this peak current is charging, exceeds about 47 µF - which happens to be the value used in the UNO.

Note the term "peak surge current".

In most cases, the only way to generate such a surge current, is in the process of connecting a power supply which has already charged its output capacitor, to the output of a regulator with such a capacitor on its input.  Plugging in a USB connection as a matter of specification, does not do this which is the very reason why the Arduino can be "hot-plugged" to USB, and in precisely the same manner, connecting a 5 V switchmode - or linear - regulated power supply (which necessarily has an output capacitor which that supply has to progressively charge over a certain time) to Vcc and then switching that power supply on, will not cause damage.

Go Up