Help with design of BJT logic gates

Thread Starter

Ron Watkins

Joined Jun 5, 2018
47
If your switching point were 6V, how would you distinguish unambiguously between 'logic high' and 'logic low'?
With the existing circuit:
0v - 0.7v = low
0.7v - 12v = high
This is heavily imbalanced, and I wanted to get the switching point closer to 6v so that I have just as much wiggle-room on both the low and high input levels.
Ideally:
0v - 6v = low
6v - 12v = high
 

Alec_t

Joined Sep 17, 2013
15,149
Ideally:
0v - 6v = low
6v - 12v = high
That is far from ideal. The slightest noise superimposed on a signal very close to 6V would unintentionally flip the logic state from 0 to 1 or vice versa. See post #55 re noise margin.

Edit: If instead you defined low as, say, 0V-3V and high as 9V-12V, that would give you a good noise margin.
 
Last edited:

Thread Starter

Ron Watkins

Joined Jun 5, 2018
47
That is far from ideal. The slightest noise superimposed on a signal very close to 6V would unintentionally flip the logic state from 0 to 1 or vice versa. See post #55 re noise margin.

Edit: If instead you defined low as, say, 0V-3V and high as 9V-12V, that would give you a good noise margin.
That is fine also as far as im concerned.
My issue is that all testing with the circuits so-far has shown them switching at an input around 0.7v, which is way too low to be safe in my application. I need more room around the 0v level than just 0.7v.
 

Thread Starter

Ron Watkins

Joined Jun 5, 2018
47
Q2 is a PNP, not NPN
Ok, sorry about that. I swapped for PNP and this is what I get now. Vout now swings between 0 and 1.4v, but DOES do it around 6V, which is perfect. I think I just need to modify the output resistor to get the output up to 12V, will experiment with that next.
upload_2019-8-1_13-54-46.png
 

crutschow

Joined Mar 14, 2008
38,669
Ok, now it's working. Not sure how it's working, but it is.
When Q1 turns on, it draws current through Q2's base-emitter junction (direction of base-emitter arrow) which turns it fully on, applying the supply voltage to R5.

Note that if you use a CTL R (rotate) and CTL E (mirror image) while moving Q2, you can rotate it with the emitter up to match post #63.
 

Thread Starter

Ron Watkins

Joined Jun 5, 2018
47
Ok, thanks.
Im a hobbyist, never had any classes in this stuff, so just trying to see what I can do.
Im new to LTspice also, so I didn't know any of the shortcuts, ill see if I can flip it over which might look better.
I think this circuit will work for what I want to build, really cool. Thanks for all the help guys.
I tried putting the little hand on the Q2, but CTRL-E didn't do anything. Does it only work when placing new components?
 

djsfantasi

Joined Apr 11, 2010
9,237
Forget the hand. Use the pointer tool (arrow pointing up and left). Click the component with it (it will become hi-lited) and THEN use Ctrl-R..,
 

djsfantasi

Joined Apr 11, 2010
9,237
Glad you posted back so quickly. Mixed LTSpice up with another tool I am using.

Sorry.

Are you single clicking with the hand tool or clicking and holding it?
 
Top