Advertisements

Archive for August 29th, 2016

Switch Contact Bounce

An Arduino hairball for an upcoming Digital Machinist column:

Arduino UNO clone - test setup

Arduino UNO clone – test setup

A short program monitors the switch. When it closes, the program reads the analog voltage from the pot and blinks the LED (on Pin 13, so you don’t need an external LED) for that number of milliseconds.

Some diligent rummaging produced a spectacularly bouncy switch (lower trace) with the output pulse (upper trace):

Contact Bounce - Matsuhita - NO 1

Contact Bounce – Matsuhita – NO 1

A longer timebase shows it’s rattling around for nearly half a millisecond:

Contact Bounce - Matsuhita - NO 2

Contact Bounce – Matsuhita – NO 2

The second pulse in the upper trace shows that the code gets around the loop() fast enough to retrigger on the same button push, which is part of the lesson in the column

A midrange timebase:

Contact Bounce - Matsuhita - NO 3

Contact Bounce – Matsuhita – NO 3

You could surely get a few random numbers out of that noise, although the first few bounces seem surprisingly consistent.

Advertisements

4 Comments