In my apartment I have an old intercom to know when someone is at the entrance of the building and to unlock the door. I waned to connect it to an esp8266 to let me know remotely if someone ring and to open. The opening part is ok, I used a relay for that. But the tricky part is to be notified when someone ring.The intercom is running with 12v but when someone ring the current is going to 0v.
The intercom as only to cable. I tried to get signal by using this circuit. The idea is to detect current drop :
problem is: when nobody is ringing and 12v is present in the intercom wire, GPIO is going high and low constantly. Is there any reason for that ? Is there something wrong with this circuit ?