I'm designing an Arduino shield to allow the Arduino to control, among other things, an ATX power supply -- I'm running GPIO pins to the PS_ON and P_OK pins of the ATX. I would like to be able to run the Arduino off of the 5V_STDBY rail, with no risk of damage if the Arduino is plugged in via USB concurrently with the ATX power supply switched on. I make mistakes; sooner or later I'll connect them both at the same time and I'd rather not fry my arduino, or worse still my USB port.

I'm designing as a shield, because so many devices these days support the arduino header footprint, that I can swap out for something else if I want down the line.

The basic idea is to wire ground to ground, and 5V_STDBY on the PSU to the arduino's 5V pin. Now, because different regulators run at slightly different voltages, I don't want to short one to the other.

The fact that this is a a shield puts a new twist on an old problem. There is no pin corresponding to +5V USB in, so solutions like those in this question OR-ing power supplies (diode or mosfet) can't be used, because I have no direct way of knowing if the USB cable is connected.

My first idea is to take half of the diode solution from the question I just posted. That is, put a diode with anode tied to 5V_STDBY and cathode tied to the Arduino's 5V pin. At 16MHz, the ATMega can handle as low as 3.78V (http://www.atmel.com/Images/doc8161.pdf page 316), and a silicon diode would only drop about 700mV, so even if the PSU only delivers 4.75V, that still leaves me about 300mV of headroom. The hope is to leverage the turn-on voltage of the diode. If the PSU's voltage is a bit lower, then even if the arduino is drawing no current, we're only dealing with reverse leakage current back to the PSU. If the PSU's voltage is a bit higher, we'll still have a limited amount of current because the diode won't reach the voltage where it conducts significantly, even if both regulators are 5% off from 5V in opposite directions (500mV). Hopefully what small effect the regulators have on each other won't hurt them.

Now, since we're talking about a USB port that I don't want to replace, is this a legitimate solution? Are there any questions I should be asking that I'm not?

If so, should I be concerned about VCC on the ATMega328 being so low that a HIGH signal on the input pins is too high? There are only a few pins that the Arduino reads, so I could use voltage dividers to shift them down.

Of course, another solution, which might ultimately be simpler, is to use a boost converter to bring the 5V_STDBY up above 7V, and feed that into the VIN pin, and let the onboard arduino regulator convert that back down. It seems like a kludge, though.

Which solution, diode, boost converter, or other, do you recommend?

  • \$\begingroup\$ I'm not 1000% sure, but you should be able to run the arduino with 2 parallel 5V sources with no problem. Just like a battery, you can put 2 AA bat in parallel to double the max current draw. However, there could be risk of back feeding. I suggest, get a schottky diode for each source. Connect the 2 cathodes, and each anode to separate +5 V. The schottky has a lower voltage drop. \$\endgroup\$
    – Matt
    Commented Aug 31, 2015 at 0:30
  • \$\begingroup\$ That's the solution of the post I linked. I can't do that without modifying the arduino itself; I'm trying to build a shield, which means all circuitry has to be away from the arduino. And everything I've read about two power sources in parallel says it's a bad idea unless you know what you're doing, because everything has a slightly different voltage. For example, you can put a .1 Ohm resistor between your two power sources, and that will help them balance the load, but poorly -- one will take up too much slack. You can balance them better with more resistance, but then you lose voltage. \$\endgroup\$
    – Ed Krohne
    Commented Aug 31, 2015 at 3:47
  • \$\begingroup\$ Oh I didn't realize you can't modify the arduino inputs. Okay, it's possible the load won't be balanced, but you can still use power sources in parallel without worrying if they are different voltages--the higher voltage will be used. If you use VIN pin, that goes to a regulator so it would be fine if you have 10V and 12V in parallel. However, as I said diodes would provide certainty that the power would travel in one direction only. I'm not sure if it's completely necessary, though. \$\endgroup\$
    – Matt
    Commented Sep 1, 2015 at 4:29
  • \$\begingroup\$ I'm tempted to agree, but I've heard of people frying arduinos by connecting something to +5V AND having USB power connected. This answer, #5, confirms this: electronics.stackexchange.com/a/67150/58742 \$\endgroup\$
    – Ed Krohne
    Commented Sep 4, 2015 at 13:25
  • \$\begingroup\$ I imagine what you're saying is that ideally, the lower voltage regulator will see a too-high voltage no matter how little contribution it tries to make itself, and will therefore drop out completely. But that seems like a big if with a USB port hanging in the balance. \$\endgroup\$
    – Ed Krohne
    Commented Sep 4, 2015 at 13:30

1 Answer 1


There are few things here so I will address what I can

For reference here is the UNO schematic (open in window for zoom)

enter image description here

As you mentioned there is a VIN pin that is designed to just what you are asking here. It is meant to be an external source of power. The VIN Pin is connected to the DC plug on the board and actually controls a p channel mosfet (T1) to turn off USB power to the cpu of the device (except USB power section) when a DC voltage is present across VIN, otherwise the 5V supply comes from USB.

If you were to simply plug in your standby power supply into VIN, it should be safe to mix with the USB power (but not DC in) using the existing circuitry. Unfortunately VIN is on the upstream side of a regulator, and while its not the end of the world to freewheel through the regulator (this model will saturate open and pass the voltage through unregulated but with an equivalent series resistance), what this means is that its not intended for 5V standby.

One solution I would suggest is to provide power both to VIN and to 5V. This takes advantage of the VIN lockout of the USB power, and since there is no reverse bias on the regulator it will basically just sit there clamped to 5V output and will likely work just fine (obviously test, but there is precedence in question like this. A schottky diode across the IC (Output to Input) can be used to prevent a large reverse bias from showing up across the linear regulator but this already exists in the IC. The existing MOSFET (T1) will prevent current from flowing back into the usb port, but you need a "high" voltage signal on the T1 gate to turn it off, without the VIN the gate will be biased to GND and the MOSFET will remain on.

There are plenty of rectifier diodes out there that you can use to OR the power as you probably know. Unfortunately without modifying the arduino (only on a shield) you are forced to either Kluge around the existing components, live with no protection, or bite the bullet and modify the arduino so you either have a sense pin on the 5V usb or

As for your last question. If peripherals connected to GPIO have their own power supply and could possibly drive the pin above VCC (worst case with your standby 5v) then there is a risk of damage if it exceeds it by some threshold. See this table in the datasheet Pg 313

enter image description here

  • \$\begingroup\$ That's a very intriguing idea of the VIN lockout, but that lockout looks like it's triggered by 6.6 volts on the VIN pin, (3.3*2) albeit at zero current. At which point I may as well just boost my 5 to 7 (or 10) anyway and feed it into the VIN pin no problem like I said at the end. At any rate, that helps me understand the regulator a little better, and also, that chart is extremely useful, thank you for finding it for me. That documentation is dense. \$\endgroup\$
    – Ed Krohne
    Commented Aug 31, 2015 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.