Powering the arduino with a 5V power supply

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:

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

MeatPlatter:
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.

MeatPlatter:
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).

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.

MeatPlatter:
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.

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.

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:

Earlier boards like the Duemilanove used a different 5V regulator that wasn't susceptible to being damaged by reverse driving.

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.

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.

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. External supply at 5v pin - IDE 1.x - Arduino Forum

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.

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.

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.

1 Like

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

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.

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:

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 !

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.

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.

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?

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.

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

with both powered up no problem. if pc is shut down with external power still applied there are definitely issues. most motherboards will now misbehave in terms of on/off button and in some few cases if no polyfuse present damage to the chipset. i learned this the hard way when using the 5v out to charge batteries. now that problem solved with a simple diode in series.

side note: regarding caps on lm1117 ldo (not really btw) at least one cap on the output it is essential. minimum .1mf and better 1-10mf. as mentioned in the other thread this is a fatal design flaw in popular "blue" usbasp modules. not theory but cause of actual failures in the real world. tack a cap, save a life. lol.

Hey there,

sorry for revamping this thread, but I have related question:

I recently bought a Arduino Uno R3 without a power source. But I already have a power source for other applications. It's a 24V (max. 10 A) source (TDK Lambda SWS 300 there you go). Now I bought a 24V -> 5V DC Converter (this one).

Is it now possible to connect these parts with a USB-B cable and power my arduino with it like it was mentioned by fungus?

TIA!

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

It's actually much worse than that. Poorly designed USB hubs that commit this sin have damaged motherboards.

Sorry to bump this thread but I like when information is collected in one place.

Now, I have a similar situation and after reading the thread I think I have an idea of the solution but just to make sure let me state it:

Are we saying that adding a diode in the USB +5v line will solve all problems of a possible backflow and what not?

after i burned some regulators, i decided something had to be done.

My solution : take a usb cable and CUT the +5V wire (leave ground as it is). Now you have any power to arduino (from 5V or Vin) and transfer data thru usb.