# Why would a simple AND gate with 2 transistor leak current when activating a single transistor

I have the following simple AND gate circuit. When pressing down SW2 some current is passing through Q1 resistor (reading about 2v), which slightly lights up the LED.

I've tried a bunch of different transistors and always get the same results.

Could anyone clarify why that might be happening ?

EDIT:

Before pressing SW2 I am reading 0V at Q1 emitter, when pressing SW2 I am reading up to 2V

Similar setup seems to be working for Ben Eater on his logic gate video

simulate this circuit – Schematic created using CircuitLab

• At which node do you read 2V when pressing SW2? Commented Jun 25, 2023 at 8:53
• @uriyabsc at the emitter of Q1. Before pressing SW2 it's at 0V when pressing SW2 it goes up to 2V Commented Jun 25, 2023 at 9:01
• You supply the Led via 10K (R1). Commented Jun 25, 2023 at 9:52
• @MichalPodmanický So the base current flows to the emitter ? Is there a way to prevent that ? Commented Jun 25, 2023 at 10:14
• No. Keep in mind that the base emitter junction is basically a diode. Commented Jun 25, 2023 at 10:48

When pressing down SW2 some current is passing through Q1 resistor (reading about 2v), which slightly lights up the LED. Could anyone clarify why that might be happening ?

Q2's base emitter region acts like a diode and, even if Q2's collector was wholly disconnected, current would flow from the 9 volt supply, through R1, SW2 (activated), into the base and out of the emitter and through the LED. This can be enough current to illuminate the LED.

If you are trying to make a transistor AND gate I suggest you use MOSFETs.

Before pressing SW2 I am reading 0V at Q1 emitter, when pressing SW2 I am reading up to 2V

Yes, that sounds highly likely.

• Does that explain that I am reading 0V at the Q1 emitter when SW2 is not activated and 2v when activated ? Commented Jun 25, 2023 at 9:22
• 2 volts is the volt drop of the LED. If SW2 is inactive then the emitter can't produce current and develop a voltage. Please don't make a habit of editing your question after answers have been given because now, I have to edit my answer. This isn't a forum site. Commented Jun 25, 2023 at 9:27
• You only get collector current when there's base current (simplification but useful in this situation). You only get base current when there is a base-emitter voltage. Therefore, if the base voltage is limited to 0.7 volts, the emitter has to be close to 0 volts for collector current to flow and, that voltage is not sufficient to illuminate the LED. You could try moving the LED in series with R3 and connecting Q2's emitter to 0 volts. Commented Jun 25, 2023 at 10:28
• His LED is like mine - it's on the high side. Q1 B-C junction is reverse biased when S1 is pressed, so there's no path for current to flow. I actually wired that up as well and it worked fine. I generally don't like to leave high impedance nodes such as open bases/gates in circuits, to avoid situations where they can accidentally be turned on/off. For example a VCC transient may couple through Cbc to turn on the base. As circuits get more complex we have to worry about this more, so my 1k to ground is just habit. Commented Jun 25, 2023 at 13:16
• In general I agree that MOSFETs are more ideal for this kind of thing, but we often don't have a MOSFET with the right threshold voltage laying around. That's why I suggested the reconfiguration - it would let me keep going with what I have, without waiting for parts to arrive. And, knowing how to do this multiple ways is a good thing! Commented Jun 25, 2023 at 13:19

As the other answer states, you're biasing the LED through the BE of Q2. An alternate configuration that might work for you is shown below. I get 22uA leakage through my diode and transistor when wired up.

• Thanks, I've tried two 90k on each transistor base -> ground and I am getting the same behaviour Commented Jun 25, 2023 at 9:41
• I posted a bone headed answer. I saw your circuit but somehow mentally I had your diode between the collector of Q1 and the resistor. The other answer is correct. I updated my answer to show a reconfiguration which works (I wired it up and tried it out, I get leakage of 22uA through the LED, which isn't visible with my LED) - if this works in your specific application. Commented Jun 25, 2023 at 10:31