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.

  1. 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.

  2. same, with the output low

    with V_out = 0 V

    2.381 V

  3. 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