I am a beginner and I am trying to build a latching circuit.

In the diagram below, the LED is on while I expect it to be off.

enter image description here

The push button should switch the PNP 2N3906 on, which in turn switches NPN 2N2222A on, keeping the PNP transistor switched on when the button is released.

Did I calculate the base resistors wrong?

From the data sheet for 2n3906 enter image description here

(5.2V-0.95V)/0.005 = 850ohm

I put 1k since I don't have a 850ohm resistor

From the data sheet for 2n2222a enter image description here

(4.2V - 1.2V)/0.015 = 203ohm

I believe the calculations are correct. Why is the circuit closed?

  • \$\begingroup\$ Built or simulated? \$\endgroup\$
    – Andy aka
    May 10, 2020 at 13:51
  • \$\begingroup\$ Have you built the circuit, or is it "wrong" only in simulation? Try adding a 10K resistor from Q1 base to emitter. this should guarantee that Q1 is off until SW1 is pressed. Also, reverse R2 and R4. \$\endgroup\$
    – AnalogKid
    May 10, 2020 at 13:52
  • \$\begingroup\$ Circuit is built on breadboard, led is on \$\endgroup\$ May 10, 2020 at 14:31

2 Answers 2


The PNP, like all transistors, has leakage. So does the NPN. Hence, there is a (very very small) current flowing at all times. Because of the feedback (any leakage thru the PNP hits the NPN's base, is amplified, and sent back to the PNP to drive it on even harder), this circuit turns completely "ON" as soon as power is applied.

There is a very easy fix. Stick a "large-ish" (try 10k) resistor from the collector of the PNP to ground. This resistor should pull the leakage thru the PNP down below the point where the base of the NPN starts to turn on, preventing it from feeding back.

A big reason why your circuit does this is that there is nothing to draw the PNP's leakage away. Although you have an LED and 220Ω in that position, remember the LED is a diode and hence has a very high impedance until it starts to forward bias (typically about 1.5V for red LEDs).

If the 10k I suggest still doesn't fix the issue, take a 2nd 10k and put it across the B-E junction of the PNP. This will draw any of the NPN's leakage away from the PNP's base, thus (hopefully) fixing that also. With both the PNP's and NPN's leakages drained away from the precious bases, the transistors should power up in the OFF state, and you should be good to go.

1 more thing, 220Ω is a bit small for a modern LED. If the PNP goes on fully (which it will), say its V_BE_sat about 0.4V, and 1.5V across the LED, then you have ~ 3.3V across the 220Ω in series with the LED, which is 16.5mA. For a modern small LED, that's kind of generous (they're quite bright even in 5mA range). But I am just quibbling...If you want to see your LED 100 feet away...well then ignore what I just said :)


Putting it simply, the problem with your circuit is that the \$Q_1\$ is always on. Once you turn on the circuit, the \$Q_1\$ diode is forward biased, allowing some current to flow from its emitter to the base of \$Q_2\$. You could solve this problem by making sure that the emitter and base of \$Q_1\$ is held at a small potential (at least smaller than then forward voltage of its internal diode) during start-up. It can be accomplished by adding an additional resistor as follows.

The base resistance of \$Q_2\$ was also increased in order to reduce unncessary power consumption. In principle, I don't see any reason why you would like to have an emitter resistance in the \$Q_2\$.



Your Answer

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

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