Page 1 of 1

Interrupts triggered multiple times when pins are touched

Posted: Wed Mar 13, 2019 11:42 pm
by karlo.verde.13
Hello everyone,

I'm testing the gpio_example_main.c example, which indicates that some output pins must be connected to some input pins.

I've tested this example a long time ago without issues, but this time I'm having troubles when I do not connect the input pins. Every time I touch one of these input pins, their respective interrupts get triggered. This unexpected behaviour gets even worse when I connect a wire to the pins, whose interrupts get triggered when I approach my hand to the wire, just as they had some kind of capacitive nature.

First I thought it might be a matter of pull resistors so I used external ones without luck.

Is there something I'm missing here? Do you have any comment or suggestion?

Thanks a lot
Best regards
Verde :mrgreen:

Re: Interrupts triggered multiple times when pins are touched

Posted: Thu Mar 14, 2019 8:38 am
by ESP_Sprite
The first bit is expected, as the pins indeed have a high impedance and will pick up random electromagnetic waves and trigger an interrupt that way. External pullups should, however, fix that issue... what resistors did you use and how, exactly, did you connect them?

Re: Interrupts triggered multiple times when pins are touched

Posted: Fri Mar 15, 2019 9:37 pm
by karlo.verde.13
Hey there! Thanks for the reply!

I've been testing with internal and external(1K and 10K) pull resistors.

what resistors did you use and how, exactly, did you connect them?
In the case of external pull resistors, I used 1K and 10K resistors for testing.
To be precise, I connected one resistor to each input pin of the example and VCC(3V3 of the dev board) or GND - pull-up and pull-down respectively.


I want to emphasize that the unexpected interrupt triggering only happens when the input signal is left disconnected. In other words, when you connect the pins just as the example indicates, there is no problem at all.

_________________________________________________________________________________
UPDATE
My finding about the correct operation of interrupts when using pull-ups was actually wrong. I tested the ESP32 in different places and its performance is not reliable when the input pins are connected to a free wire, which indicates that is indeed a capacitive behaviour.

Thanks a lot
Best regards
Verde :mrgreen:

Re: Interrupts triggered multiple times when pins are touched

Posted: Sat Mar 16, 2019 12:39 am
by tommeyers
Do you have a bounce problem? Have you looked at it on a scope? Are you debouncing?

Re: Interrupts triggered multiple times when pins are touched

Posted: Sat Mar 16, 2019 1:07 am
by karlo.verde.13
tommeyers wrote:
Sat Mar 16, 2019 12:39 am
Do you have a bounce problem? Have you looked at it on a scope? Are you debouncing?
Actually, that's something I haven't tried yet because I considered this issue a matter of pull resistors to ensure a known state of the input signal. Plus, considering the use of these resistors, in my experience, this "capacitive" behaviour is shown when the resistance value is quite high. However, if I am wrong, I would appreciate if someone could point out how debouncing is generating this erratic response.

Thanks a lot
Best regards
Verde :mrgreen:

Re: Interrupts triggered multiple times when pins are touched

Posted: Sun Mar 17, 2019 12:40 am
by tommeyers
Pulling it up will make it clearly High as compared to "Floating high" .

But, if you have a switch on that pin (andit is pulled high) twhen closed will make it low (pin to switch to ground) when you make that switch the signal will bounce and finally settle at low. You need to debounce in software; you can debounce in h/w too.