Interference on the button at ESP32

This is the first time I've noticed anything like this. Maybe it's because I just watched Serial Monitor. But I've never had it in the SD card log either.

I'm taking on another useless project. And that's a wireless copy&paste&selectAll keyboard. The keyboard simulates pressing ctrl + c/v/a. Everything works as it should. My button are in INPUT_PULL mode, in the future I plan to replace the buttons with mechanical mx cherry keys. Simple circuit with even simpler code. Below I attach the wiring diagram, unfortunately it doesn't have esp32 in fritzing, but that shouldn't matter.

However, I sometimes get the button sort of pressing itself. I have a prusa 3d printer at home, otherwise standard equipment. Like the fridge, TV, washing machine. No microwave. But this interference, it comes even when everything is off, except the fridge, of course.

Is
D5 = GPIO_NUM_5
D6 = GPIO_NUM_6
D7 = GPIO_NUM_7
?

Looking at the wiring diagram, I suggest using a strong pullup resistor (say 1K to 3.3K) from each digital input to VCC on your ESP32. This should resolve the interference problem. Using INPUT_PULLUP is no longer needed (the internal pullups can be disabled).

Contact bouncing could be an issue, but that's easily solved in your code.

1 Like

I've got Debounce treated, I've got 200 ms on it. Plus checking the status of the change button. I'll try the resistors, I haven't used them in a while as most of what I've done has worked great with just internal resistors.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.