What is Switch Debouncing?
Switch debouncing prevents mechanical contact bounce from becoming multiple digital events. A stable state test or suitable hardware rejects brief transitions, while the chosen delay must preserve valid short presses.
The key idea
A mechanical switch can rapidly alternate between open and closed immediately after one actuation. A fast controller may interpret those raw edges as several presses or pulses. Debouncing accepts a state change only after the input remains stable for a suitable interval. Software can measure that time, while a properly designed resistor capacitor circuit with hysteresis can also suppress bounce. A robot start button then generates one clean event per press. The interval should come from measured switch behavior: excessive delay can suppress a brief but valid user press.
What to remember
- Mechanical contacts can produce several edges per press.
- Require a stable state before accepting the change.
- Choose a delay that rejects bounce without losing valid presses.
Check your understanding
Why can an overly long debounce interval be undesirable?
Show the explanation
It can hide a brief valid button press.