Pages: [1]   Go Down
Author Topic: Hardware debouncing  (Read 1758 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Danger Boy
Offline Offline
Edison Member
*
Karma: 14
Posts: 1108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 07, 2012, 01:55:19 am by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

excellent, thank you very much smiley-grin
Logged

Germany
Offline Offline
Faraday Member
**
Karma: 59
Posts: 3071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1285
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This was where I learnt the most about debouncing: http://www.ganssle.com/debouncing.htm
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

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

Danger Boy
Offline Offline
Edison Member
*
Karma: 14
Posts: 1108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Germany
Offline Offline
Faraday Member
**
Karma: 59
Posts: 3071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

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

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Pages: [1]   Go Up
Jump to: