2
\$\begingroup\$

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:

schematic

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?

\$\endgroup\$

5 Answers 5

9
\$\begingroup\$

Try this: -

schematic

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.

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

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

schematic

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.

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

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

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
\$\begingroup\$

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. enter image description here

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

Just for fun :-).
I'll add comment to this in due course if necessary.
But, for now:

  • Does it work?

  • How does it work?

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

schematic

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.

\$\endgroup\$
4
  • \$\begingroup\$ 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. \$\endgroup\$
    – AKR
    Jul 14, 2014 at 6:33
  • \$\begingroup\$ @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. \$\endgroup\$
    – Russell McMahon
    Jul 14, 2014 at 6:44
  • \$\begingroup\$ 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. \$\endgroup\$
    – Russell McMahon
    Jul 14, 2014 at 6:49
  • \$\begingroup\$ @Russell: Clever. :) LTspice circuit list: dropbox.com/s/6p1cf9jh6cxyt1g/LED%20switch.asc \$\endgroup\$
    – EM Fields
    Jul 14, 2014 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.