1
\$\begingroup\$

I'm trying to create an AND gate with transistors. But I've stumbled on a problem.

enter image description here

I've also connected a LED to out. When I turn A on the LED is off. When I turn B on the LED is on??????. When I turn A and B on the LED is on

Why is it when B is on and A is off the LED turns a little bit on? And is it possible to turn the output fully off when B is on and A is off.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ There is no LED shown in your circuit. Please add it. What is happening is that current flows into the base of the lower transistor, and to the emitter, and I guess the LED is connected to Out? So it flows through Out. Maybe change the transistors to MOSFET's. \$\endgroup\$
    – user57037
    Dec 26, 2016 at 7:22
  • 1
    \$\begingroup\$ What is it you are really trying to accomplish? There is probably an easier or different way to do it. Do you just want the LED to turn on when A and B are high? Or is there more to it than that? The best thing to drive the LED would be to put the two NPN transistors on the bottom in series. Put the LED and pullup above them. Only when both bases are high will current flow through pullup, through transistors, to ground. \$\endgroup\$
    – user57037
    Dec 26, 2016 at 17:40

1 Answer 1

3
\$\begingroup\$

Because you are using BJTs, the LED is likely turning on due to B's base current. In detail: current flows through B's 10k resistor, through the base-emitter junction, and through the LED.

To "fix" this, the easiest way would be to use MOSFETs (how logic gates are typically made); current does not flow into a MOSFET gate (in steadystate).

\$\endgroup\$
2
  • \$\begingroup\$ So its not possible to create logic gates with BJT transistors? \$\endgroup\$ Dec 26, 2016 at 7:28
  • \$\begingroup\$ It is certainly possible (early logic families used BJTs), but for driving an LED, you will likely need to design a buffer stage that ensure that the output is either fully on or off. \$\endgroup\$
    – uint128_t
    Dec 26, 2016 at 7:32

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.