Schmitt Triggers and Hysteresis
A Schmitt trigger is a comparator with positive feedback: it switches its digital output at one voltage while the input is rising and at a different voltage while the input is falling. The gap between those thresholds is called hysteresis.
That gap prevents small input fluctuations from repeatedly changing the output. A slowly changing or noisy analog signal can therefore become a clean, stable digital transition.
The problem: one threshold is too easy to cross
A basic comparator compares two voltages and drives its output high or low depending on which is larger. Imagine using one to detect whether a sensor signal has passed 2.5 V:
- Above 2.5 V, the output is high.
- Below 2.5 V, the output is low.
This seems sufficient until the input approaches 2.5 V. Real signals contain noise: small, unwanted variations caused by interference, sensor uncertainty, power-supply coupling, or other circuitry. A signal that should be steadily increasing might look like this near the threshold:
2.49 V, 2.51 V, 2.48 V, 2.52 V, 2.50 V ...
A comparator with one threshold follows every crossing. Its output can chatter between low and high, producing multiple digital edges where the system expected one. Those extra edges may trigger interrupts, increment counters, or cause state changes more than once.
A slow input creates a similar problem even without much noise. The input spends a relatively long time near the switching voltage, giving disturbances many opportunities to change the result.
Positive feedback creates two thresholds
Feedback means routing some of a circuit's output back into an input. With positive feedback, the returned signal reinforces the circuit's current state instead of opposing it.
For a common inverting Schmitt trigger, the input signal is connected to the comparator's inverting input. The other input, called the non-inverting input, receives both a fixed reference voltage and a fraction of the output voltage through resistors.
The output can be either low or high, so the voltage at the non-inverting input depends on the current output state:
- When the output is high, feedback raises the comparison voltage.
- When the output is low, feedback lowers the comparison voltage.
Those two comparison voltages are the two thresholds.
A simplified circuit might use a 2.5 V reference, a 0 V low output, and a 5 V high output. If equal-valued resistors connect the comparison node to the reference and to the output, the comparison voltage is their average:
- With output high:
(2.5 V + 5 V) / 2 = 3.75 V - With output low:
(2.5 V + 0 V) / 2 = 1.25 V
The exact values depend on the resistor ratio and on the circuit's actual output voltages, but the behavior is the important part.
How the switching sequence works
Assume the input starts low, so the output is high. Because the output is high, the feedback raises the comparison voltage to the upper threshold, 3.75 V in the example.
As the input rises, nothing changes until it exceeds 3.75 V. At that point the comparator switches its output low.
That output change immediately changes the feedback voltage. The comparison voltage falls to the lower threshold, 1.25 V. The input can now fall from 3.75 V to anywhere above 1.25 V without causing another transition, because the output is already low and the current threshold is lower.
As the input continues falling, the output remains low until the input drops below 1.25 V. Then the output switches high again, which raises the threshold back to 3.75 V.
The sequence is therefore:
- Rising input: switch low-to-high or high-to-low at one threshold, depending on the circuit's polarity.
- Output transition: positive feedback moves the threshold away from the current input.
- Falling input: switch back only after crossing the other threshold.
For the inverting arrangement above, a rising input changes the output from high to low, while a falling input changes it from low to high. A non-inverting arrangement reverses the output polarity but preserves the separate rising and falling thresholds.
The difference between the thresholds is the hysteresis width. In the example, it is 3.75 V minus 1.25 V, or 2.5 V.
Hysteresis is not a delay. It is a voltage band in which the circuit deliberately keeps its previous state.
Why noise no longer causes chatter
Suppose the output has switched low after the input rose above 3.75 V. The new threshold is 1.25 V. Noise of a few tens of millivolts around an input of 3 V cannot switch the output back, because the input is nowhere near 1.25 V.
The same protection applies in the other direction. After the output switches high below 1.25 V, the threshold jumps to 3.75 V. Noise around 2 V cannot immediately reverse the output.
The feedback turns the output's current state into part of the decision. Instead of asking only, “Is the input above one fixed voltage?”, the circuit effectively asks, “Has the input moved far enough in the appropriate direction to justify changing state?”
Where engineers encounter it
Schmitt-trigger behavior appears in dedicated logic gates, microcontroller input pins, reset circuits, switch debouncers, and comparator circuits used with sensors. A datasheet may specify separate positive-going and negative-going input thresholds, or simply specify input hysteresis.
When a release note, hardware bug report, or configuration description says an input has a Schmitt-trigger buffer, it means that the input is designed to tolerate a range of ambiguous voltage and noise without producing repeated digital transitions. The result is a clean edge even when the signal that produced it is slow, imperfect, or electrically noisy.