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

Discussion in 'General Electronics Chat' started by count_volta, Mar 30, 2011.

  1. count_volta

    Thread Starter Active Member

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

    [​IMG]

    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.
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,694
    904
  3. wenn32

    Member

    Nov 9, 2010
    37
    0
    yeah i have seen something like this before while doing Embedded Designs
     
  4. count_volta

    Thread Starter Active Member

    Feb 4, 2009
    435
    24
    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.
     
  5. someonesdad

    Senior Member

    Jul 7, 2009
    1,585
    141
    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.
     
  6. jpanhalt

    AAC Fanatic!

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

    John
     
  7. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    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.
     
  8. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    I prefer mine simpler.

    [​IMG]
     
  9. count_volta

    Thread Starter Active Member

    Feb 4, 2009
    435
    24
    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? ;)
     
  10. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
  11. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    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.
     
  12. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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. ;)
     
  13. tom66

    Senior Member

    May 9, 2009
    2,613
    214
    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.
     
  14. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    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: Apr 1, 2011
  15. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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. :)
     
Loading...