Hi, I’m currently using esp32 as BLE to detect if I’m home or away. I would like to add the temperature sensor and also detecting the door bell button pressed.
For adding the temperature sensor, there is plenty example and I found no issue to follow them.
But to detect the door bell button pressed, I don’t know how should I connect the wires. I’m not using any door bell now but I do have the door bell switch at attached outside of my house and there are two wires routed to inside.
How can I use the two wires and connect to my esp32 board to detect the button being pressed?
Yesterday I have tried to connect the 2 wires from the door bell switch to GPIO15 pin and the GND pin on the esp32. And then updated the configuration, and initially all good.
The reported state is correct initially when I pressed the door bell switch. But after a while, I’m getting alot of the false trigger.
The esp32 board is very close to the power outlet, wasn’t sure if there is any EMI coming from power outlet causing the false trigger.
Add a 0.1uF ceramic or multi-layer-ceramic (MLC) capacitor (any voltage rating) between the GPIO and GND on the ESP board and see if that improves things. Try and keep the capacitor leads as short as possible.
So you are suspecting there is leakage between GND and GPIO pins and adding a DC blocker cap to block the leakage?
I’ll try your suggestion once I have acquired the cap. Meanwhile I will try to use another GPIO15 or another GND pin and see it’s improve the situation.
No, I suspect there is mains hum on your switch cabling. The capacitor is connected in parallel with the push button, not in series, it’s not blocking anything. It shunts the hum to ground.