# Dual power supply switch-over LED circuit

I need a simple circuit that work with two LEDs to do the following:

• When a 12VDC power supply is on, LED1 must be on and the LED for the battery LED2 must be off.
• When the power supply is of LED1 is off and then LED2 of the battery must come on.
• When the 12V supply is returned, the battery LED must be off and the 12V supply LED is back on. Bottom circuit was given by someone but I don't know how to incorporate it to the one above.
• So, what have you tried and where did you get stuck? Commented Aug 18, 2021 at 10:34
• @Justme Comment only: Point understood, and/but "I need" constitutes a question in the context. Instruction in question consruction may be appropriate but may feel a bit pointed on a first post. Commented Aug 18, 2021 at 11:30
• Is there already cicuitry to switch between the power supply and the battery? Commented Aug 18, 2021 at 11:58
• Where does power for LED2 come from, if the battery is disconnected? Commented Aug 18, 2021 at 12:34
• Connect a SPDT relay to the 12 V supply, and use it to switch between the 12 V supply and the battery. Commented Aug 18, 2021 at 12:41

As simple as it is it could be done with one P-channel MOSFET rated for your current & voltages and a small pull-down resistor as long as your battery voltage less than DC source (+12V). And the battery voltage also should be high enough for the rated current/gate voltage.

simulate this circuit – Schematic created using CircuitLab

Once V1 source are connected, gate voltage becomes higher than source the M1 are closed and aren't conducting. So LED2 are off. And LED1 are directly powered from V1.

If V1 are disconnected LED1 are powered off. And M1 gate are pulled down to ground via R1 it opens and starts conducting current from BAT1 to LED2.

Note that I didn't put LED current limiting resistors on the schematic, providing you have some sort of integrated LED modules which you can power from DC source and battery already directly.

Connect a SPDT relay to the 12 V supply, and use the contacts to switch between the 12 V supply and the battery.

• Doesn't answer how the LEDs will indicate the state of the relay. I'd use a DPDT relay instead. Use the other pair of contacts to select which LED is lit. Commented Aug 18, 2021 at 16:33

You know you want an LED indicator for each power source.
So start there:

Next, you need BAT_LED to be switchable. So, let's add a switch (NPN transistor).

So far so good, and the switch is turned on by the battery. Now we just need to allow the power supply (PS) to turn the switch off. I.e. The base of Q1 is pulled up by BAT... let's let PS pull the base down.

That should work. When PS is on, Q2 essentially pulls the base of Q1 to ground, disconnecting the BAT_LED path, and the LED turns off. But what happens to the base of Q2 if PS is removed from the circuit? It basically floats. So, we should add a resistor to give the base of Q2 a path to ground when PS is removed (to ensure Q2 is fully off when it's supposed to be).

Tailor the resistors as needed for your LEDs.

Sim

• And I just realized this question is over 3 years old. Hate when that happens. Commented Apr 7 at 0:48