0
\$\begingroup\$

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

enter image description here

schematic

simulate this circuit – Schematic created using CircuitLab

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

2 Answers 2

2
\$\begingroup\$

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.

\$\endgroup\$
13
  • \$\begingroup\$ Does that explain that I am reading 0V at the Q1 emitter when SW2 is not activated and 2v when activated ? \$\endgroup\$
    – silkAdmin
    Commented Jun 25, 2023 at 9:22
  • \$\begingroup\$ 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. \$\endgroup\$
    – Andy aka
    Commented Jun 25, 2023 at 9:27
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Andy aka
    Commented Jun 25, 2023 at 10:28
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – 65Roadster
    Commented Jun 25, 2023 at 13:16
  • 1
    \$\begingroup\$ 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! \$\endgroup\$
    – 65Roadster
    Commented Jun 25, 2023 at 13:19
1
\$\begingroup\$

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.

NPN AND Gate

\$\endgroup\$
2
  • \$\begingroup\$ Thanks, I've tried two 90k on each transistor base -> ground and I am getting the same behaviour \$\endgroup\$
    – silkAdmin
    Commented Jun 25, 2023 at 9:41
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – 65Roadster
    Commented Jun 25, 2023 at 10:31

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.