# @stem_antics on Instagram

- **Type:** Video
- **Original URL:** https://www.instagram.com/p/DZyvoNNAmSL
- **Gondola URL:** https://gondola.cc/posts/66891673-stem-antics-instagram
- **Thumbnail:** https://img.gondola.cc/tr:w-,h-,fo-auto/postThumbnails/68c85f32c2.jpg
- **Posted:** 2026-06-20T03:38:34.000+00:00
- **Account Owner:** Stem Antics (@stem_antics) — https://gondola.cc/stem_antics

## Caption

Press a button. One clean press. Yet your microcontroller registers five, ten, sometimes thirty presses in a span of milliseconds. The code isn’t broken. The switch is bouncing.

Mechanical switches don’t close cleanly. When two metal contacts collide, they physically rebound off each other before settling, exactly like a dropped ball bouncing on concrete with diminishing amplitude. During that settling window, typically 1 to 20 milliseconds, the contact rapidly makes and breaks the circuit. The voltage line you’re reading oscillates wildly between HIGH and LOW before stabilizing.

To a human, this is invisible. To a processor sampling the pin millions of times per second, every bounce is a legitimate state change. Each transition gets counted as a real event.

The physics behind it:

- Contact elasticity means the metal surfaces deform and recoil on impact
- Spring tension in the switch mechanism adds mechanical oscillation
- Arc formation across the tiny air gap creates momentary conduction spikes

Three ways engineers kill the bounce:

- Software debounce: ignore further reads for a fixed delay after the first edge, or require the signal to stay stable across multiple samples before accepting it
- RC low-pass filter: a resistor-capacitor network smooths the sharp transitions into a gradual curve the logic gate reads as one event
- Schmitt trigger: hysteresis creates two separate thresholds for rising and falling edges, so noise near the switching point can’t retrigger it

The elegant move is combining an RC filter with a Schmitt trigger input. The capacitor slows the edge, the hysteresis cleans up what remains. No code overhead, rock solid.

Debouncing is a reminder that the physical world is messy beneath our clean digital abstractions. Every reliable interface is built on top of someone solving for the noise.

#stemantics #electronics #embeddedsystems #engineering #microcontrollers

## Stats

- **Views:** 13,473
- **Likes:** 528
- **Shares:** 0
- **Comments:** 4

## Tags

electronics, engineering, microcontrollers, embeddedsystems, stemantics

---
Copyright (c) Gondola