The process of removing false impulses on a contact switch (i.e. keyboards, push buttons...)

Switches, being physical entities, do not generate the perfect square waves (0's and 1's) that digital circuits expect:

 on|         /\   /--------------------\   _
   |   /\   /  \  |                     | / |
...|...|.|./....\/......................\.|.|.........
   |   | \/                              \/  \ 
   |   |                                     \ 
off|--/                                       \------
   +==========================================time===>
       #1# ##2### ###########3########### #4#
The diagram above shows the signal level generated by a switch pushed by say, a human finger. Because the contacts can be be dirty or corroded, the pressure applied not constant, the signal contains noise.

In this example the 'on' signal is generated by the transition of the signal from below to above the threshold (dotted line). The dirty signal generated here by a single key press would result into four on-off (####) cycles.

Hence the signal needs to be debounced, either by an electronic circuit by adding a timing counter in software; recognizing an ON signal only if it stays above the threshold for more than a minimum amount of time.

Log in or register to write something here or to contact authors.