a simple debouncing circuit

Started by ingrowing_whale, May 05, 2006, 04:39:31 PM

Previous topic - Next topic

ingrowing_whale

Hello, I have a circuit with some pushbuttons i don't want to bounce. The vcc is attached to the input of the switch and the ouput is connected to a RS flip flop. I can place anything between these 2 points. What's a simple and efficient way to debounce this?

Sir H C

A resistor and cap.  The resistor from switch to the gate.  The cap from the gate to ground.

H.Manback

#2
I'd recommend making a monostable multivibrator using 2 or 3 transistors, I think it was 3. I did something like that, but I used a IC for it. Just a simple 74123.
The problem with that is that although it debounces fine to a fixed length pulse, the bounce from releasing the switch sometimes triggers it again. In my application I didn't really give a hoot, as long as it gave a pulse for x ms, I didn't care about the release bounce. You could bodge a way out of this I'm sure, but in the end it's probably simpler to make one out of transistors where the pulse is a fixed minimum length, and it stays high if you hold the switch.
Google for monostable multivibrator debounce or something similar and it should come up.

Edit: I'm absolutely not highly experienced with this sort of thing, but about the simple debouncing circuit with resistors and a cap I read that it needs some slight improvements with a diode here and there. I don't remember the exact details. Depending on your use, you should concider that most debouncing circuits have a delay in switching as a conscequence. The delay is usually caused by the cap having to charge and logic triggers switching at about 3 V I believe it was. You have to find a compromise in those circuits between responsiveness and bounce time. Make the delay too short and you get multiple triggers, make it too long and the button responds too slow. With the solution I suggested you don't have this problem. The only tradeoff with long delays there is that you have to wait a certain time before you can trigger again.

Processaurus

There's a bulletproof, instantaneous way to debounce, but it takes a spdt momentary switch that is a break before make type.  Learned about it from old arcade games.  You can use a 4013 flip flop and have the common to Vcc, the NC contact to the reset pin, and the NO contact to the set pin.  That and pull down resistors on the set and reset pins should do it.  This is very reliable, because switch bounce only reinforces the state, and how long you press the switch for is out of the equation.  And the physical distance between the NO and NC contacts makes it impossible (unless the switch breaks) to get more than one pulse for each button press.  You can use two inverters to do the same thing.

If you can't use a spdt, I'd use the RC network followed by a schmitt trigger, to the clock on your flip flop.
Check out this article:
http://www.geocities.com/thetonegod/debounce/debounce.html

Paul Perry (Frostwave)

The belt&braces approach, is a 555 timer as a monostable. I wouldn't recommend it for mass production, but for a oncer, if you already have some 555s.....
But in the real world, Sir HC's resistor & cap is fine...unless there is a problem with the cap staying charged, so that next time you want to toggle, the cap is still high & you can't get an edge to trigger the flip flop!

R.G.

There are simple debouncing schemes and reliable debouncing schemes  - yep, you're right, they're not the same ones.

For more detail than you want, read my postings on switch debouncing in the DSP and Digital forum.

But for simple debouncing, the reliable schemes are (a) S-R flipflop and an SPDT switch (b) J-K flipflop (c) the DOD scheme of using two CMOS hex inverters and an R-C delay with a floating switch.

The simple schemes are resistor/cap, with the switch shorting the cap, followed by a gate or better yet a schmitt trigger gate. The 555 works as well, as it's effectively a schmitt trigger gate.

"Simple" and "switch debouncing" really don't go in the same sentence together.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

snap

MC14490 Hex. 16pin. available through-hole as well as smd. not cheap.