# Alternating between two LEDS using BJTs

I would like to control the output of two LEDs with a single pushbutton. When the button is open, D2 should be off and D3 should be on; when the button is closed, D2 should be on and D3 should be off. I would like to achieve this effect using only BJTs.

The following circuit worked as intended in an EveryCircuit simulation:

simulate this circuit – Schematic created using CircuitLab

However, I'm almost certain that this is not optimal; for example, I have a feeling that a solution can be achieved without requiring D1.

Can anyone point me to a better solution?

Try this: -

simulate this circuit – Schematic created using CircuitLab

When Q1 is activated Q2 is disabled. When Q1 is deactivated by removing the input from the left of R4, R3 will acquire enough current thru D1 and R1 to turn on Q2 and activate D2.

Both LEDs can share the same current limiting resistor too but maybe I might put a resistor across D1 just to leak enough current into the base of Q2. This or use two LED current limiters - the jury is out on this - depends on supply rails to a certain extent.

• And Q1 deactivates Q2 by dropping Q2's Vbe below 0.7V, so don't try this with a Darlington as Q1. Jul 13, 2014 at 18:49
• worked fine, thanks! and much simpler, as I suspected. Jul 13, 2014 at 21:43

Simple circuit that alternates between Red and Green LEDs with only a single switch & resistor:

simulate this circuit – Schematic created using CircuitLab

Switch SW1 can be replaced by either a bipolar transistor or MOSFET.

How this works is very simple: A modern Green LED has a forward voltage drop of about 3.2V. A Red LED has a forward voltage drop of about 1.7V. When the Red LED is connected in parallel with the Green LED, it diverts all of the current to the Red LED and the Green LED goes out.

• You can use the same technique with two identical LEDs by putting a silicon diode in series with the one directly connected to R1. Mar 28, 2015 at 0:08
• Yep. I have several products in production using exactly these techniques. Mar 28, 2015 at 0:24

Slightly simpler (and inspired by Andy's accepted answer)

simulate this circuit – Schematic created using CircuitLab

This is just to share my view point. I am not sure whether this will work, just posting it as answer for public scrutiny to improve my understanding.

• For Russell McMahon, please have a look.
– AKR
Jul 14, 2014 at 6:57
• At best D2 will never light. At worst D1 will never turn off. Jul 14, 2014 at 7:15
• Using MOSFET instead of TRANSISTOR Q1 will remove the worst and best cases?
– AKR
Jul 14, 2014 at 7:18
• That won't fix D1. But a diode in the right place will. Jul 14, 2014 at 7:22

Just for fun :-).
But, for now:

• Does it work?

• How does it work?

• R2 is optional. What does it do and what happens if it is omitted?

simulate this circuit – Schematic created using CircuitLab

Resistor values nominal and may need adjusting.
Value of R4 will affect LED drive and also "something else".
Ratio of R4:R2 not critical but relevant.

LEDs are up to you - ones shown are super marvellous through hole - you'd run them lower than this if using the original Vdd - but only need half the current you'd use with most others.

Transistor is my favourite "jellybean" - use what suits.
SMD version is BC817.

• My comment is not related to your answer, just wanted to know your viewpoint on my logic of implementation.I was trying to implement the op using open drain logic of Transistor, with the switch at the gate of the transistor. But not sure whether it will work or not.
– AKR
Jul 14, 2014 at 6:33
• @AKR I don't see an answer from you - can you show us a circuit. I'm not sure from what you say what it is you have in mind. Jul 14, 2014 at 6:44
• Interestingly - I didn't look in any detail at prior solutions when I posted the above - just noted that they had two transistors so drew up something that works with one. BUT skeleton's of Andy's and Spehro's circuits can be seen in mine. In the latter short out Q3 - and have the same issue that I added R2 to address. In the former, replace Q1 with a switch. And again an extra resistor may be needed to address the issue caused by simplification. Jul 14, 2014 at 6:49
• @Russell: Clever. :) LTspice circuit list: dropbox.com/s/6p1cf9jh6cxyt1g/LED%20switch.asc Jul 14, 2014 at 7:01