NewAI Part GeneratorFree to get started
FREE TOOL

Comparator hysteresis (Schmitt trigger) calculator

This Schmitt trigger calculator finds the upper and lower thresholds of a comparator with hysteresis from its resistors, or the resistors for the thresholds you want, for inverting and non-inverting circuits with push-pull or open-drain outputs. Results are rounded to E96 values and rechecked.

Solve for
Examples
Input goes to

Inverting: input on −, divider on +. Non-inverting: input through R1 to +, reference on −.

Output stage
V
V
V

Usually the supply.

Ω

Inverting: reference to +. Non-inverting: input to +.

Ω

Leave blank if there is none.

Ω

In Resistors mode, pick it first: 100 kΩ to a few MΩ.

Upper threshold VH

2.619 V

Lower threshold VL
2.381 V
Hysteresis VH − VL
238.1 mV
Center (VH + VL) / 2
2.5 V

Assumes the output swings to the VOH and VOL you entered. Real push-pull outputs sag with load current, which moves the thresholds; read VOH and VOL at your load from the data sheet.

Transfer characteristic (hysteresis loop)
0123452.12.22.32.42.52.62.72.82.9Input voltage (V)Output (V)VL 2.381 VVH 2.619 V
Input risingInput falling

How do you calculate the thresholds of a Schmitt trigger comparator?

For the inverting circuit (R1 from the reference to +, R2 from + to ground, Rh from the output to +), the + input is a weighted average: VH = (Vref/R1 + VOH/Rh) ÷ (1/R1 + 1/R2 + 1/Rh) with the output high, and VL the same with VOL. TI’s 5 V example with 100 kΩ, 100 kΩ and 576 kΩ gives VH = 2.6997 V and VL = 2.3003 V, so 399 mV of hysteresis.

Schmitt trigger formula for comparator hysteresis

Both circuits use positive feedback through Rh. Writing Kirchhoff’s current law at the + input for each output state gives the Schmitt trigger equations for the two thresholds (TI SNOA997, SBOA313 and TIDU020 use the same method).

Inverting: VH = (Vref/R1 + VOH/(Rh + Rpu)) ÷ (1/R1 + 1/R2 + 1/(Rh + Rpu))     VL = (Vref/R1 + VOL/Rh) ÷ (1/R1 + 1/R2 + 1/Rh)
VH, VL
upper and lower input thresholds
Vref
reference: top of R1 (inverting) or the − input (non-inverting)
VOH, VOL
output high and low levels (pull-up voltage for open-drain)
Rh
hysteresis resistor from the output to the + input
Rpu
open-drain pull-up, in series with Rh while the output is high (0 for push-pull)
Non-inverting: VH = Vref + R1 (Vref − VOL) ÷ Rh     VL = Vref − R1 (VOH − Vref) ÷ (Rh + Rpu)

With a push-pull output the non-inverting hysteresis is (VOH − VOL) × R1 / Rh. To solve for resistors, choose Rh first: the inverting equations are then linear in 1/R1 and 1/R2, and the non-inverting pair gives a quadratic in R1 (TI SBOA313, step 4) plus the reference voltage the − input needs.

Schmitt trigger design examples

Example 1: TI’s 5 V reference design (TIDU020)

5 V push-pull output, R1 = R2 = 100 kΩ from the supply, Rh = 576 kΩ. With the output high, Rh pulls the + input up: VH = (5/100k + 5/576k) ÷ (1/100k + 1/100k + 1/576k) = 2.6997 V. With the output low: VL = 2.3003 V. TI’s design targets 2.7 V and 2.3 V.

Example 2: 1.70 V and 1.60 V on a 3.3 V push-pull comparator

With Rh = 1 MΩ and the divider on the 3.3 V supply, R1 = 62.5 kΩ and R2 = 62.5 kΩ. The nearest E96 values, 61.9 kΩ and 61.9 kΩ, give VH = 1.6995 V and VL = 1.6005 V.

Example 3: non-inverting, open-drain (TI SBOA313)

Thresholds 1.7 V and 1.3 V on a TLV7041 with a 100 kΩ pull-up to 3 V and Rh = 2 MΩ. Solving the quadratic gives R1 = 273.19 kΩ, and the − input needs 1.4957 V (TI gives 273.19 kΩ, and 1.4958 V after rounding R1 to 273 kΩ). From the 3 V supply, an E96 divider of 10 kΩ over 10 kΩ makes 1.5 V.

Inverting Schmitt trigger: thresholds for common hysteresis resistors

R1 = R2 = 100 kΩ from the supply (thresholds centered on half the supply), push-pull output swinging rail to rail.

RhVH at 5 VVL at 5 VHysteresis at 5 VHysteresis at 3.3 V
100 kΩ3.3333 V1.6667 V1.67 V1.1 V
220 kΩ2.963 V2.037 V926 mV611 mV
470 kΩ2.7404 V2.2596 V481 mV317 mV
1 MΩ2.619 V2.381 V238 mV157 mV
2.2 MΩ2.5556 V2.4444 V111 mV73.3 mV
4.7 MΩ2.5263 V2.4737 V52.6 mV34.7 mV
10 MΩ2.5124 V2.4876 V24.9 mV16.4 mV

