Does Duemilanove power switcher work with USB power and VIN?

Does Duemilanove power switcher work with USB power and VIN?

I’m trying to add battery backup to my Duemilanove using the automatic power switching circuit, but I’m not quite sure how the power switching circuit works. Specifically, suppose power is supplied to the Duemilanove (after it’s been programmed) through the USB port using Sparkfun’s 5 volt USB Wall Charger ( USB Wall Charger - 5V, 1A (Black) - TOL-11456 - SparkFun Electronics ), and 5 volts is supplied to VIN via a Bodhilabs 5 volt battery pack ( http://bodhilabs.com/vpack5aa2.html ). My goal is that power would be drawn from the Wall charger unless power fails or flickers and then power would come from the battery pack without interruption.

Will the power switching circuit work correctly if (as above) both voltage sources are regulated 5 volts? And does the power switching circuit block any current usage from the battery pack if the USB voltage is present?

Thanks in advance for any explanations.

and 5 volts is supplied to VIN via a Bodhilabs 5 volt battery pack

The Vin pin needs to be supplied a constant (regulated) 5V. A 5V battery pack will not be able to supply a constant 5V.

You can power the Arduino using the USB cable AND the power connector, but the power connector has a regulator downstream, so the input needs to be 7V+.

My goal is that power would be drawn from the Wall charger unless power fails or flickers and then power would come from the battery pack without interruption.

Without interruption might be stretching things. Without significant interruption is realistic.

The Vin pin needs to be supplied a constant (regulated) 5V. A 5V battery pack will not be able to supply a constant 5V.

That's wrong, the VIN is almost the same as the power connectors plus input, there's just a diode in between. So on VIN you have to supply more than about 7V (the same as the power connector, the be exact, it's compared to 6.6V before used. What you meant is the 5V pin, there your comment is absolutely correct.

That's wrong

I stand corrected.

Thanks for your comments. I realized that the 5 volt battery pack was connected to 5 volt/ground, NOT VIN/ground, so my original question was incorrect.

But I am still wondering how the power switching works. If power is present at both the USB port and VIN, which is chosen? is it the highest voltage (presumably always VIN if present)? If I want to use VIN as a battery backup source, is there any way to force the selection of USB power is present, and only use VIN power if USB power is NOT present?

Thanks again for any response.

If power is present at both the USB port and VIN, which is chosen?

The USB port overrides the power pin. It is not recommended that you feed power IN the Vin pin. It can be done, but at your own risk.

If Vin/2 > 3.3V, then Vin is used for power.

Vin can be from the barrel jack with some loss thru the Reverse Polarity diode (~0.7V), or it can come from the Power Header directly, bypassing the diode - be careful not swap it with Gnd.

Thanks again, PaulS and CrossRoads, for your comments, but are you disagreeing with each other?

PaulS said: “The USB port overrides the power pin...”
but CrossRoads said: “If Vin/2 > 3.3V, then Vin is used for power..”
Does the power source choice depend on how the NDT2955 works, which I don’t really understand.
I’m not very good at reading schematics, but it looks to me like CrossRoads is correct. If VIN has to be at least 7 volts, then 7/2 > 3.3, so if VIN IS present, then it is always used, whether or not USB power is present. Is that correct?

Also, PaulS said “It is not recommended that you feed power in the VIN pin.”
But the Arduino Duemilanove description at: http://arduino.cc/en/Main/arduinoBoardDuemilanove
says: “ You can supply voltage through this (VIN) pin...”

Sorry to be so confused on all this. I want to understand what will happen so that I don’t burn up something when I try it.

I think Crossroads knows more about the hardware than I do, so I'd trust what he says.

If you are going to feed power to the Vin pin, it needs to be regulated 5V. I don't see how you are going to get that from a 5V battery, though.

Power into Vin pin has to be high enough for the regulator to have something to work with.

Power into the 5V pin (the output of the regulator) should be regulated 5V power, or perhaps 3 AA alkaline batteries for ~4.5V power. Do not exceed 6V, that will damage the ATmega. (i.e. 4 AA alkaline would be too much; and yet not quite enough for the regulator to work correctly).

How about my final question:

If VIN has to be at least 7 volts, then 7/2 > 3.3, so if VIN IS present, then it is always used, whether or not USB power is present.

Is that correct?

Thanks again.

That is correct.