Schmitt Trigger Calculator — comparator hysteresis thresholds
Upper and lower threshold voltages and hysteresis width for inverting and non-inverting triggers.
Example: This network trips at 2.619 V going up and 2.381 V coming down — 238.1 mV of hysteresis centred on 2.5 V.
Formula
V+ = (V_cc/R1 + V_out/R_h) / (1/R1 + 1/R2 + 1/R_h)Worked example
This network trips at 2.619 V going up and 2.381 V coming down — 238.1 mV of hysteresis centred on 2.5 V.
V+ = (V_cc/R1 + V_out/R_h) / (1/R1 + 1/R2 + 1/R_h)
with V_out = 5 V
2.619 V
Superposition at the node — each source contributes through its own resistor.
same, with the output low
with V_out = 0 V
2.381 V
hysteresis = V_upper − V_lower
2.619 V − 2.381 V
238.1 mV
Frequently asked questions
Why does my comparator output oscillate?
Because the input is crossing the threshold slowly and noise is pushing it back and forth. Without hysteresis the comparator responds to every crossing, often producing hundreds of kilohertz of chatter that couples back into the input. A feedback resistor from output to the reference node fixes it.
How much hysteresis do I need?
Comfortably more than the noise on your input. A few tens of millivolts handles a clean signal; a noisy sensor may need hundreds. Too much and the comparator stops responding to real signal changes, so aim just above the noise floor.
Why did adding hysteresis move my trip point?
Because the feedback resistor is part of the divider network, not separate from it. It pulls the node towards whichever rail the output is on, which shifts the centre as well as splitting the thresholds. Design the divider for the centre you want after the feedback resistor is in place.
What is the difference between a comparator and an op-amp here?
A comparator is built for open-loop switching, with a fast output stage and no compensation. An op-amp is compensated for closed-loop stability, which makes it slow to slew and sometimes badly behaved when driven to the rails. Use a real comparator if the edge rate matters.
Related tools
Op-Amp Gain Calculator
Gain and resistor selection for inverting, non-inverting, differential, summing and instrumentation amplifier topologies.
Circuits
Voltage Divider Calculator
Compute divider output voltage, or pick the best E24/E96 resistor pair for a target ratio — including the error your load introduces.
Components
555 Timer Calculator
Design astable, monostable and 50%-duty 555 circuits. Get the schematic, the waveform, and a bill of materials in stock E24 values.
Circuits
RC Time Constant Calculator
Charge and discharge timing for an RC network, with the curve plotted and the 63%, 95% and 5τ points marked.
Components
Ohm's Law Calculator
Enter any two of voltage, current, resistance or power and get the other two, with the worked formula and a matching SPICE netlist.
Circuits
Decibel Converter
Convert between dB, dBm, dBV, watts, volts and plain ratios.
Circuits