MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Building a Schmitt trigger with an op amp
HomeModels
Table of contents

On this page

Electrical & Electronic Basics (600 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

Building a Schmitt trigger with an op amp

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.

1. How it works

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.

2. Numbers and practice

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.

3. Pitfalls and fixes

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.

4. Schmitt trigger design table

ItemRecommendedNote
Window width2 to 3 x noisetoo small still chatters
R110k to 100kinput resistor
R2/R1 ratiosets the windowtypically 5 to 10
Reference decoupling0.1µFstops threshold drift
High-speed dutyTLV3501 / 74HC14op amps too slow
Output filter1k + 1nFcleans edges, check delay

5. Notes

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.

6. References

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.

7. Cautions

⚠️ Three common pitfalls:
① Window narrower than the noise: the chatter survives and the shaping is wasted
② Feedback wired to the inverting input: positive feedback becomes negative and the circuit oscillates
③ Reference pin without decoupling: supply noise walks the decision thresholds

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL