Output pin triggering randomly

Hi all,

I’m using an ESP32cam AI-Thinker board for a project, with one pin connected to a terminal on a pushbutton switch. I can send commands via HA to this, and it performs the button push action.

However the button is also triggering at random every few hours. I’ve tried this with GPIO pins 2 and 13. Is there a better pin for this? Pins 14 and 15 are spoken for, but the others are available.

Or do I need to add in a small pulldown resistor? If that’s the case, what kind of resistor would be suitable? I’m a novice at this.

It sound like you need a pulldown or pull-up, but not completely sure I understand what you have done.

There’s a pushbutton switch on PCB1. It sits in a low state by default, and when it goes high and back to low, it activates the button’s function. I’ve soldered a wire to one of the terminals, and connected this to a GPIO pin on the ESP32 (with another wire going to a ground terminal on that same PCB1).

The ESP32 is running ESPHome, integrated into HA.

Specifically, this is activating an electric cat feeder. The glitch is the feeder occasionally spitting out food without me sending a command for it. The cats consider this a feature, but I view it as a bug.