Skip to main content
Engineering LibreTexts

10.2: Debouncing

  • Page ID
    26877
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Before beginning the discussion of sequential circuits, there is a problem which occurs when trying to simulate the rising edge of a clock in the circuit. In all of the labs up to this point the toggle switches appear to turn on and off cleanly. This is because the switches are used to represent a constant input to the circuit. The only state of interest is if the switch is 0 or 1. How quickly or cleanly the switch changed from 0 to 1 or 1 to 0 did not matter.

    In reality no switch ever makes a clean transition between 0 and 1. Switches cannot turn on/off cleanly. All mechanical switches, when turned on or off, exhibit a period of time where the switch oscillates between on/off before it settles into a steady value. This oscillation is generally too fast for a human to notice, but the oscillations produce multiple square waves, and thus multiple edge triggers. These edge triggers are slow enough for a latch or flip-flop to see multiple phantom state changes instead of a single clean state change.

    The lab in this chapter will demonstrate how a circuit can transition between defined states. This requires that each time the switch is thrown only a single edge is ever seen as being produced. The multiple edges being generated by the switch cause the circuit to behave incorrectly. So something must be done to get only a single state change when a switch is thrown.

    To handle these multiple phantom state changes, the circuits need to be debounced. A simple way to think about debouncing is to realize that if multiple on/off signals are processed in a small amount of time, they are in reality just noise coming from the switch, and the edges should be combined into a single event.

    Every type of switch, including the keys on the keyboard you type on, must be debounced. This debouncing is generally handled in software which is designed to filter out the noise of the switch. However the circuits we are looking at in this text do not implement a processor, so a software solution is not possible.

    To debounce the circuits in this chapter a hardware approach is used. This hardware approach requires three parts be implemented in our circuit.

    1. A small push button switch is substituted for our toggle switch. The push button provides a much cleaner input than the toggle switch, and so it is easier to get a single clean edge from the pressing of the button. The button does introduce a problem, and that is that it has only one input. Unless the button is pushed, it is neither positive or ground. This is called an open state. All of the chips that have been used in circuits up to the time have been of the HC or HCT variety, largely because of their lower cost. But HC and HCT chips do not handle open states, so this lab requires the chip used to be the ttl version of the 7414 chip.
    2. An extra capacitor is connected to the output of the push button switch. This capacitor helps to further clean up the edge.
    3. A Schmitt inverter, which is a 7414 chip, is inserted into the circuit. A Schmitt inverter is a circuit implemented with hysteresis. Hysteresis means the output of a circuit is dependant not only on the current state, but on the history of its past inputs. So the Schmitt inverter again is used to help clean up the edges from the switch.

    The implementation of the debouncing in the circuit will be presented with the circuits used in this chapter. How the debouncing circuit works is not a topic of this text, and so it is presented without further comment.


    This page titled 10.2: Debouncing is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Charles W. Kann III via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.