debounced switches, why dont they do this, or do they?

Thread Starter

count_volta

Joined Feb 4, 2009
435
This is a simple technique to debounce switches, right. I use it all the time.



I was thinking, this entire circuit can be made microscopic and inserted into the switch enclosure. Why don't they sell switches like that? Heck they would only cost maybe 20 cents more than regular switches. Imagine the possibilities!!! Maybe they already to this, I don't know.

If not, lets sell this idea, who is with me. :D And no I have no idea how to build integrated circuits out of silicon. LOL.
 

Attachments

Thread Starter

count_volta

Joined Feb 4, 2009
435
Yea, but in that link he isn't saying you can buy a complete package like that. I mean when you have to use a 7400 chip with resistors it takes up a lot of space on your board. What if the switch had it inside. The nand gates could be inside the switch already.

On the outside it would look just like a regular switch. Is it not worth it to do that? Seriously it would not cost much more.
 

someonesdad

Joined Jul 7, 2009
1,583
That was used in the electronics of the day in the 70's for debouncing pushbutton switches (at least at a few of the places where I worked). The 7400 was commonly used for this.
 

jpanhalt

Joined Jan 18, 2008
11,087
Specific switch debounce chips are available, but are getting harder to find, probably because it is easy to do it in software.

John
 

kubeek

Joined Sep 20, 2005
5,795
Yea, but in that link he isn't saying you can buy a complete package like that. I mean when you have to use a 7400 chip with resistors it takes up a lot of space on your board. What if the switch had it inside. The nand gates could be inside the switch already.

On the outside it would look just like a regular switch. Is it not worth it to do that? Seriously it would not cost much more.
Probably because you would need power pins, which is kinda difficult for a two-pin switch. It could be possible for the classical 4pin microswitches, but I think the bulk of them is used in applications where pins are debounced in software.
 

Thread Starter

count_volta

Joined Feb 4, 2009
435
I like the resistor capacitor version Bill.

In order to choose the resistor and capacitor, I think it might be a good idea to put the switch bounce through an FFT scope, figure out where to make the cutoff frequency for the LPF. Then use the first order LPF equation.

Or is there a way by intuition to just know? ;)
 

debjit625

Joined Apr 17, 2010
790
I also use the RC version much.... as the bounce time is unknown without proper test of the switch,I use a 10K resistor with a 100nF capacitor it works in most case.However sometimes we need to go for the nand type to do it effeciently.

If its mcu then sometime I also debounce using software....

Anyway the Idea is good for integrating debounce circuit within the switch.
 

THE_RB

Joined Feb 11, 2008
5,438
I like an RC solution too although I use 2 resistors to debounce both / and \ transitions (and not cause over-current situation at the switch contacts).

This also allow use of a larger cap.

But software debouncing still rules. ;)
 

tom66

Joined May 9, 2009
2,595
I prefer mine simpler.

What happens when the switch is closed? The cap discharges quickly, but not instantly (due to switch resistance), putting it in a potential dead band. The schmitt will eliminate some bounce but crucially not all bounce. The solution is a series resistor between cap and gate.
 

Wendy

Joined Mar 24, 2008
23,421
The capacitor discharges very, very quickly, but not so much on the charge. Figure the resistance for a ceramic cap and switch is probably less than a milliohm. What ifs don't really apply, as it works, and works well. It is a tested concept. It is possible to over design anything. Remember, the capacitor holds a charge over very short periods of time, so the transition is smooth, which is what digital logic needs.

Unless there is a reason the switch is especially noisy figure 100ms (0.1s) for 1 TC. If the switch is really noisy then use a longer TC. The switch is surged a little, but I don't think it shortens its lifespan.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
Just use a second resistor (R2) between the top of the cap and switch (as I said in my last post).

Cap discharge is R2 C,
cap charge is R1+R2 C

You don't get symmetrical charge and discharge times but you do get to use a larger cap and quite long time constants, which can give a very effective hardware debounce. You can make R1 smaller than R2 so the charge and discharge times are not too different. :)
 
Top