Turn off One LED and on Another when AND Gate is engaged

Thread Starter

recchiap

Joined Nov 6, 2016
3
Hi All,

I've been going through and building all of the various logic gates using transistors, to help learn, and now I'm trying to do something a little different. I'd like to have and LED on until both signals are active (like a NAND), but to also turn on another LED simultaneously (for this example, let's say "off" is Red, and "On" is green.

I built the attached circuit (as well as a few others) and I'm able to get both to turn on, but can't get that elusive "Red off, Green on" working. I also tried driving another NPN with the output of the AND gate, and couldn't get that to work either, the Red stayed on, and the Green never came on.

I'm happy to build the schematics for the other circuits I tried, but I feel the attached gives a good idea of what I'm looking for.

P.S. I know I could build separate circuits, but this is supposed to end up miniaturized, so I'm trying to keep it simple. I'm also trying to get better at being clever with my circuits, instead of just brute force building everything.

Thanks so much!

P.P.S. I did look all over this forum, and Google, which led to trying other circuits, but I couldn't get this guy to work.

Edit: VCC and signal lines are both 9v.
AND Image.jpg
 

MrChips

Joined Oct 2, 2009
30,706
You have created a 2-input NAND gate using two transistors.

You can also do this with one transistor and two diodes on the input to the base of the transistor.
Google diode-transistor logic.

Next, you need an inverter (or NOT gate).Take the output of the NAND gate into the input of the NOT gate and drive the second LED.
 

Thread Starter

recchiap

Joined Nov 6, 2016
3
You have created a 2-input NAND gate using two transistors.

You can also do this with one transistor and two diodes on the input to the base of the transistor.
Google diode-transistor logic.

Next, you need an inverter (or NOT gate).Take the output of the NAND gate into the input of the NOT gate and drive the second LED.
I built the circuit in the diagram below. It (almost) works. The one issue I'm having is that the Green (NOT) LED turns on slightly when either button is pressed. The circuit handles [0,0] and [1,1] great, it's the 10 and 01 that it's having problems with. The modeler indicates it should be getting 1.6uA, which, to my knowledge, should not generate enough light to view. Any thoughts? I quadruple checked the wiring, and tried several pulldown values, all with the same issue.

Also, started reading DTL logic, and it looks like it's going to be a handy addition to my repertoir! Thanks for the advice!DTL NAND - NOT.jpg
 

Thread Starter

recchiap

Joined Nov 6, 2016
3
Where you have the diode feeding the base of the transistor, add an extra diode in series.
D'OH! I was even planning on doing that based on the docs I read, and I forgot to. That was exactly it. I still get a teeny bit of light (even with 3 diodes) but this will be embedded in plastic, and it's not enough light to show through (though I may keep tweaking, and try some higher Vf diodes)

Thank you guys so much for you help, and for introducing a new tool to my arsenal!

For anyone who is interested in Diode Transistor Logic, I found the following resources to be particularly helpful in getting a basic level of knowledge (at least enough to think I know more than I do)

Wikipedia
Falstad (where I did the circuit diagramming as well)
Notes that Harvard.edu has from a class at UConn
 
Top