Issue with double switch on ESP32-S2

FunkyFab
Posts: 3
Joined: Wed Mar 23, 2022 9:48 am

Issue with double switch on ESP32-S2

Postby FunkyFab » Wed Mar 23, 2022 9:58 am

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 !

FunkyFab
Posts: 3
Joined: Wed Mar 23, 2022 9:48 am

Re: Issue with double switch on ESP32-S2

Postby FunkyFab » Wed Mar 23, 2022 2:29 pm

I've updated my program without interrupts... and it works now perfectly fine...

tommeyers
Posts: 184
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

Re: Issue with double switch on ESP32-S2

Postby tommeyers » Wed Mar 23, 2022 9:43 pm

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
IT Professional, Maker
Santiago, Dominican Republic

tommeyers
Posts: 184
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

Re: Issue with double switch on ESP32-S2

Postby tommeyers » Wed Mar 23, 2022 9:46 pm

IT Professional, Maker
Santiago, Dominican Republic

Who is online

Users browsing this forum: No registered users and 135 guests