Power Supply Preference

I was wondering what power supply the Uno picks when 2 sources are present.

I basically want to have a 9v battery plugged in, and a USB cable from a wall charger with the USB cable as the preferred source of power but will use the 9v as a backup.

How does the board currently choose what to use and is the above possible if it doesn't do this already.

If the board doesn't do this and it is possible can some one point me in the right direction?

Thank You !

Unfortunately it will work the opposite of what you want. With external power plugged in the USB power will not be used.

To select a 5V power source (USB cable) over a 9V source is tricky indeed. I don’t have a simple solution.


The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

Thanks for the quick response.

Do you know how the power management is currently handled on the Uno is it hardware or software?

Thanks Again

It is a hardware circuit that auto-switches between external power and USB. Nice thought, though.


The Arduino Drum Machine: MIDI development system with 14-track MIDI drum machine sequencer / groove-box software

Look at the Uno schematic, U1A and T1 http://arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf

If Vin/2 is > 3.3V, U1A goes High and drives T1 to keep out the USB power.

http://www.adrirobot.it/datasheet/transistor/pdf/FDN304P.pdf

I did see that there late last night, still trying to figure out a solution for a battery backup any ideas ?

ie. similar gate to that which i wire in reversely to my battery connection using a voltage pin as the switch?

Make a similar setup - two comparators to sense Vin & Vusb, if not there or too low, then enable your battery voltage.