Maker Pro
Maker Pro

Push button contact debouncing

A

Allen Bong

Jan 1, 1970
0
I was constructing a circuit consisting of 20 toggling relays with 20
push buttons on a PCB measuring 7.5 by 8 inches. So I've chosen 4013
as the toggle F/F and the buttons from a VCR front panel was used to
send ground to the CLOCK input of the 4013. One of the circuits is as
below:
(Please view in courier font)


|VCC
.-.
| | 4093
R | | __
'-' +---| \
| | | )o- X
+-----------------+----+---|__/
| |
o | ---
|=| C ---
o | |
| VCC GND
GND |
.-. +---+
| | | | \
| |10k GND | +--+----- o o
'-' | 4013 | | )|
| .--o--. 1k_ |/ V )|
| +-----|D S Q|------|___|--| - _)|
| | | | |> +----
X +-----------|> | | | relay
| | | R Qo-----+ GND |
o | | '--o--' | |
pb |=| | | | |
o | +--------|--------+ |
| | |
GND VCC | |
+ || | 100k VCC
+---||--+-|___|--+
|| |
100nf |
===
GND


(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

The relay was chattering seriously and sometimes when the button was
pressed, nothing happened. After gathering informations, I came
across the circuit using a 4093 schmitt trigger and a pair of RC as a
contact debounce, but the R and C was not stated. Can someone tell me
what's the best value for a tactile button with the circuit working at
12V ?

Thanks you very much.

Allen
 
J

John Popelish

Jan 1, 1970
0
Allen said:
I was constructing a circuit consisting of 20 toggling relays with 20
push buttons on a PCB measuring 7.5 by 8 inches. So I've chosen 4013
as the toggle F/F and the buttons from a VCR front panel was used to
send ground to the CLOCK input of the 4013. One of the circuits is as
below:
(Please view in courier font)


|VCC
.-.
| | 4093
R | | __
'-' +---| \
| | | )o- X
+-----------------+----+---|__/
| |
o | ---
|=| C ---
o | |
| VCC GND
GND |
.-. +---+
| | | | \
| |10k GND | +--+----- o o
'-' | 4013 | | )|
| .--o--. 1k_ |/ V )|
| +-----|D S Q|------|___|--| - _)|
| | | | |> +----
X +-----------|> | | | relay
| | | R Qo-----+ GND |
o | | '--o--' | |
pb |=| | | | |
o | +--------|--------+ |
| | |
GND VCC | |
+ || | 100k VCC
+---||--+-|___|--+
|| |
100nf |
===
GND


(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

The relay was chattering seriously and sometimes when the button was
pressed, nothing happened. After gathering informations, I came
across the circuit using a 4093 schmitt trigger and a pair of RC as a
contact debounce, but the R and C was not stated. Can someone tell me
what's the best value for a tactile button with the circuit working at
12V ?

Thanks you very much.

I would go for a 10 millisecond or so time constant,
minimum. That means the product of resistance and
capacitance is at least .01, with resistance in ohms and
capacitance in farads.

One combination would be 10k and 1uF.
 
A

Allen Bong

Jan 1, 1970
0
I would go for a 10 millisecond or so time constant,
minimum. That means the product of resistance and
capacitance is at least .01, with resistance in ohms and
capacitance in farads.

One combination would be 10k and 1uF.- Hide quoted text -

- Show quoted text -

Thanks John. If I replace the 4093 with a 4069 or 4049, does the
circuit still work? The data book says the "rise and fall time" of a
4013 clock input should be 5uS or less. Can the outputs of a 4069
achieve that?

Allen
 
J

Jon Slaughter

Jan 1, 1970
0
Allen Bong said:
I was constructing a circuit consisting of 20 toggling relays with 20
push buttons on a PCB measuring 7.5 by 8 inches. So I've chosen 4013
as the toggle F/F and the buttons from a VCR front panel was used to
send ground to the CLOCK input of the 4013. One of the circuits is as
below:
(Please view in courier font)


|VCC
.-.
| | 4093
R | | __
'-' +---| \
| | | )o- X
+-----------------+----+---|__/
| |
o | ---
|=| C ---
o | |
| VCC GND
GND |
.-. +---+
| | | | \
| |10k GND | +--+----- o o
'-' | 4013 | | )|
| .--o--. 1k_ |/ V )|
| +-----|D S Q|------|___|--| - _)|
| | | | |> +----
X +-----------|> | | | relay
| | | R Qo-----+ GND |
o | | '--o--' | |
pb |=| | | | |
o | +--------|--------+ |
| | |
GND VCC | |
+ || | 100k VCC
+---||--+-|___|--+
|| |
100nf |
===
GND


