Go Down

Topic: Hardware debouncing (Read 2044 times) previous topic - next topic

Dylfish

Hey Guys,

I've been looking into using hardware debouncing since I want to start using interupts with a tactile momentary switch.



I've seen heaps of examples out on the internet and most of them show the theory involved but not values of the resistors or caps.
What type of values would be used for say a 100ns debounce on a schematic like this?

Im using an 74ls14 inverting schmitt trigger but i dont know where to start with the values.

P.s. also im getting a little confused how to wire this up on the breadboard, has anyone seen a wiring diagram around on the net that makes it easier to construct?

Cheers,

Dylan



JoeN

#1
Dec 07, 2012, 07:20 am Last Edit: Dec 07, 2012, 07:55 am by JoeN Reason: 1
This guy gives some values and some additional explanation:

http://robotgestation.com/SensorForce.html

The circuit you show and the circuits above are totally breadboard friendly.  If it doesn't make sense to you seeing three or more lines or component ends going into a junction, all you have to do is put  all those lines or conductor ends into one of the breadboard's bus strips, it will connect up to five together and if you need more you can jump two strips together and have a bus with eight inputs on it.

Check out this debounce circuit:

http://www.ecs.umass.edu/ece/m5/tutorials/switch_debounce_tutorial.html

Note the four-way junction and how he implements it on his breadboard.  The base of that transistor is connected to the pull-up resistor on the shared bus strip, to the capacitor through a jumper (and two bus strips), and to the switch through two jumpers (and three bus strips).  But the conductors DO NOT COUNT (for a slow-speed circuit).  So it is all really one junction.  That is how you set it up on a breadboard.

Do you see the light yet?  Once it goes on it will never go off.
I have only come here seeking knowledge. Things they would not teach me of in college.

Dylfish

excellent, thank you very much :D

michael_x

Comparing Dylfish's debouncing, with the one JoeN's second link
I notice the second one does short the capacitor directly to ground when pressing the button. Just opening is delayed by the RC combination.

Does that mean that the first initial contact already discharges the capacitor and the subsequent short bouncing interruptions are too short to effectively recharge it via the resistor ?

Is it correct that a standard pushbutton (NO) only bounces when going open->closed, but closed->open usually does not bounce?

Dylfish's method has delays in both directions, which seems not necessary...

BTW: Time (regarding the initial slope of change) is calculated by R*C ( 1k * 1µF = 1 ms ), which is the easiest part of that topic, for me.

dhenry

The rc constant needs to be bigger than the input bounce's periods. I typically use 10k/.1u, for convenience.

marco_c

This was where I learnt the most about debouncing: http://www.ganssle.com/debouncing.htm
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

fungus

Maybe it's because I'm a software guy but isn't it easy to discard interrupts if they arrive in less than a minimum time frame?

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

JoeN


Maybe it's because I'm a software guy but isn't it easy to discard interrupts if they arrive in less than a minimum time frame?




Debouncing in software is always the easiest way to do it, this but that assumes that the stage of the circuit connected to the switch is a microcontroller, of course.  If it is logic or something like that you have to use these hardware debounce solutions.
I have only come here seeking knowledge. Things they would not teach me of in college.

michael_x

Thanks, marco, for your link. There are some issues with hardware debouncing, and my assumption that "delays in both directions seem not necessary..." 
is just too simplistic. Dylan's first circuit and including a Schmitt-Trigger instead of a simple inverter / transistor has its merits.

And yes, if that button directly goes to a µC, a small delay or other "ignore" mechanism is by far easiest.

fungus



Maybe it's because I'm a software guy but isn't it easy to discard interrupts if they arrive in less than a minimum time frame?


Debouncing in software is always the easiest way to do it, this but that assumes that the stage of the circuit connected to the switch is a microcontroller, of course.


"Interrupt" implies that it is...
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

jtw11

If you still want to go the route of hardware denouncing similar to what you proposed, watch this guys vlog episode about interrupts and hardware denouncing.

I've used the circuitry with great success.

http://www.jeremyblum.com/2011/03/07/arduino-tutorial-10-interrupts-and-hardware-debouncing/

Go Up