When a mechanical switch is pressed, its metal contacts rarely settle immediately. Instead, they may make contact, pull apart, and reconnect several times before staying closed. This happens within a few milliseconds, but a microcontroller can detect each change as a separate input. The effect is known as contact bounce.
In practice, contact bounce can cause a counter to register two presses instead of one, a menu to skip an option, or a device to switch on and then off again. These problems do not necessarily mean the switch is defective. They are a normal consequence of how mechanical contacts behave.
Understanding contact bounce is important when designing circuits that use mechanical switches. This article explains why it occurs, how long it typically lasts, and three practical methods for preventing false inputs, using the push button and rocker switches in this product range as examples.
In This Article
Why Mechanical Contacts Bounce
A contact is a spring-loaded mass. When the actuator is pressed, the moving contact travels until it meets the fixed one, and the kinetic energy in that moving mass has to go somewhere. The elastic behavior of the contact arms turns it into a short oscillation.
The duration depends on the actuation mechanism rather than on the contact material. A snap action mechanism, where the contact moves through an unstable position and accelerates, produces a short, repeatable bounce. A slow actuation mechanism can produce a longer one, and pressing the button gently can make it worse rather than better.
The published range here covers both families. Small rocker switches such as the KCD1-101N three-pin rocker are rated 6 A at 250 V AC and are built for panel controls, while high current push button types are published up to 30 A at 250 V AC. Each mechanism has its own bounce signature.
How Long Does Switch Bounce Last?
Contact bounce in a typical panel switch can last anywhere from a fraction of a millisecond to several milliseconds. Most of the bouncing happens just after the contacts meet. It’s too fast for a person to notice, but a microcontroller reading the input every few microseconds can easily pick up several transitions from a single press.
Bounce time isn’t always consistent, even between switches of the same model. How quickly the button is pressed can affect the way the contacts settle. Dirt, oxidation, and wear can also change the behavior over time. A switch that’s been in service for years may bounce differently from a new one.
This variation matters when choosing a debounce interval. Testing just one switch under ideal conditions won’t tell you much about how the rest will behave. It’s better to check several samples, including switches that have been through repeated use, and leave some margin beyond the longest bounce observed.
RC Filtering for Switch Debouncing
An RC filter uses a resistor and capacitor to smooth out the rapid voltage changes caused by contact bounce. Rather than passing every short pulse directly to the digital input, the circuit slows the voltage transition.
The resistor and capacitor values determine how quickly the voltage rises or falls. With the right values, brief interruptions caused by bouncing contacts won’t produce separate input events. The filtered signal is usually easier to handle when the input has a Schmitt trigger, particularly if the voltage changes slowly around the switching threshold.
The downside is the added delay. Increasing the RC time constant can help suppress longer bounce periods, but it also makes the circuit slower to recognize a press or release. That may be fine for a button on a control panel, but it isn’t appropriate for every input. Emergency stop circuits, for example, need a properly designed safety system rather than a basic debounce filter.
For ordinary panel controls, RC filtering is still a practical choice. The circuit is simple, takes little board space, and works without any software changes.
Debouncing with a Schmitt Trigger or Hardware Latch
A Schmitt trigger uses separate thresholds for high and low input states. This keeps small voltage fluctuations near the switching point from repeatedly changing the output.
It’s often used after an RC filter. The filter smooths the bouncing signal, and the Schmitt trigger produces a sharper transition for the digital circuit. Without filtering, a Schmitt trigger may still respond to contact bounce if the voltage crosses both thresholds.
A hardware latch takes a different approach. Once a valid contact closure sets the latch, further bouncing can be ignored until the circuit is reset. The exact arrangement depends on the switch and the available contacts. An SR latch, for example, can work well with a changeover switch that provides separate set and reset signals.
Hardware solutions are worth considering when the input needs to be handled without waiting for firmware. They can also be useful in circuits where the processor is busy with other tasks or hasn’t started running yet.
Software Debouncing for Microcontroller Inputs
When a switch is connected to a microcontroller, contact bounce can usually be handled in software. The basic idea is to avoid treating every input transition as a new event.
One way is to read the pin at regular intervals and accept a change only after the new state has remained consistent for several samples. Another is to detect the initial transition, wait briefly, and then check the input again.
The timing needs some attention. If the debounce interval is too short, the program may still register extra presses. Set it too long, and the button starts to feel sluggish. A value that works for one switch may not be suitable for another, especially when the contact mechanism and operating conditions differ.
Release bounce is easy to overlook. The contacts can bounce when they open as well as when they close, so the software should check both transitions. Otherwise, the circuit may handle button presses correctly while still producing unwanted events during release.
Software debounce avoids adding components to the board and makes timing adjustments straightforward. For many push-button controls connected to a microcontroller, that’s enough to handle contact bounce reliably.
Which Approach to Choose
Use hardware debounce where the input has to work before software is running, where the signal feeds a counter that cannot tolerate a missed event, or where the design has no processor. Use software debounce where a processor is already reading the input, since it costs no components and is easy to adjust.
Whatever the method, the parameters should come from measurement. The published specifications for the switches in this range describe current, voltage, and mechanism, but not bounce time, because it depends on how the switch is actuated and how old it is.
Measuring takes a few minutes with an oscilloscope or a logic analyzer on a sample of switches, at the force the real user will apply, and it produces a number the design can be built around.
Common Signs of Switch Contact Bounce
Contact bounce often shows up as an unexpected problem during normal use. A menu skips an option, a counter registers an extra press, or a device turns on and then immediately off. These issues may first appear in customer feedback, even when the switch seemed to work normally during testing.
Not every repeated input is caused by contact bounce, though. A slowly changing voltage, a floating input, or an incorrect pull-up or pull-down resistor can produce similar behavior. Checking the signal with an oscilloscope directly at the microcontroller input pin can help identify where the extra transitions are coming from. If the signal is already unstable before it reaches the controller, the problem may lie elsewhere in the circuit. The rocker switch range provides examples of the mechanical switches used in these applications.
The way a switch is mounted can also affect its performance. A button that gets pressed at an angle or a panel that bends slightly during operation may change how the contacts come together. Before changing the debounce circuit or adjusting software timing, it’s worth checking that the switch is properly mounted and that the actuator moves freely.
Conclusion
Contact bounce is a normal part of how mechanical switches work. When a button press registers more than once, the problem is often not the switch itself but how the circuit or software handles the signal.
For basic panel controls, an RC filter may be all that’s needed. Circuits that require more consistent switching can benefit from a Schmitt trigger or a suitable hardware latch, while microcontroller-based designs can usually handle bounce in software.
Whichever approach is used, the debounce timing should be based on actual switch measurements rather than a fixed value taken from another design. Contact behavior can change with use, so allowing some margin helps keep the input reliable as the switch ages.

