Ragged edges and chatter near the threshold are what Schmitt hysteresis cures. This page covers the two op amp topologies, the threshold math and how wide to make the window.
A Schmitt trigger is a comparator with positive feedback: the output feeds back through a divider to the non-inverting input, splitting the threshold into a high one for rising signals and a low one for falling. Noise smaller than the window cannot chatter the output. The price is that the decision point becomes a band, so positioning applications calibrate to the middle of the hysteresis, per GB/T 4728.
Typical non-inverting form: the signal enters through R1 to the non-inverting input, R2 feeds back from the output, and the reference U_ref sits on the inverting input. The high threshold combines U_ref and the output-low scaled by the divider, the low threshold does the same with output-high, and the window simplifies to R2 over R1 times the output swing. With R1 at 10k, R2 at 100k and a 10V swing the window is about 1V, plenty against 0.5V peak-to-peak noise. The inverting form differs in formula, not in principle.
Sizing: set the window at 2 to 3 times the noise peak-to-peak, too small still chatters, too large blurs the decision point. Keep R1 plus R2 in the tens to hundreds of kilo-ohms so the source is not loaded. Traps: a slow op amp such as LM358 makes mushy high-speed edges, use TLV3501 or a 74HC14 logic Schmitt instead; hysteresis wired to the inverting input becomes negative feedback and oscillates; an undecoupled reference lets supply noise walk the thresholds. A small RC, 1k plus 1nF, after the output cleans residual glitches if the added delay does no harm.
| Item | Recommended | Note |
|---|---|---|
| Window width | 2 to 3 x noise | too small still chatters |
| R1 | 10k to 100k | input resistor |
| R2/R1 ratio | sets the window | typically 5 to 10 |
| Reference decoupling | 0.1µF | stops threshold drift |
| High-speed duty | TLV3501 / 74HC14 | op amps too slow |
| Output filter | 1k + 1nF | cleans edges, check delay |
Schmitt shaping fits switch debounce, encoder pulses and sensor threshold judgement. Measure the noise first, set the window, decouple the reference, pick logic parts for speed, and sweep the input around the threshold on a scope to confirm the chatter is gone.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Waveform shaping circuits per GB/T 4728; safety IEC 60204-1. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.