owner sign in

5.8 Debouncing mechanical switches

Digital signals produced by mechanical switches are among the most common inputs to a real-time computer (e.g., keypads, keyboards, on-off switches, limit switches, and relays). In every case, the activation of a switch is intended to communicate a single change of state to the computer. However, when a mechanical switch is operated and its new contact is made, the contact can be repeatedly broken and remade over the next few milliseconds—possibly many times. This phenomenon is called switch contact bounce, and it can be problematic for a DI. A computer program monitoring this input might erroneously interpret the bounces as multiple changes of state.

Thus far, our switches have had circuits like the SPDT with pullup resistors, shown in figure 5.13a. We have not needed to worry about switch bounce in part because we have been polling switches. Recall …

This is a preview. Read the full book in print or ebook — get it from MIT Press (ISBN 9780262548762).

Instructor with access? Instructor login.