3
\$\begingroup\$

I've been looking all over the internet to try to figure out the optimal values for R1, R2, and C but couldn't find info.

I'm trying to ideally make a debouncer that will work with any button on the first white keypad listed from http://www.futurlec.com/Keypads.shtml.

I used 47nF for the capacitor and 2.2K resistors for each resistor but I'm not quite sure if that combo is right. I want the button to respond as fast as possible without debouncing. (like maybe 500uS waiting time between presses)

I then searched for RC calculators online and found two that gave two different results based on the same values I used:

According to http://referencedesigner.com/rfcal/cal_05.php, their answer is 206.800 uS

According to http://sim.okawa-denshi.jp/en/CRtool.php, their answer is 769.60804203044Hz and converting that to time gives me 1.3mS.

Which answer is right? and how do I determine lowest RC delay I should use? The datasheet that comes with the above mentioned keypad does not specify the debounce rate of any of its buttons.

schmitt trigger

\$\endgroup\$
  • \$\begingroup\$ Mike, that keypad is bare-bones and is actually meant to be scanned and debounced using software and an MCU. It has 7 pins for 12 switches. \$\endgroup\$ – jonk Apr 28 '18 at 6:17
  • \$\begingroup\$ I did get it working with 47nF for the caps and 2.2k for resistors and in software a 512uS delay between each scan \$\endgroup\$ – Mike Apr 28 '18 at 16:45
  • \$\begingroup\$ I'd like to see how you wired that up. It's really just supposed to be scanned and debounced in software (without more than perhaps some pull-up resistors if your I/O doesn't already include such things.) \$\endgroup\$ – jonk Apr 28 '18 at 20:39
2
\$\begingroup\$

For filtering C1 should be at the invertor. R2C2 form the debouncing filter. Now R2 can be a high value, so C1 can be smaller. R2C2 also form a low pass filter to remove RF interference and noise spikes.

schematic

simulate this circuit – Schematic created using CircuitLab

R1 is sized to set the switch current. If you go looking closely, you will see that switches (and relays) have a minimum current, as well as a maximum current.

Non-gold/non-carbon contacts need significant current - not microamps.

When you operate them below the minimum current, oxide can build up on the contacts until, they no longer conduct. This becomes an issue when you use something like a micro switch with silver contacts, that is rated for 2A current.

Many switches have totally different contact versions in the same body. e.g these micro-switches have wetting current 1mA for 0.1A version. 160mA for 10Aversion. See micro-load graph See it is voltage dependent.

from just this one graph I will suggest a rule of thumb of 1/50 of max current.

Sometimes an electrolytic capacitor is across the switch, like your diagram, to ensure the oxide is burnt off in a small splat each time the contact closes. this can help high current contacts, but burn out low power gold ones.

In my experiments, I found that switches need to be sampled faster than 15Hz, to avoid the perception that they are slow or miss. 10ms is probably an adequate debounce time. (though there are some keyboards so bad they could play basketball)

\$\endgroup\$
  • \$\begingroup\$ Non-gold/non-carbon contacts need significant current - not microamps. ... Do I just assume every key that doesn't have extended info (such as the one I show) have contacts that aren't gold or carbon? and how much current are we talking here? \$\endgroup\$ – Mike Apr 28 '18 at 15:20
  • \$\begingroup\$ keypads tend to be very low max current and gold or carbon 1k to 10k is good. go read datsheets. \$\endgroup\$ – Henry Crun Apr 28 '18 at 17:40
1
\$\begingroup\$

Your human reaction times are far greater than your spec time. To make matters worse , the keypad degrades contact bounce frequency with excessive force often found at car wash kiosks with impatient drivers and other similar applications.

Since max key entry rates can be expressed as 10 Hz , but for short travel switches, a reasonable filter time is 5 to 15 ms. (test and verify and allow for finger trouble)

Since the logic gate hysteresis is 2/3 Vdd which is close to T=R2C1 use that for your design then verify. R1 is only to limit current should ESD ever get past the plastic edges to the input, which depends on the performance of the design and your system spec from 3kV to 15kV

\$\endgroup\$
  • \$\begingroup\$ rates can be expressed as 10 Hz a reasonable filter time is 10 to 15 ms. ... I'm confused... isn't 10hz = 100ms? or are you caluclating the 10ms differently? \$\endgroup\$ – Mike Apr 28 '18 at 15:22
  • \$\begingroup\$ I forgot to mention user interface expects a fast response of about 10% latency of the maximum key entry rate. I would not want it too fast nor have latency limit key stroke entry rate. you will have to experiment with key velocity and travel for each key entry (1.5mm?) to determine how short an entry is valid. It may be less like 5ms. \$\endgroup\$ – Sunnyskyguy EE75 Apr 28 '18 at 16:01
0
\$\begingroup\$

Designs are seldom optimal because too many parameters are unknown, uncontrolled, temperature-sensitive, etc.

When you want "As fast as possible", think about that.

What you want is NO BOUNCING, right?

Then be conservative in implementing a de-bounce function.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.