Sorry if this is a duplicate, I don't know the actual term for what this is called.

I am trying to create a circuit where the push button will switch the current from Red LED to Blue LED on right. Currently the blue LED lights up but Red one doesn't go off. I know I am missing something small which is apparently big enough.

What am I missing?

LEDs: 200 ohm
Transistor Base: 1K

Working Voltage: 5V
Transistor: Generic NPN

Simulation of the circuit below

Schematic Breadboard

  • 2
    \$\begingroup\$ You have connected the red LED directly to the power. How could it be affected by the rest of your cicruit? \$\endgroup\$ – Wouter van Ooijen Aug 31 '15 at 9:33
  • \$\begingroup\$ you need SPDT switch between the collector transistor and the two leds. \$\endgroup\$ – R Djorane Aug 31 '15 at 9:34
  • \$\begingroup\$ @codo I want something logical rather then mechanical also that has a small footprint like the transistors. \$\endgroup\$ – echo_salik Aug 31 '15 at 9:41
  • \$\begingroup\$ @WoutervanOoijen I know but the current follows the path of least resistance so shouldn't it take the transistor route instead. Im working on that principle. \$\endgroup\$ – echo_salik Aug 31 '15 at 9:42
  • \$\begingroup\$ what i'm seeing here is switch that can put on/off the LED D2, D1 is still working independently from the switch \$\endgroup\$ – R Djorane Aug 31 '15 at 10:13

Your idea 'current follows the path of least resistance' is an approximation, and it holds only when there is a limited amount of current. In your case you use a lab power supply, which is a constant voltage source, which will supply all the current you ask from it. Hence both the transistor and the red LED parts get current.

A way to switch the other LED of when you press the switch is show below.


simulate this circuit – Schematic created using CircuitLab

The principle is that with the switch open, Q1 gets a base current via R1 and D1, so it conducts, and current flows through R2, D2, Q1, so D2 lights up. But the base current is too small for D1 to light up.

When you close the switch, Q1 gets no base current, and the current through D1 is large enough to light it up.

  • \$\begingroup\$ Can I apply this to switch input on ICs rated 5V? \$\endgroup\$ – echo_salik Aug 31 '15 at 10:46
  • 1
    \$\begingroup\$ Yes, but use 5V supply, and it might be bettre to leave out the LEDs, or bridge them with a 22k resistor, to make sure that the high level is close to 5V. \$\endgroup\$ – Wouter van Ooijen Aug 31 '15 at 10:51
  • 1
    \$\begingroup\$ Place say 2K2 across D1 if it still glows dimly while S1 is open and D2 is lit \$\endgroup\$ – Autistic Aug 13 '16 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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