next_inactive up previous
Up: Lab 6: Debouncing Switches Previous: 1 Prelab


2 Lab

2.1 Switch Bounce

  1. Build the switch of Figure 3. For now, just use a wire as the switch. Plug the wire into GND to bring OUT (the switch output) low, alternatively, unplug it to bring OUT high.
    Figure 3: A simple switch
\input{switch.pstex_t} \end{figure}
  2. Test the circuit with a logic probe and make sure it works as described above.
  3. Connect the output of the switch to one channel of your logic analyzer. Set up the logic analyzer for a 5 MHz internal clock. Start with your switch closed (wire in the GND hole). Click on the single running man button, pull the wire out, and see if you can observe switch bounce.
  4. You couldn't see the switch bounce in the above part because the logic analyzer is much faster than you are. By the time you pulled out the wire after you started sampling, the analyzer had already finished sampling, so you were not able to observe the low-to-high transition of the switch. In order to observe this transition you need to have the logic analyzer stop shortly after this transition. Making the logic analyzer stop after observing a desired pattern is called triggering. To trigger the logic analyzer on the low-to-high transition of your switch, do the following:

  5. Capture the waveform for several switch bounces. How many bounces do you typically get? What is the typical length of a bounce? From the initial low-to-high transition, how long does it take the switch to reach a constant high value?

  6. Repeat with the switch initially in the open position.

2.2 Debouncing Your Switch with an SR latch

  1. Build the circuit shown in Figure 2. Use $ 10k\Omega$ resistors. Use a wire to simulate your switch.
  2. Connect R, S, Q, and Q' to the logic analyzer.
  3. Observe the outputs when you toggle your switch.
  4. Does this circuit eliminate the bouncing?

2.3 Building a Real Debounced Switch

  1. The switch you are using is a single-pole two-throw switch. When your switch is oriented with the hinge on the top:
  2. Again, observe your circuit using the logic analyzer.

next_inactive up previous
Up: Lab 6: Debouncing Switches Previous: 1 Prelab
Copyright © 2008, Electrical Engineering Department, New Mexico Tech
Last Modified 2008-10-10