# Help about threshold voltages for this schmitt trigger

Status
Not open for further replies.

#### MikeMl

##### Well-Known Member
Where is the input?

#### redling1370

##### New Member
Ok lets say that R1 is a photocell or any type of variable resistor. What are the equations that determine the threshold voltages (Vth & Vtl) that will produce the postive feedback (hystersis) for this circuit.

#### redling1370

##### New Member
I understand the circuit operation, I just need help with deriving the equations.

#### ronsimpson

##### Well-Known Member
I just need help with deriving the equations.
Off the top of my head .....aaaaaaaaaaaaaaaaaa......
Pretend pin3 has a pull up resistor of 100k and a pull down resistor of 100k. That gives us 2.5Volts.
When Vo= near 0V then there is a 6.8meg resistor across the pull down resistor.
When V0= near 11V (as high as the LM324 can pull) then the 6.8meg resistor pulls up.
11V-2.5V=8.5V or the voltage across R6.
Current pulling up on pin3 is 8.5V/6.8meg. = 1.25uA.
You can also think about pin3 as having 100k//100k=50k ohms. (it will look like 50k to 2.5V) OR (100k to 5V//100k to 0V) So you can solve by "resistor divider" or by summing up the current in a node.
It is a little complicated because part of your POT is pulling up and part is pulling down.
Very approximately, the impedance on pin3 is about 50k to some voltage (maybe 2.5) and R6 is 6.8meg pulling down to 0 or up to 11 volts. Pulling up is about 1.25uA and pulling down is about 0.36uA. (total is 1.61uA) R6 will offset the voltage on pin3 by 1.6uA/50k.

#### schmitt trigger

##### Well-Known Member
The Theavenin equivalent resistance for R3, R4 and R5 will vary as you sweep R5's cursor.
From 44.6k to 67.8k

Which means that the amount of hysteresis, assuming that U1's Voh is about 10.5 volt, will vary from about 69 to 104 mV.

If you are using a LM324, please wire one of the remaining three unused opamps as a unity-gain follower.
You can then add at its output another resistor (R7) to fix the hysteresis at a known and stable value.

#### MikeMl

##### Well-Known Member
Vo for a LM324 will depend on its load current (i.e. if Vout drives some external load not shown in the schematic). Lightly loaded, VoutHigh will be about 12V-1.5v = 10.5V and VoutLow will be about 10mV

#### audioguru

##### Well-Known Member
The datasheet for the LM324 and LM358 says that its inputs do not work if they are within 1.5V from the positive supply.

#### MikeMl

##### Well-Known Member
With the pot centered, LTSpice says that the Schmitt will snap high when R1 increases through 16.23KΩ, and snap low when R1 decreases through 14.96KΩ.
I'm not about to calculate it... That requires more algebra than I want to deal with... R1 is proportional to V(s).

Notice the little step in V(ni) caused by the positive feedback through R6. The DC levels at V(i) and V(ni) should make audioguru rest easy...

Also notice the high and low levels at V(out). Look familiar?

Write back if you need to know the trigger points with the pot other than centered.

ps, here is the .asc file for the circuit, and the LM324.txt file for the opamp.

#### Attachments

• 2.1 KB Views: 34
• 1.1 KB Views: 28
Last edited:

#### ronsimpson

##### Well-Known Member
Mike,
For those learning SPICE, look at how Mike made a POT and stepped through the values.
thanks
Ron

#### MikeMl

##### Well-Known Member
Sim files added to post #10.

This shows how the trip points move as the pot is adjusted. This simulation shows five runs of varying R1, with the pot set at 10% from the bottom (green), 30% from the bottom (yellow), ... , 90% from the bottom (violet). By using the two cursors on the plot, here are the results:

Pot R1 R1
pos up dn
10% 32.0 29.9
30% 22.3 20.5
50% 16.3 15.0
70% 12.1 11.1
90% 9.07 8.33, where the trip point resistances are in KΩ Last edited:

#### ci139

##### Active Member
http://www.daycounter.com/Calculators/Comparator-Hystereses-Calculator.phtml

