facebook pixel
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 con...

 21.9k

 528

 4

 21.9k

    Suggested Credits
    Tags, Events, and Projects