(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

The relay was chattering seriously and sometimes when the button was
pressed, nothing happened. After gathering informations, I came
across the circuit using a 4093 schmitt trigger and a pair of RC as a
contact debounce, but the R and C was not stated. Can someone tell me
what's the best value for a tactile button with the circuit working at
12V ?


It depends on the switch. There was a similar discussion a while back(hell,
maybe a year ago). Some switches are very bad and have need several hundred
miliseconds while others need just a few. Maybe you should do some tests or
if you have an oscope you could look at how long it takes to settle down.

Obviously if you don't use need "rapid fire" then you can increase the time.
So if, say, the button will not be pushed to rapidly you can increase the
time and the only thing that will happen is if its pushed more than once in
that time frame it will be ignored.

Alternatively you could get switches that are designed not to bounce or have
the circuitry inside them the prevent bouncing. (don't remember the details
of these switches but remember them being discussed a while back)

Jon
 
I was constructing a circuit consisting of 20 toggling relays with 20
push buttons on a PCB measuring 7.5 by 8 inches. So I've chosen 4013
as the toggle F/F and the buttons from a VCR front panel was used to
send ground to the CLOCK input of the 4013. One of the circuits is as
below:
(Please view in courier font)

|VCC
.-.
| | 4093
R | | __
'-' +---| \
| | | )o- X
+-----------------+----+---|__/
| |
o | ---
|=| C ---
o | |
| VCC GND
GND |
.-. +---+
| | | | \
| |10k GND | +--+----- o o
'-' | 4013 | | )|
| .--o--. 1k_ |/ V )|
| +-----|D S Q|------|___|--| - _)|
| | | | |> +----
X +-----------|> | | | relay
| | | R Qo-----+ GND |
o | | '--o--' | |
pb |=| | | | |
o | +--------|--------+ |
| | |
GND VCC | |
+ || | 100k VCC
+---||--+-|___|--+
|| |
100nf |
===
GND

(created by AACircuit v1.28.6 beta 04/19/05www.tech-chat.de)

The relay was chattering seriously and sometimes when the button was
pressed, nothing happened. After gathering informations, I came
across the circuit using a 4093 schmitt trigger and a pair of RC as a
contact debounce, but the R and C was not stated. Can someone tell me
what's the best value for a tactile button with the circuit working at
12V ?

Thanks you very much.

Allen

An _old_ favorite is to use an SPDT switch into an RS flip flop.
Schadow switches and the like work very well for this. The nice thing
about the RS is there is no time constants involved. The only possible
fault would be if the switch bounced SO BAD it actually toggled both
contacts.

Software debouncing works well if you try a microcontroller or you
might be able to find some old stock switch debouncer chips.
Hysteresis around an inverter can work well too.

GG
 
L

Lord Garth

Jan 1, 1970
0
<snip>
An _old_ favorite is to use an SPDT switch into an RS flip flop.
Schadow switches and the like work very well for this. The nice thing
about the RS is there is no time constants involved. The only possible
fault would be if the switch bounced SO BAD it actually toggled both
contacts.

Software debouncing works well if you try a microcontroller or you
might be able to find some old stock switch debouncer chips.
Hysteresis around an inverter can work well too.