though it should be quite simple to deduce a formula (for ideal op amp) if the resistor values are known

this might be helpful (not verified to be typo free) ← this might leave wrong impression about the actually required - so i made it to "half a way" → bug fix. : Ux = Ku·(U2 - U1) + OpAmp's Internal Ground (= usually (Vcc + Vee) / 2 , on the attached schm. OAiG =apx. Us /2)
here we don't have neg feedback so the hysterresis assumes the OUTP voltage being either
1. Zero + α -- occurs when +INP < -INP
2. Vs - ß -- occurs when +INP > -INP
where α and ß are Op Amp's offsets from Neg and Pos rail respectively
• -- so we have to consider only the "helpful formula" where it sets the +INP when the OUTP has fixed eigther near the + or - rail
+ . . . usually the inverting inp ( -IN ) is used for reference voltage that sets the hysterresis center - - if we use it for input signal we vary that center - - PS! - - that most likely sets your hysterresis to be input dependent !!!
• update : in simple form it actually goes like :
1. +INP < -INP output = Neg.Rail so the 6M8 Ω goes in parallel with lower part of the voltage divider at +INP
2. +INP > -INP output = Pos.Rail so the 6M8 Ω goes in parallel with higher part of the voltage divider at +INP
+spice versus math ----------------

#### Attachments

• 582.5 KB Views: 15
Last edited:

#### MikeMl

##### Well-Known Member
...this might be helpful (not verified to be typo free)
Now you see why I prefer to let the simulator do it for me... #### ronsimpson

##### Well-Known Member
Now you see why I prefer to let the simulator do it for me... There are times when I use a soldering iron and just try resistors. 10k=no, 12k=maybe, 22k=works, 30k=no.
In spice you can do the same thing.
.step param w LIST .4 .5 .6 .7 .8
w=0.4 on the first pass and w=0.8 in the last try. "list"
Here I can set a value (resistance, cap., voltage or something) so a voltage can be 0.4 or 0.5 etc volts.
There are many options under ".step......."

I have not in LTSpice, but in P-Spice you can set the components to +/-10% and 5% and 1% then run with all the combinations of R1=+10% while R2=-10%. (this is a production engineering problem)
For hobby electronics you are building only one. For production you might be making 1000s a day. Some of the circuits on the forum, will not work in production because of "tolerance stack up".

Two very nice reasons to learn SPICE.
You can try many values and see what happens.
You can see what happens with part tolerances. What happens if bate= 50 or 200 or 500. Years ago we would sort through 1000s of parts looking for a low gain and a very high gain part to see what happens.

#### Ratchit

##### Well-Known Member
I understand the circuit operation, I just need help with deriving the equations.
You are going to get it. Actually it is quite simple. Just an application of the node method. I used a computer program to solve the equations, but it is not much more difficult with a hand calculator. Although is is not necessary to worry about the output of the op amp because the high resistance of R6, I will include it anyway. Even though the op amp cannot go up/down to the full 12 volts, I will use that voltage regardless. All six equations have only one unknown, so the solutions are simple. Here goes.

1 ) Lowest pot setting and Vo stuck at -12 volts.

for a solution V+ = 0.929618 volts.

2) Middle pot setting and Vo stuck at -12 volts.

for a solution of V+ = 1.78791 volts.

3) Highest pot setting and Vo stuck at -12 volts.

for a solution of V+ = 2.67967 volts

4) Lowest pot setting and Vo stuck at +12 volts.

for a solution of Vo = 1.0814 volts.

5) Middle pot setting and Vo stuck at +12 volts.
for a solution of V+ = 2.01615 volts.

6) Highest pot setting and Vo stuck at +12 volts.
for a solution of V+ = 2.91669 volts.

As you can see, the voltages taking into consideration Vo are not much different than ignoring Vo because of the high resistance of R6.

Ratch

#### Attachments

• 10.9 KB Views: 21
• 11.5 KB Views: 21
• 10.9 KB Views: 18
• 10.9 KB Views: 17
• 11.6 KB Views: 17
• 11 KB Views: 17
Last edited:
Status
Not open for further replies. 