I have a button connected to the ESP8266 and have an interrupt callback set for when the button is pressed. The issue is, the callback triggers occasionally even when the button is not pressed. It is very inconsistent... it could be a few times a day, or several times in a 15 minute span. I'm trying to figure out how to stop these unwanted triggers, which are ruining my data

To be absolutely clear, this isn't a bounce issue after clicking the button. This happens randomly on its own.
(I do have a little bit of button bounce, which I solve in the code with a simple delay)
I'm using MicroPython:
Code: Select all
button = Pin(5, Pin.IN, Pin.PULL_UP)
def on_button_rising(pin):
...
button.irq(trigger=Pin.IRQ_RISING, handler=on_button_rising)
I've tried adding a resistor between the button and ground.
I've tried adding a capacitor, connecting to GPIO5 and ground, but that didn't help, and it somehow made the button bounce much worse.
I've tried swapping the usb power adapter.
Any ideas?