Not to forget the debounce circuit in Don Lancaster's CMOS Cookbook....
You'd get 6 per 4050 package as well.
 
J

Jonathan Kirwan

Jan 1, 1970
0
Not to forget the debounce circuit in Don Lancaster's CMOS Cookbook....
You'd get 6 per 4050 package as well.

Also, when entering 'debouncing' into google, the first hit is the
semi-famous:

http://www.ganssle.com/debouncing.pdf

Which seems to have been updated quite recently (since I last looked
at it, in fact.)

Jon
 
J

Jonathan Kirwan

Jan 1, 1970
0
Also, when entering 'debouncing' into google, the first hit is the
semi-famous:

http://www.ganssle.com/debouncing.pdf

Which seems to have been updated quite recently (since I last looked
at it, in fact.)

Jon

Okay. Now that I've looked, the "update" may be more a matter of
adding some advertising for his new seminars at the end of it.

Jon
 
A

Allen Bong

Jan 1, 1970
0
An _old_ favorite is to use an SPDT switch into an RS flip flop.
Schadow switches and the like work very well for this. The nice thing
about the RS is there is no time constants involved. The only possible
fault would be if the switch bounced SO BAD it actually toggled both
contacts.

Software debouncing works well if you try a microcontroller or you
might be able to find some old stock switch debouncer chips.
Hysteresis around an inverter can work well too.

GG- Hide quoted text -

- Show quoted text -
An _old_ favorite is to use an SPDT switch into an RS flip flop.
Schadow switches and the like work very well for this. The nice thing
about the RS is there is no time constants involved. The only possible
fault would be if the switch bounced SO BAD it actually toggled both
contacts.

Well, I have thought about that too, but SPDT push buttons are hard to
find here and the only one I can get is a micro-switch with a short
lever. The whole will be covered under a thin membrance with word
printed on it, so the switch has to somejow be small and able to lay
flat on the PCB.
Software debouncing works well if you try a microcontroller or you
might be able to find some old stock switch debouncer chips.
Hysteresis around an inverter can work well too.

At the moment the IC count is 10 x 4013 and 5 x 4093 (or 4 x 4050)
plus 20 pieces of 24V 10A relays. If I really can't squeeze all that
many components onto the PCB, I'll have no choice but to turn to a PIC
16F877 or similar. Any other suggestion for the controller that might
fit in? Software debouncing is so much easier!

Allen
 
A

Allen Bong

Jan 1, 1970
0
An _old_ favorite is to use an SPDT switch into an RS flip flop.
Schadow switches and the like work very well for this. The nice thing
about the RS is there is no time constants involved. The only possible
fault would be if the switch bounced SO BAD it actually toggled both
contacts.

Software debouncing works well if you try a microcontroller or you
might be able to find some old stock switch debouncer chips.
Hysteresis around an inverter can work well too.

GG- Hide quoted text -

- Show quoted text -

Since we are on this topic, I have been wondering for a long time if
this modified form of RS flip flop has any debouncing effect ?



4011
__
+-------+--------------| \
| | | )o---+------ Q
| o | +--|__/ |
|=|> | |+. _-+
| o | ``-.''
| | +'' ``-.
| | +--| \ `+
| | |\ | )o---+------ /Q
| +-| >O---------|__/
| |/
=== 4069
GND


(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Regards,

Allen
 
J

John Fields

Jan 1, 1970
0
Since we are on this topic, I have been wondering for a long time if
this modified form of RS flip flop has any debouncing effect ?



4011
__
+-------+--------------| \
| | | )o---+------ Q
| o | +--|__/ |
|=|> | |+. _-+
| o | ``-.''
| | +'' ``-.
| | +--| \ `+
| | |\ | )o---+------ /Q
| +-| >O---------|__/
| |/
=== 4069
GND
 
R

Rich Grise

