8
\$\begingroup\$

I have a circuit where I am using a tactile switch to pull 3.3v down to ground and investigating debouncing the button. My relevant part of the circuit is

enter image description here

The 100nF cap does work here my signal has ringing that operates in the undefined region and causes a few false clicks. Increasing the capacitance to 1uf makes it worst. I tried using 10nF which was better. It reduced the ringing time but did not remove it. Image of scope trace below for 10nF.

enter image description here

This ringing is not really a switch bounce contact problem is it. What causes this ringing. There is capacitance on the power rail could it be that ?

My best results are with removing the caps entirly.

I know I can use software to solve this issue so it is not a big issue but I am using this as a learning exercise.

My easyeda design:

Top:

top

Bottom:

bottom

\$\endgroup\$
3
  • 2
    \$\begingroup\$ From experience; the quality of the tactile switch matters too. \$\endgroup\$ Commented Jun 3, 2020 at 13:20
  • 4
    \$\begingroup\$ um, you've put traces and ground plane in the areas that really should be keepouts under your RF module, shouldn't they? \$\endgroup\$ Commented Jun 3, 2020 at 13:26
  • \$\begingroup\$ Thanks Marcus. I will remove from under the antenna. \$\endgroup\$ Commented Jun 3, 2020 at 14:00

2 Answers 2

10
\$\begingroup\$

The ringing is caused by poor layout (possibly breadboarding is the worst culprit) AND the fact that your button's switch-contact is shorting out a charged capacitor - the instantaneous current flow is (practically) tens of amps and that surge (along with poor wiring and layout creating excessive loop inductance) causes the ringing.

Try putting a 10 ohm resistor in series with each capacitor.

\$\endgroup\$
2
  • \$\begingroup\$ Its a pcb made at JLPCB. The traces are short with a large ground plane. I have added a link to the pcb on my original question. I will try the resistor. Thanks \$\endgroup\$ Commented Jun 3, 2020 at 12:26
  • 5
    \$\begingroup\$ The direct short of a ceramic capacitor is for sure the reason. I have seen this mistake on dozens of boards. Tutorials often neglect to mention you should have a series resistance with the switch. \$\endgroup\$
    – MadHatter
    Commented Jun 3, 2020 at 17:12
4
\$\begingroup\$

Pushing the button causes high dv/dt so the edge is extremely fast and depends on the scope ground lead connection how it will see the fast edge due to inductance in the probing setup. If the switch bounces, it also causes high di/dt spikes, and even if it does not, impulse from shorting the cap is like a small loop of coil that can induce magnetic field to the scope probe, and can also cause ringing due to any stray inductance and capacitance. The high di/dt can cause significant voltage in stray inductance which could cause stress for the IO pin structure, so even Atmel appnote suggests a 330 ohm series resistor to limit the discharge current (related to the reset pin, as it has no clamp diode to VCC).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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