loading

Will this 'switching' circuit work for cabinet lights? Any comments?

Im making cabinet lights using LEDs. I use a transformer to power it off AC mains, but I want it to run on batteries too... So Im making a circuit that would automatically change the source of the power from the mains to battery when the power goes out, and back again when it comes on.

Im using an NPN and a PNP transistor to do the switching. When mains (S1) is on, the NPN is on and current flows from the transformer, when S1 is off, NPN is off and PNP is on and current flows from the batteries.

What I am worried about is that (I think) the transistors need a Gnd on the emitter. Is that right? If I connect the +ve of LEDs to [OUT] and -ve to GND will it work as expected? Can someone try please?

Picture of Will this 'switching' circuit work for cabinet lights? Any comments?
pro2xy (author) 5 years ago
Yes! I was thinking in that direction before but i thought that i would be wasting a lot of battery power on the relay. What didn't strike me before was that I can use the NC of the relay and drive it off the power source (not the battery). Thanks for hitting that into me... :)

So problem solved! though I wish I could make this with very small components but never mind.

Grazie!
pro2xy (author) 5 years ago
Right... Thanks. I will try this. But doesnt this mean that both the sources are powering the output together, in parallel? Wouldnt it still run out the batteries when the mains is on?
pro2xy (author) 5 years ago
Thanks for the reply. I personally would have breadboarded the circuit in the first place if I could have (im not in town).

Ummm.... Right! Mosfets are the way to go. But I'm not in need of a high current here.
I'll google diode Or-ing but I dont think Im going to worry about internal losses here much. Thanks for the advice.
Grazie