When a switch is thrown, there is often not a sharp transition from ON to OFF (or vice versa), and instead there may be oscillations called switch bounce, Figure 75. Bouncing may last for something like 10 ms, which is a long time for a digital system. These oscillations may cause problems unless handled correctly.
A debouncing circuit to filter out the switch bounce is shown in Figure 76. Here, R1 >>R2, and ms.
ANU Engineering - ENGN3213