July 13, 2012 AT 11:07 am

Why Capacitors Don’t Fix It

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.

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.