Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices

E-Blocks

Flowcode Step By Step

PICmicro Projects

Labs

Switch Debouncing

<^< Switch Bounce | Course Index | Schmitt Trigger >^>

Switch bounce is a problem when the switch is part of a counting system. Each time the switch is pressed, instead of the count increasing by one, it can increase by two, three or four, or more!

The solution is to debounce the switch. This does not stop the mechanical bounces of the switch, but cuts out the repeated electrical pulses that the bounce otherwise causes. We add a debouncing circuit to the output of the switch unit.

There are a number of techniques that can be used in the debouncing circuit. We will use a time delay. This relies on making the first of the electrical pulses trigger a long pulse that lasts longer than the train of pulses caused by the bouncing. To do this, add a time delay circuit between the switch unit and the counting system.

The effect of this is illustrated in the following graphs.

The counting system receives just a single pulse each time the switch is pressed.

Switch bounce is very fast - a simple way of avoiding switch bounce problems is to simply make your program wait for a millisecond after a switch input is detected.

<^< Switch Bounce | Course index | Schmitt Trigger >^>

Print - Search - Login

Page last modified on August 26, 2011, at 09:51 AM