Jan 1, 1970
0
Thanks John. If I replace the 4093 with a 4069 or 4049, does the
circuit still work? The data book says the "rise and fall time" of a
4013 clock input should be 5uS or less. Can the outputs of a 4069
achieve that?

I'd use a 40106 to get six sections - it's got the schmitt trigger input,
which is highly recommended for this sort of application, because of the
hysteresis.

Cheers!
Rich
 
R

Rich Grise

Jan 1, 1970
0
Okay. Now that I've looked, the "update" may be more a matter of
adding some advertising for his new seminars at the end of it.

No matter. The ad isn't until the end, and it's really a rather enjoyable
read. :)

Thanks!
Rich
 
J

John Popelish

Jan 1, 1970
0
Allen said:
Thanks John. If I replace the 4093 with a 4069 or 4049, does the
circuit still work? The data book says the "rise and fall time" of a
4013 clock input should be 5uS or less. Can the outputs of a 4069
achieve that?

The problem with using either a 4069 or 4049 is that they do
not have a snap action (Schmitt trigger), but just amplify
the slow rise from the filter capacitor. You can expect a
gain of at least 10, probably several times that much, but
the rise time of 10 ms at the cap will only be shortened to
..1 to 1ms, much slower than the 5us limit. You could
cascade several inverters, to speed up that rise, but a
Schmitt trigger is definitely the clean way to get a fast
rise time out of a slow rise time. An example would be
74HC14.
http://w3.id.tue.nl/fileadmin/id/objects/E-Atelier/doc/Datasheets/74hcXX/74hc_hct14.pdf
 
J

Jonathan Kirwan

Jan 1, 1970
0
No matter. The ad isn't until the end, and it's really a rather enjoyable
read. :)

Yes. I was well past his current discussion... about three decades
ago. Some years ago, maybe two?, I had read it an earlier version to
see if there was anything new or not already entirely crystal clear to
me. There wasn't anything new. So this time around I was really just
skimming to look for anything added of note. The first page talked
about revision dates and I was curious, of course. I didn't see
anything and quickly found myself at the advertisement at the end and
that's when it instantly dawned on me that the ad was probably more of
the reason why the revision dates were there than anything else. I'd
like a note of that up front, so that returning readers could save a
little time. In any case, I thought it was worth mentioning here so
that any other past-reader of an earlier version had some idea what to
expect.

I completely agree with you that it is worth reading, if you aren't
already familiar with some of the details involved. I'd recommend a
somewhat different discussion about the software, where software is
appropriate, though.

Jon
 
A

Allen Bong

Jan 1, 1970
0
The problem with using either a 4069 or 4049 is that they do
not have a snap action (Schmitt trigger), but just amplify
the slow rise from the filter capacitor. You can expect a
gain of at least 10, probably several times that much, but
the rise time of 10 ms at the cap will only be shortened to
.1 to 1ms, much slower than the 5us limit. You could
cascade several inverters, to speed up that rise, but a
Schmitt trigger is definitely the clean way to get a fast
rise time out of a slow rise time. An example would be
74HC14.http://w3.id.tue.nl/fileadmin/id/objects/E-Atelier/doc/Datasheets/74h...- Hide quoted text -

- Show quoted text -

I do have some 74HC14 but my application will be working at 12V but
the max voltage of 74HCxx is only 6V, so it cannot be substituted as I
want. But Rich has suggested using 40106. I think this should be my
choice for this application.

Allen
 
J

John Popelish

Jan 1, 1970
0
Allen said:
I do have some 74HC14 but my application will be working at 12V but
the max voltage of 74HCxx is only 6V, so it cannot be substituted as I
want. But Rich has suggested using 40106. I think this should be my
choice for this application.

I agree with your reasoning. I didn't see that your supply
was 12 volts.
 
A

Allen Bong

Jan 1, 1970
0
I agree with your reasoning. I didn't see that your supply
was 12 volts.

Oops, I am sorry about that as I didnt state clearly on the
schematics. but I did mention 12V in the text.

Thanks.
 
Top