sodnpoo.com

simple ac doorbell to gpio interface

I keep missing packages being delivered - I've usually got headphones on when I'm coding. I listen to music from my phone, so if I can generate a real-time alert when someone is at the door, that should solve the problem.

The door bell is just an electromagnet and an 10 volt, AC power supply; when the button is pressed it completes the circuit and the electromagnet pushes a small bar of metal to strike the chimes. I didn't want to modify the doorbell or make it dependent on other electronics so I've patched a simple circuit on to the electromagnet; an integrated rectifier and PNP transistor. The transistor pushes a line to ground when the AC voltage (the two white crocodile clips; tapped from the electromagnet) is applied to rectifier. (This is probably less than optimal, but it works from parts I had to hand.)

The line is patched onto the reset button of an old Netgear DG834v4 running OpenWRT, where hotplugd sees it as a GPIO button and can easily be configured to run any script when the 'button' is clicked.