# Need Help With Transistor Logic Circuit Design

Greetings all and Happy New Year!

I've been working on a logic circuit to control the main entrance gate at our ranch for some time now. I've been testing using Falstad's Circuit Simulator.

However, I've run into a problem: In the control head, I need to implement some simple logic to turn on the "STOPPED" indicator when the main entrance gate is not at the open limit (open limit = NOT grounded) AND not at the closed limit (closed limit = NOT grounded), OR when the "STOP" button is pressed (sending 12V to the latch interrupt relay).

I'm going to admit right up front that I have very little electronics knowledge compared to most people out here, but that hasn't stopped me from trying - smiles.

Let me post what I have first, and then I will explain the dilemma:

In the above schematic, I can see the Q3 transistor is forward biased even when all inputs are zero, and I fail to understand why.

I'm also not sure if I have the saturation points set correctly.

And lastly, not matter what I do, I cannot make the current draw of the LED equal to exactly 10 mA in all scenarios - it's close, but I'd like to know if there is a solution where it is always exactly 10 mA.

It DOES work....just not perfectly. Q1, Q2, and Q3 are all 100 hFE transistors, and power consumption is a factor since this is all solar powered.

Appreciate any help on this.

I'm really interested in other's thoughts and ideas as I am sure there is more than a couple of solutions to this problem.

AnalogKid nailed it. Can't thank you enough.

• I'm trying to re-draw your schematic to show the signal flow more clearly. To the right of switch C, is there a connection dot at the two crossed traces? Also, is the truth table the correct desired output? Also, is the LED the only output? You mention relays, but there are no relay drivers in the schematic. Commented Jan 2, 2019 at 4:21
• Yes, that is a connection point. 12V flows to the switch, Q1 and Q3. Yes, the truth table is accurate. Yes, this is only a very small piece of the overall design. I'm just trying to get the "STOPPED" lamp to work properly. The complete schematic is rather large and I don't know if I can post it. There are also other sections that I have not completed. But I have most of the basics done. Commented Jan 2, 2019 at 4:29
• Which switch is which function? Is OUTPUT the "STOPPED" lamp? For the truth table, which represents an open switch - 0 ir 1? Commented Jan 2, 2019 at 5:04
• "A" and "B" are the limit switches. They are only grounded when they are NOT at the limit of the actual gate. If the gate is stopped for whatever reason when it is not at either limit, then "A" and "B" would both be grounded. Reverse logic says that if "A" and "B" are grounded, the gate is not open, not closed, and is somewhere in between, which means it has been stopped for whatever reason (obstruction, manual intervention, fault, etc.). 0 = open for all switches. 1 = closed for all switches. OUTPUT = "Y" means LED is lit. OUTPUT = "N" means LED is off. Commented Jan 2, 2019 at 5:24

Your original circuit, updated for more stable operation. Also, eliminated Q3.

simulate this circuit – Schematic created using CircuitLab

• Open question: How do I reduce the size of an inserted schematic image Commented Jan 2, 2019 at 16:21
• You nailed it. Such a simple, elegant solution. I think I tried to make this work but couldn't for some reason. Here is your solution in Falstad: Commented Jan 2, 2019 at 17:09
• I'm new here, so I don't know. But it looks like you just posted the solution. I need to look at your schematic and understand what's different. You did the whole thing with just 2 PNP's. Hmmmmmm......I'm impressed. – Commented Jan 2, 2019 at 17:13

"I can see the Q3 transistor is forward biased even when all inputs are zero"

I don't see that. The Q3 base is floating when all switches are off, because Q1 and Q2 are off.

Actually, that isn't quite true. Since none of the transistors have any resistance or other circuit at their bases to ensure that they turn off when their inputs are removed, the exact state of each transistor is unknown. There might be enough leakage current through Q1 and Q2 to tickle Q3.

Also, when switches A and B are closed the resistance from the Q3 base to +12 V is only 10 ohms-ish. If Q3 is not a power transistor capable of handling a 1 A base current, it will fail quickly.

• Roger that. I just checked the Falstad simulator and disconnected the output from Q2, and sure enough Q3 went to "cutoff" when all inputs are "0". So clearly there is enough output from Q2 to "tickle" Q3. As for using a power transistor, this whole circuit is simply to illuminate an LED. I clearly have my resistance values wrong. But the Falstad simulator says at most, I am only pulling 11 mA. Commented Jan 2, 2019 at 5:32

Or maybe this

simulate this circuit – Schematic created using CircuitLab

I'm not great with the local schematic editor, but here is another approach.

simulate this circuit – Schematic created using CircuitLab

• I've not worked with MOSFET's before. So this is interesting to me. Part of this exercise is help me learn, and the other part is to have a gate control that does what no other gate control does (at least not that I've found). I've always been a little gun shy of MOSFET's because of their sensitivity to static discharge. Maybe now it the time to start playing with them, particularly if it solves this problem. Although, I can't tie the "A" and "B" inputs in series, I think I can modify what you've given me and simulate it. Thank you! Commented Jan 2, 2019 at 5:47
• Do the A abd B switches have to pull their signals to GND, or could they switch to the +12 V? Commented Jan 2, 2019 at 12:58
• M1 could be a small signal transistor instead, with a 10K base resistor. Commented Jan 2, 2019 at 13:00
• Mornin'! Yes, that's the "rub". "A" and "B" must pull to ground, and "C" must pull to +12V. I was trying to use small signal transistors to build this. But it's not a requirement. It's a limitation of my electronics capabilities - smiles. Commented Jan 2, 2019 at 15:17