Go Down

Topic: Automatic switching between two power sources (Read 1 time) previous topic - next topic

strykeroz

Hi

I have a project which gets its power from a car battery or a 12V wall wart.  What I'd like to do is have both of these wired in, but when the mains power is present, have the battery no longer supplying.  The battery and the mains supply are going to be kept independent, so no charging occurs, and I'd like to make it automatic so the battery can kick in almost as a UPS.

Is this as simple as using a P channel MOSFET with the wall-wart output into the gate to turn off the battery supply, and adding a diode at both supplies so neither can feed power into the other?  Or are there other issues I need consider?  Presumably since a MOSFET is switched by voltage I can put a large value resistor before the gate to ensure low power consumption for this switching?  Also, the 12V is split to run some devices directly, but a microcontroller and supporting ICs via a switched mode 12-5V DC-DC converter - is there any issue with one of those interfering with this concept?

Thanks in advance for your advice,
Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

sdturner

It sounds like you have already ruled out just diode ORing them together. A relay, powered by the wall wart would be easiest. An opto-isolator could control a FET, or maybe even switch the battery off, if the current isn't too high. A protected high side load switch would be easy to control with the wall wart voltage, something like this (http://www.fairchildsemi.com/ds/FD/FDC6324L.pdf) though many others make similar parts.

strykeroz

Hi and thanks for the advice. That's certainly given me something to think about - I'd not considered the car battery might be too powerful to switch completely off with the FET.

It sounds like you have already ruled out just diode ORing them together.
I was just looking for a way to ensure the battery didn't contribute at all when it doesn't need to.  The wall wart should always take precedence.  Am I right in thinking the Diode OR would just share the load between the two?
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

BenF


I have a project which gets its power from a car battery or a 12V wall wart.  What I'd like to do is have both of these wired in, but when the mains power is present, have the battery no longer supplying.  The battery and the mains supply are going to be kept independent, so no charging occurs, and I'd like to make it automatic so the battery can kick in almost as a UPS.

The common solution to this challenge is to use the mains regulated DC supply as a battery charger. With mains present, the DC supply will maintain/charge the battery and power connected peripherals at the same time. You need to regulate the DC supply output voltage to match the battery maintenance-charge level (about 13.7V). At this level, you can leave it connected/powered at all times. Switchover is instant as this is a hot standby connection.

kf2qd

Unless both devices are tied to the power connection you will have a problem if the mains power fails. A relay will have some switching time with no power output.

You could use a power supply with a higher voltage than the battery, both the battery and the power supply have their own diode feeding the Arduino. As long as the mains are good the higher voltage will block the current from the battery. When the mains fail the battery will have a higher voltage and provide power through its diode.

How are you going to charge the battery?

Easier to have power supply charge the battery to a proper voltage and if the power supply/charger fails you would run off only the battery.

strykeroz

Thanks so much for putting some brain-cycles to this.  Like most things tried for the first time there are always aspects those with more experience will think of.  In this case the switchover time was something I completely hadn't thought of.
Quote
How are you going to charge the battery?
In this case the battery and taking it on tour is actually a bit of an afterthought - I have a donor 12V wall wart already grafted in, so at the minute it's tied to the house and was going to be a semi-permanent.  This is a bench worklight, using 4.8m of LED strip-lighting, cut to 24cm strips with brightness controlled by switching different patterns of them through TPIC6B595 shift registers via an iR remote controlled by an ATtiny85. 

There are a few places where it could be used if I added battery power though.  Remotely, the battery would be the primary source of power and it's charged by the vehicle, or a solar panel, or on a boat by the outboard.  At home where mains is available there really isn't a need for a battery.  In contrast, remotely some occasions both are present, for example for the hours when a generator is running at a campsite, or mains power is available to the site.

I think a version 2.0 designed from the start with mains charging the battery is probably the go.

This community is awesome as ever, thanks !
Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

dc42

#6
Apr 22, 2012, 06:55 pm Last Edit: Apr 22, 2012, 06:58 pm by dc42 Reason: 1
Easiest way is to use diode OR'ing and to arrange that the wall wart as a higher output voltage than the battery, say 15v instead of 12v. That will ensure that the wall wart supplies the power as long as it has a mains supply.

In fact, if the wall wart is unregulated, then you don't need a diode on the output of the wall wart, just one on the battery output. If in addition the load is well below the rated current of the wall wart, then you will probably find that the wall wart produces a bit more than its nominal output. This, together with the diode in series with the car battery, means that a 12v wall wart will probably work just fine in this arrangement.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up