Wemos D1 mini automated doorbell interference from 240v mains power

Hi all,

I have set up a wemos D1 mini to send notifications to my phone when the doorbell is pressed. I followed the following guide:

All was working fine until the notifications get sent when I turn on my downstairs lights.

The bell cable is running near other mains cables. Can I adapt the circuit to only trigger from the bell, like a filter?

Sorry I am new, any help is appreciated.


If the wires are long, then use 1k resistors instead of 10k resistors.
If the problem persists, then add 100n capacitors across the 1k resistors.