MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Schmitt-trigger inputs for switch debouncing: hysteresis that works
HomeModels
Table of contents

On this page

Electrical & Electronic Basics (698 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)(每月更新中)

Schmitt-trigger inputs for switch debouncing: hysteresis that works

A mechanical contact bounces dozens of times per press, and an unconditioned counter goes wild. This page covers bounce reality, the RC plus Schmitt pairing, and the 74HC14 at work.

1. How it works

Contact closure bounces for 5 to 20ms - dozens of transitions that a counter reads as many presses. The hardware fix is two layers: an RC network to absorb the fast edges, and a Schmitt trigger to restore a clean slope. The hysteresis is the point: a 74HC14 switches at about 2.4V rising and 1.4V falling (5V rail), so the RC charge creeping through the middle region cannot make the output dither - exactly what a plain CMOS input, which amplifies noise linearly in that region, cannot promise.

2. Practice and pitfalls

The standard button circuit: closure discharges the capacitor through a 100Ω limit resistor, release charges it through a 10kΩ pull-up into the 74HC14. With 2.2 to 3.3µF the tau of 20 to 30ms covers a 20ms bounce; response delay of 15 to 30ms is invisible to a human. One 74HC14 serves six buttons at pennies each. Rules for multiple channels: independent RC per channel, unused inputs tied high or low, mind the inversion (74HC14 is an inverting buffer), and a 1kΩ series resistor on long switch lines against static and induction. Too small an RC (tau 1ms) lets through the rare bounce that takes weeks to trace.

3. Debounce settings quick table

ApplicationR valueC valueDebounce time
Panel buttons10kΩ2.2µFAbout 25ms
Fast counter input10kΩ0.47µFAbout 5ms
Long-line limit switch10kΩ + 1kΩ series4.7µFAbout 50ms
Rotary encoder10kΩ0.1µFAbout 1ms with software
Relay contact feedback10kΩ1µFAbout 10ms
Optocoupler shaping10kΩ pull-up0.22µFAbout 3ms

4. Notes

Workflow: capture one press on the scope to measure real bounce, set tau to 1.5 or 2 times that, mind the output polarity into the MCU. Start panel buttons at 10kΩ plus 2.2µF and adjust from evidence.

5. References

The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Digital IC specification per GB/T 17574 (IEC 60748 series); logic symbols per GB/T 4728. Always check the device datasheet and the product design file for ratings and derating.

6. Cautions

⚠️ Three common pitfalls:
① A 1ms RC on faith:a 20ms bounce slips through and multi-counts hide for weeks
② One capacitor shared across six buttons:cross-coupled chatter takes over the panel
③ No series resistor on long switch lines:induction and ESD eat the input stage

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