# Is it possible to use just a capacitor to debounce a button?

I have been wondering: why cannot you just hook up a capacitor to a button to debounce it? I have been figuring out how to reduce the work my microprocessor has to do, but I have very limited space on a PCB I am designing, so I don't want to do a full-blown debounce circuit which would complicate the design.

simulate this circuit – Schematic created using CircuitLab

That's a example circuit; sorry for any errors (I am not good at designing circuits with capacitors). Would this even work? For the tack switch, I couldn't find one that matches what it is in real life, but it works for this situation. The button is like the one found here. D10 stands for Digital Pin 10, but it doesn't matter; it just means the Arduino input. I also don't know how big of capacitor I would need, so if this circuit works, what size do I need?

Again, I am just trying to simplify this to make it easier to build while not having to do software debouncing. From looking at how capacitors work, this seems like it would work, but also it might make the button press longer/delay it if the capacitance is too big. They are commonly used for "smoothing" out noise in power supplies, so isn't this a similar thing where it "smooths" out the bouncing? Any circuit modifications to make it work (if needed) would also be appreciated.

• Here's where we have discussed it before: electronics.stackexchange.com/questions/6884/… – Andy aka Apr 7 '13 at 17:54
• Do you realize that you can debounce an input simply by polling it with an interval of at least 50 ms? Less work to do for your aduino :) – Wouter van Ooijen Apr 7 '13 at 17:55
• 50 milli seconds would do - good point Mr O – Andy aka Apr 7 '13 at 18:00
• No, I mean poll with an interval of at least 50 ms, and do whatever you need to do according to the level you detect. – Wouter van Ooijen Apr 7 '13 at 18:14
• @AnnonomusPerson - a delay() in a single-threaded environment means nothing else can happen. While that is one option, another is to do other useful work until it is time to check again. – Chris Stratton Apr 7 '13 at 18:41

• So if I changed the + and the - it would work? – Anonymous Penguin Apr 7 '13 at 18:13
• You mean when it is not pressed whether it conducts electricity? If that is what you mean, I can do it either way because of the nature of the switch I am using. Looking at the link in my question, when not pressed, the button conducts from the top left to the bottom left and the top right to the bottom right. When pressed, it conducts from the top left to the bottom right, and the top right to the bottom left. – Anonymous Penguin Apr 7 '13 at 18:22