Page 1 of 1

Issue with double switch on ESP32-S2

Posted: Wed Mar 23, 2022 9:58 am
by FunkyFab
Hi all,

I'm working on creating a foot switch for a tablet for turning the pages. I have one pedal for going backward, and one pedal for going forward.
My project is based on a ESP32-S2. I have plugged one pedal between pin 5 (ground) and pin 33, and the other between pin 5 (ground) and pin 35.
I'm working with interrupts to capture when a pedal is pressed, and set the pinMode so that the pull-up resistor is enabled.
Most of the time (7/10), when I press a switch, the ISR is called once for each pedal, hence I don't know which pedal has actually been pressed.
I've un-solder and re-solder the pedals several times.
Do you have an idea of the potential sources of the problem?
Thanks !

Re: Issue with double switch on ESP32-S2

Posted: Wed Mar 23, 2022 2:29 pm
by FunkyFab
I've updated my program without interrupts... and it works now perfectly fine...

Re: Issue with double switch on ESP32-S2

Posted: Wed Mar 23, 2022 9:43 pm
by tommeyers
Oh yes.

Bounce.

The signal is bouncing as it opens and closes.

If you have a scope take a look.

Solution:. Denounce sw logic or denounce in hardware. I usually denounce in s/w.

Tom

Re: Issue with double switch on ESP32-S2

Posted: Wed Mar 23, 2022 9:46 pm
by tommeyers