Switch bounce and debounce lab
Build it step by step
0 of 6 doneBuild the counter
Place the 74HC193, wire four LEDs to QA to QD, set DOWN and LOAD high and CLR low through its 10 kΩ.
Test the raw button (source A)
Join the button to pin 5. Press once and watch the count jump by more than one often.
Build the RC and Schmitt stage (source B)
Button, pull-up, 10 µF and the 74HC14 as in the table. Move the jumper to pin 2 of the 74HC14.
Compare
Each press now adds exactly one.
Build the SR latch (source C)
Two NAND gates cross-coupled, with SET and RESET buttons. Move the jumper to its Q output.
Understand
The latch gives one clean edge per SET press whatever the bounce, and the RC stage gives a clean press at the cost of a short delay.
How do you build a switch bounce and debounce lab?
See a button bounce on a counter, then fix it with RC plus a Schmitt trigger, and with an SR latch. You need 74HC14 hex Schmitt-trigger inverter, 74HC00 quad NAND gate, 74HC193 up/down counter, Tactile push button 6 mm × 4, Resistor 10 kΩ × 5, Electrolytic capacitor 10 µF, LED 5 mm red × 4, Resistor 330 Ω × 4, Breadboard power supply module (MB102), 12 V 2 A DC adapter, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 6 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 12
Parts list
- Integrated CircuitsBuy
- Integrated CircuitsBuy
- Integrated CircuitsBuy
- SwitchesBuy
- PassivesBuyResistor 10 kΩ × 5
- PassivesBuy
- SemiconductorsBuyLED 5 mm red × 4
- PassivesBuyResistor 330 Ω × 4
- PowerBuy
- PowerBuy
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 74HC193 pin 5 (UP clock) | Jumper to one of three sources A, B or C | The test input |
| 74HC193 pin 4 (DOWN), pin 11 (LOAD) | +5 V | Idle high |
| 74HC193 pin 14 (CLR) | Reset button to +5 V with 10 kΩ to GND | Reset the count |
| 74HC193 outputs QA, QB, QC, QD (pins 3, 2, 6, 7) | Four LEDs through 330 Ω to GND | Binary count |
| Source A (raw) | Button from +5 V to a node with 10 kΩ to GND | Goes high when pressed |
| Source B (RC + Schmitt) | Button from node to GND with 10 kΩ to +5 V and 10 µF (+ to node) | Pin 1 of the 74HC14, output at pin 2 goes high when pressed |
| Source C (SR latch) | Two buttons (SET, RESET) to GND with 10 kΩ pull-ups | 74HC00 gates: pin 1 = SET, pin 4 = RESET, pin 3 to pin 5, pin 6 to pin 2, output Q at pin 3 |
| Unused inputs on 74HC14 and 74HC00 | GND | Never float |
No code needed
No code. Power: a breadboard power supply module (MB102) from the 12 V adapter, with its jumper set to 5 V. Connect pin 14 of each 74HC00 and 74HC14 and pin 16 of the 74HC193 to +5 V and the grounds (pin 7 on the 74HC00 and 74HC14, pin 8 on the 74HC193) to 0 V.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Source A, 20 presses | Count advances more than 20 times in total |
| Source B, 20 presses | Count advances exactly 20 times |
| Source C, 20 SET presses | Count advances once per SET after each RESET |
| Press and hold | No repeated counting on B or C |
If it does not work
All sources count too fast
A floating pin (a pull-up missing or an unused input untied). Tie unused inputs to GND.
Counter does not reset
CLR must go high briefly. Check the reset button and the 10 kΩ to GND.
RC stage is slow to respond
10 kΩ with 10 µF is 100 ms. Use a smaller capacitor for a quicker feel.
Latch counts on RESET
The outputs of the NAND gates are crossed wrongly. Re-check pins 2, 3, 5 and 6.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the switch bounce and debounce lab?
74HC14 hex Schmitt-trigger inverter, 74HC00 quad NAND gate, 74HC193 up/down counter, Tactile push button 6 mm × 4, Resistor 10 kΩ × 5, Electrolytic capacitor 10 µF, LED 5 mm red × 4, Resistor 330 Ω × 4, Breadboard power supply module (MB102), 12 V 2 A DC adapter, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the switch bounce and debounce lab take to build?
About 60 minutes for a beginner maker, in 6 steps.
How do I know the switch bounce and debounce lab works?
Source A, 20 presses: Count advances more than 20 times in total. Source B, 20 presses: Count advances exactly 20 times. Source C, 20 SET presses: Count advances once per SET after each RESET.
All sources count too fast: what should I check?
A floating pin (a pull-up missing or an unused input untied). Tie unused inputs to GND.
Counter does not reset: what should I check?
CLR must go high briefly. Check the reset button and the 10 kΩ to GND.
RC stage is slow to respond: what should I check?
10 kΩ with 10 µF is 100 ms. Use a smaller capacitor for a quicker feel.
Latch counts on RESET: what should I check?
The outputs of the NAND gates are crossed wrongly. Re-check pins 2, 3, 5 and 6.
