
Why Capacitors Don’t Fix It. It’s an debate as old as the desert sands – hardware or software debouncing? We are fans of software debouncing but old-schoolers like hardware. Here are some of the pitfalls of hardware debouncing. Ed writes -
As part of our discussion around those Hall effect switches, I cautioned our Larval Engineer that she can’t use capacitors to “smooth out” mechanical switch bounce, even though all of her cronies and (most likely) her profs will advocate doing exactly that. The subject also came up at the local hackerspace when she showed off her project, so I should explain why capacitors don’t solve the problem.
Check out our handy code with interrupt-based debouncing here!

Printable catalog (PDF)
FEED
You can actually solve this in hardware if you need to. One way to do so is with a monostable multi-vibrator.
It is more flexible to solve the problem in software, but sometimes hardware solutions are the best way to go.
Comment by Nick — July 13, 2012 @ 12:39 pm
Hardware debouching IC…. easy as pie
Comment by Rick — July 13, 2012 @ 2:44 pm
smigit trigger also could work….
Comment by Rick — July 13, 2012 @ 2:45 pm
Hardware debouncing ICs are expensive — in many cases costing more than the microcontroller itself.
A schmitt trigger isn’t going to help — switch bounce has a full swing, so you’ll just end up buffering (and delaying) the bounce signal, not eliminating it.
The monostable strobe Nick mentioned has worked well for me in the past for discrete logic (7400) circuits. These days it’s easier to debounce in software when working with a micro, though the strobe idea is still good when you need robust debouncing with low latency and execution time, or if you can’t spare the cycles to debounce in software.
Comment by johngineer — July 15, 2012 @ 10:44 am