How to use this calculator
Use this Schmitt trigger calculator as a comparator hysteresis calculator for positive-feedback circuits. Enter the reference voltage, feedback resistors and output swing to find the rising threshold, falling threshold, hysteresis width and midpoint, then watch how a noisy input becomes a clean switching output.
- Set the input offset and sine amplitude for the waveform you want to test.
- Enter VREF, RF and RR. The resistor fields use kΩ, which matches typical comparator feedback values.
- Leave VOH and VOL at 5 V and 0 V unless your comparator output swing is different.
- Read V_T+, V_T-, the hysteresis width and the midpoint.
- Use the plot and optional noise setting to check whether the output would chatter near the threshold.
What is a Schmitt trigger?
A Schmitt trigger is a comparator circuit with hysteresis. Instead of a single switching point, it uses two thresholds: one for an input moving upward and another for an input moving downward. That gap is what stops noise around the decision point from making the output chatter, which is why Schmitt triggers are common around sensors, buttons, slow analog edges, zero-crossing circuits and digital input cleanup.
Topology used in this calculator
This calculator models an inverting comparator Schmitt trigger. VIN is applied to the inverting input. The non-inverting input sees a threshold node made from RF to VOUT and RR to VREF. When the output is high, positive feedback pulls the threshold upward; when the output is low, the threshold moves downward. That moving threshold is the hysteresis.
Schmitt trigger formulas
The threshold node is calculated from the present output voltage. Substituting VOH gives the upper input threshold for this inverting circuit, and substituting VOL gives the lower input threshold.
$$ V_{TH}(V_{OUT}) = \frac{V_{REF}/R_R + V_{OUT}/R_F}{1/R_R + 1/R_F} $$
$$ V_{T+} = V_{TH}(V_{OH}) $$
$$ V_{T-} = V_{TH}(V_{OL}) $$
$$ V_{HYS} = |V_{T+} - V_{T-}| $$
RF controls how strongly the output feeds back into the threshold node. RR anchors that node toward VREF. A lower RF compared with RR increases the hysteresis width; a higher RF narrows it.
The threshold network is still a divider idea, so the voltage divider calculator is a useful companion if you want to check the resistor math in isolation. If the signal is noisy before it reaches the comparator, try the low-pass filter calculator as well; filtering and hysteresis often solve different parts of the same problem.
Reading the hysteresis plot
The blue trace is the input waveform and the red stepped trace is the comparator output. The shaded region shows the hysteresis band: inside that band, the output remembers its previous state instead of switching back and forth. Enable random noise to see why two thresholds give a Schmitt trigger its noise immunity.
Example
With VOH = 5 V, VOL = 0 V, VREF = 2.5 V, RF = 90 kΩ and RR = 10 kΩ, the threshold node is 2.75 V when the output is high and 2.25 V when the output is low. In this inverting topology, a rising VIN switches the output low at 2.75 V, and a falling VIN switches the output high at 2.25 V. The hysteresis width is 0.5 V.
Real-world limitations
- Comparator input offset shifts the effective switching point, so both thresholds can move a few millivolts or more from the ideal calculation.
- Output high and low voltages may not equal the supply rails; if VOH or VOL is different, the feedback divider moves and the hysteresis width changes.
- Open-drain or open-collector outputs need a pull-up resistor. In DC, the pull-up can lower the actual high output voltage if the feedback network or load draws current, which shifts the thresholds. Dynamically, the pull-up and output capacitance also slow the rising edge.
- Input common-mode range must be respected. If either comparator input is outside its allowed range, the output may switch late, switch unpredictably, or fail to switch.
- Very slow or noisy signals may still benefit from filtering before the comparator, because hysteresis prevents chatter only after the signal crosses the threshold band.
- Resistor tolerances affect thresholds directly. A 1% or 5% resistor error changes the divider ratio, so the real hysteresis band may be wider, narrower, or shifted.
Schmitt Trigger LTSpice Simulation
Download this LTSpice simulation to inspect the Schmitt trigger comparator thresholds in a transient analysis. You can adjust the reference voltage, feedback network, output levels, and input waveform to see how hysteresis changes the switching points and filters noisy input transitions.
Frequently Asked Questions
-
Is this an inverting or non-inverting Schmitt trigger?
It is an inverting Schmitt trigger: VIN is on the inverting comparator input, and the RF-RR feedback node drives the non-inverting input. -
Why is the rising-input threshold higher than the falling-input threshold?
When the output is high, positive feedback pulls the threshold node upward. VIN must rise above that upper threshold to drive the inverting comparator output low. -
Can I use this for an open-drain comparator?
Yes as a first-pass threshold calculation, but set VOH to the actual pull-up voltage and remember that pull-up resistance and output capacitance affect switching speed. -
Why can the LTSpice simulation differ slightly from the calculated thresholds?
The equations are a static threshold calculation. The LTSpice simulation includes time-dependent behavior: input slopes, output transition time, propagation delay and device dynamics. When the input changes quickly or the output edges are not instant, the apparent switching point can shift slightly from the ideal threshold.