# AND gate made out of transistors letting current pass despite only one input high

I recently built a gate with transistors, however my meter reads 1.6 volts when only input B is high, and 2.3 while both are high. How can I fix this? (I used 3 volts instead of 6 and 2k instead of 10k) • "I used 3 volts instead of 6 and 2k instead of 10k." I think you've answered your own question. Did you do any calculations? – Transistor Jan 25 at 17:58
• No, I didn't think that would influence the output. Should I use 5k? (I'm new with electronics) – Karol Jan 25 at 18:09
• Use 2 5k resistors in series, then you'll have 10k like the schematic calls for. It's important that the 10k resistor have a "much" higher value than the 4.7k resistor. I'd think you could go up to 100k with no problem. But anything below 10k is going to give the results you saw --- output not very low when B is high. – The Photon Jan 25 at 18:17
• You will need to increase the supply voltage if you want more than about 2V when the output is high. A drop of about 1V across the two transistors sounds about right. – Elliot Alderson Jan 25 at 18:19
• I just replaced the resistors with 20k, the circuit works perfectly now! – Karol Jan 25 at 18:36

B at 3V, A at 0V. Q2 is off, the BE junction of Q1 is forward-biased and drops between 0.6V and 0.7V. I'll use 0.7V. The BC junction of Q1 is reverse-biased, so we ignore any current there. There's 2.3V left, dropped across 2.2k$$\\Omega\$$ + 4.7k$$\\Omega\$$. That works out to $$\i = \frac{3\mathrm{V} - 0.7\mathrm{V}}{2.2\mathrm{k}\Omega + 4.7\mathrm{k}\Omega} \simeq 333\mu\mathrm{A}\$$. So the output voltage is $$\v_{out} = (4.7\mathrm{k}\Omega)(333\mu\mathrm{A}) \simeq 1.57\mathrm{V}\$$. That's well within the margin of error for the BE junction voltage (cool your circuit down enough and it'll read 1.57V!)

With both A and B high we can assume that the BE drop of Q2 is 0.7 (ish) volts. Q1 is saturated, so assume a CE drop of 0.2V there. That gets $$\V_{out} = 3\mathrm{V} - 0.7\mathrm{V} - 0.2\mathrm{V} \simeq 2.1\mathrm{V}\$$. That's still within the ballpark of your 2.3V -- I probably overestimated both the CE drop of Q1 and the BE drop of Q2.

What to do?

To correct the second problem ("only" 2.3V), remember that you're working with bipolar transistors, which just aren't rail-rail devices. Just accept the number and move on. If you must hit 3V, use logic-level FETs.

To correct the first problem, go back and look at the voltage divider formed by the base resistor and emitter resistor. Consider that transistors have lots of current gain -- if you go to a 10k$$\\Omega\$$ base resistor then the emitter resistor will see 1/3 of the 2.3V in my first paragraph -- so your output low would be something like 0.8V. If that's not low enough, go to greater than 10k$$\\Omega\$$ on the base -- I'm betting that up to 47k$$\\Omega\$$ would work.

As a general note, any functioning logic family is going to be built on NAND and NOR gates, because they will regenerate the original signal at each stage. Google resistor-transistor logic and diode-transistor logic if you want to build some old-time bipolar logic circuits. simulate this circuit – Schematic created using CircuitLab

With 3volts input, your circuit is this simulate this circuit – Schematic created using CircuitLab