Arduino Forum

Forum 2005-2010 (read only) => Hardware => Development => Topic started by: daveg360 on Jan 12, 2010, 04:35 pm

Title: Circuit to swap to battery power
Post by: daveg360 on Jan 12, 2010, 04:35 pm
I'm trying to design a circuit that automatically switches power to battery when mains supply (wall wart) is cut.  I'd rather not use relays.  I have in my head an idea of using a npn controlling a pnp but I can't make it work in practice.  Someone must have done this before?
Title: Re: Circuit to swap to battery power
Post by: Grumpy_Mike on Jan 12, 2010, 04:46 pm
Look at the Duemilanove schematic. They do that on there with the USB / DC input connector.

http://www.arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf
Title: Re: Circuit to swap to battery power
Post by: daveg360 on Jan 12, 2010, 04:51 pm
Thanks Mike - looks a little more complicated than I hoped.  Would there be any harm in connecting a 12v lead acid to my circuit permanently via a diode?  I'm using a regulated 12v psu and the battery is on permanent trickle charge (obviously not if the power is cut and battery backup is required)
Title: Re: Circuit to swap to battery power
Post by: Grumpy_Mike on Jan 12, 2010, 05:05 pm
Sounds like a plan.
Can't see anything wrong with that.
If the power is cut then is there a diode in line with the PSU to prevent the battery discharging through that?

Title: Re: Circuit to swap to battery power
Post by: daveg360 on Jan 12, 2010, 05:07 pm
Ooh good point.

Cheers Mike
Title: Re: Circuit to swap to battery power
Post by: daveg360 on Jan 12, 2010, 05:17 pm
Hmm my circuit simulator reckons that they'll share the load during normal operation. Which will interfere with charging normal charging....  
Title: Re: Circuit to swap to battery power
Post by: daveg360 on Jan 12, 2010, 05:18 pm
I think I can fudge it by putting 2 diodes on battery side to bring the voltage lower than the PSU.
Title: Re: Circuit to swap to battery power
Post by: sweeduino on Jan 21, 2010, 02:40 pm
Sorry to disturb your conversation but I'm following it with great interrest. Could you supply some type of schematic for me to understand it better?
Title: Re: Circuit to swap to battery power
Post by: wortelsoft on Jan 21, 2010, 02:45 pm
Quote
Sorry to disturb your conversation


ROFL

edit:

Didn't want to be rude in any way.
Title: Re: Circuit to swap to battery power
Post by: daveg360 on Jan 22, 2010, 01:02 pm
I'm still not sure what to do with this.  If I connect a battery in parallel with a psu - under normal conditions, will the battery share the load with the psu?  I guess that as the battery has a slightly higher voltage than my supply it will.  I can make it work in simulation by putting a extra diode in the circuit to reduce the battery voltage to less than the psu output.  This seems to stop the current flow.  Is this correct?
Title: Re: Circuit to swap to battery power
Post by: moonunit on Aug 19, 2010, 07:01 pm
Hello.

Have you had any luck with this? I am looking to do the exact same thing. I plan on running a project from mains, but I would like a battery to step in an power everything if there is an outage.

It would be extra great if the mains power kept the battery charged as well. :)

Thanks.
Title: Re: Circuit to swap to battery power
Post by: ill_switch on Aug 19, 2010, 08:33 pm
I designed a circuit to do this (though with NiMH batteries), had the PCB made, bought the parts, but never assembled or tested it. Here is that thread:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1269960867
Title: Re: Circuit to swap to battery power
Post by: Drmn4ea on Aug 20, 2010, 07:14 am
This sounds like something that can be done with a P-channel MOSFET. Think of it as a transistor* that turns ON when its gate (base) is grounded and OFF when brought near its drain voltage. Tie the gate to the wall-wart input and a pull-down resistor to ground, it should cut off the battery supply whenever the wall wart voltage rises to near the battery voltage or above.

*Unlike a transistor though, the gate of a MOSFET is essentially an insulated capacitor plate and won't transfer any charge to its source/drain (unless something goes seriously wrong!). Also, it won't incur the 0.7V or so diode voltage drop that a transistor does.