Non-inverting Schmitt trigger: hysteresis for R1 / Rh

Push-pull output from 0 V to the supply: hysteresis = supply × R1 / Rh, independent of the reference.

R1 / Rh3.3 V supply5 V supply12 V supply
0.0133 mV50 mV120 mV
0.0266 mV100 mV240 mV
0.05165 mV250 mV600 mV
0.1330 mV500 mV1.2 V
0.2660 mV1 V2.4 V
0.51.65 V2.5 V6 V

What moves the thresholds in a real circuit

The comparator’s input offset voltage shifts both thresholds, and many comparators add internal hysteresis on top of what the resistors set: the TLV703x and TLV704x have 7 mV typical (2 mV to 17 mV at 25 °C). Resistor tolerance spreads the thresholds too; TI’s reference design checks 0.1 % parts with a Monte Carlo run, which is worth doing when the window is narrow. A push-pull output only reaches VOH and VOL at light load, so read them at your load current from the data sheet, and remember that anything else the output drives moves them. In the non-inverting circuit the source impedance adds to R1. Very large resistors make bias current, leakage and board contamination part of the divider, and slow the switching edge through the input capacitance.

Glossary

Hysteresis
The gap between the upper and lower switching thresholds, VH − VL.
Upper threshold (VH)
The input level a rising input must pass to switch the output.
Lower threshold (VL)
The input level a falling input must pass to switch the output back.
Positive feedback
Feedback from the output to the + input through Rh, which moves the threshold in the direction that holds the output state.
Push-pull output
An output that drives actively both high and low, close to the supply rails.
Open-drain (open-collector) output
An output that only pulls low; a pull-up resistor sets the high level.

Related guides

Frequently asked questions

Why add hysteresis to a comparator?

Without it, a slow or noisy input crosses a single threshold several times and the output chatters. With hysteresis the input has to rise past an upper threshold to switch one way and fall below a lower one to switch back, so noise smaller than the gap between them is ignored.

How do I calculate comparator hysteresis?

The comparator hysteresis formula starts at the + input, which for the inverting circuit is a weighted average of the reference, ground and the output: VH uses the output high, VL the output low. TI’s 5 V design with 100 kΩ, 100 kΩ and 576 kΩ gives VH = 2.6997 V and VL = 2.3003 V. For the non-inverting circuit with a push-pull output the width is simply (VOH − VOL) × R1 / Rh.

What is the Schmitt trigger threshold voltage formula?

Inverting circuit: VH = (Vref/R1 + VOH/Rh) / (1/R1 + 1/R2 + 1/Rh), and VL is the same with VOL. Non-inverting circuit: VH = Vref + R1 (Vref − VOL) / Rh and VL = Vref − R1 (VOH − Vref) / Rh. An open-drain output adds Rpu in series with Rh while the output is high.

How does a Schmitt trigger work?

Positive feedback through Rh moves the threshold in the direction that holds the output state. A rising input has to pass the upper threshold to switch the output, and a falling input has to pass the lower one to switch it back.

What is hysteresis in a comparator?

The gap between the upper and lower switching thresholds, VH − VL. Peak-to-peak noise smaller than that gap cannot make the output chatter.

Should I use the inverting or the non-inverting circuit?

The inverting circuit drives the input straight into the comparator, so it does not load the source, and the thresholds sit inside the supply. The non-inverting circuit puts R1 in series with the input, which loads the source, but its reference can be anything between the output levels and the output follows the input’s polarity.

How much hysteresis do I need?

More than the peak-to-peak noise on the input at the threshold, plus the comparator’s offset voltage and the spread from resistor tolerance. TI’s reference design uses 0.4 V of hysteresis on a 5 V supply; tens of millivolts is common for clean signals.

Does an open-drain output change the thresholds?

Yes. When the output is high it is pulled up through Rpu, which sits in series with Rh, so the upper threshold of an inverting circuit (or the lower one of a non-inverting circuit) moves. The comparator hysteresis calculator includes it; TI’s TIDU020 suggests keeping Rh above 100 × Rpu so other loads on the output matter less.

What resistor values should I use?

For comparator hysteresis design, pick the hysteresis resistor first, typically 100 kΩ to a few megohms, then solve for the others. Larger values save current but make bias current and leakage matter more; CMOS comparators with picoamp bias currents tolerate megohm networks, bipolar ones need lower values.

More free PCB tools

See all free electronics tools →

Sources

Design the whole board, not one number

ProtoFlow is free AI PCB design software: describe a circuit and get a schematic with real parts, PCB layout with an autorouter, SPICE simulation and Gerber files. Native KiCad, Altium and EAGLE import and export. Free on macOS, Windows and Linux.

Get for Mac

Free to start. No card required.