Connect with us

Push button contact debouncing

Discussion in 'Electronic Basics' started by Allen Bong, Jul 4, 2007.

Scroll to continue with content
  1. Allen Bong

    Allen Bong Guest

    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
    (Please view in courier font)

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

    (created by AACircuit v1.28.6 beta 04/19/05

    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.

  2. 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.
  3. Allen Bong

    Allen Bong Guest

    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?


  4. 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)

  5. Guest

    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

    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.

  6. Lord Garth

    Lord Garth Guest

    Not to forget the debounce circuit in Don Lancaster's CMOS Cookbook....
    You'd get 6 per 4050 package as well.
  7. Also, when entering 'debouncing' into google, the first hit is the

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

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

  9. Allen Bong

    Allen Bong Guest

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

  10. Allen Bong

    Allen Bong Guest

    Thanks Jon, that was great stuff, I will read it in my free time.

  11. Allen Bong

    Allen Bong Guest

    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 ?

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

    (created by AACircuit v1.28.6 beta 04/19/05


  12. John Fields

    John Fields Guest

  13. Rich Grise

    Rich Grise Guest

    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

  14. Rich Grise

    Rich Grise Guest

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

  15. 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
  16. 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

    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.

  17. Allen Bong

    Allen Bong Guest

    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.

  18. I agree with your reasoning. I didn't see that your supply
    was 12 volts.
  19. Guest

    Another alternative for a 12 volt supply would be:
  20. Allen Bong

    Allen Bong Guest

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

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day