Main > Main Forum

why is there a capacitor in my player 1 coin mech micro switch?

Pages: << < (3/3)

PL1:


--- Quote from: brad808 on January 17, 2013, 08:05:50 pm ---For some reason this isn't sinking into my head. Can someone explain the dumb dumb version as to how this is doing something useful?

--- End quote ---

The Ikalogic website de-bounce page explains that pressing and releasing a button can cause spring-loaded contacts to bounce (picture dropped silverware) resulting in voltage spikes like this at the encoder input:


The discharge and re-charge of the capacitor during the press and release smooths the voltage like this:


By choosing a capacitor that charges and discharges at the right rate, you allow the encoder to record legitimate credits and block false ones.

Software or firmware filters out any remaining ripples -- "Source of error" in second pic.


Scott

brad808:

Awesome, that makes good sense. Thank you.

Sent from my Galaxy Nexus



rCadeGaming:


--- Quote from: PL1 on January 17, 2013, 08:50:29 pm ---By choosing a capacitor that charges and discharges at the right rate
--- End quote ---

What's the math in choosing the right capacitor?

WindDrake:

Picking the right cap is part voodoo, part conventional wisdom for debouncing via noise suppression.

Voltage isn't important. Just pick a cap rated to (typically) 25-33% higher then your operating voltage. This is just headroom over-speccing.

Value is handled by our friend the RC Time Constant.

"But WD!" you'll say. "That takes a pullup resistor!"

Then I remind you that the input is either internally pulled up (90's and onwards) or has a pullup at the board. :)

http://www.ganssle.com/debouncing-pt2.htm

Math is there. Here's the short of it: Most switch bounce lasts less then 10-20msec. Most debounce caps you'll ever see are 0.1 or 1uF.

Larger caps put a big honking delay on the line, which can cause the board to ignore a coin drop that's quick behind the last one.

My guess is that's why that cap is there. That, or that cab's original board had some serious gremlins.

Pages: << < (3/3)

Go to full version