SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By gonzodada
#118331
Hi

I've some buttons connected to an Arduino and I'm getting lots of bouncing behaviour. Various software solutions haven't helped much so I researched hardware debouncing and found this useful article.

http://www.ikalogic.com/debouncing.php

I get the theory but I haven't used a Schimtt trigger buffer before so I'm not sure I'm selecting the correct part. Is something like this suitable?

http://uk.farnell.com/texas-instruments ... dp/1287608

There seem to be various things preceded by "Schmitt trigger"

If there were a through-hole rather than SMD package that'd be preferable. I've seen some packages with multiple circuits but I only need to debounce two buttons. The buttons are very mechanical (arcade style micro-switches) which is perhaps why they are so noisy.

Thanks
By Kamiquasi
#118334
The common 4093 or 74C14 CMOS ICs, among other, are through-hole and should give you what you need - perhaps a wee bit overkill in terms of the number of pins. There are dedicated debounce ICs as well.

However, as long as you're not running out of program space, a software solution tends to be more elegant. What debounce code are you using, and what problem(s) did you find in its behavior? Might be easier to address that, than for you to factor in additional space and wiring for an IC, resistor and cap.
By Kamiquasi
#118336
oop.. no edit button. Just wanted to drop these two links in here:

http://www.ganssle.com/debouncing.htm - Lots of background information on switch bouncing and solutions in both hardware and software (page two) and explains why some debounce algorithms that seem obvious tend to be insufficient.

http://www.labbookpages.co.uk/electronics/debounce.html - Essentially the same information compressed down to just the essentials. Ends up with the same software algorithm as the previous.
By drug123
#118357
gonzodada wrote:Hi

I've some buttons connected to an Arduino and I'm getting lots of bouncing behaviour. Various software solutions haven't helped much so I researched hardware debouncing and found this useful article.
I agree with Kamiquasi - HW approach is a little bit overkill in most cases. If you have enough program space it is much simplier (and cheaper!) to do it in software.
Hack a day has almost complete list of SW debounce algorithms here: http://hackaday.com/2010/11/09/debounce ... -them-all/