The advent of the ESP8266 microcontrollers opened up a more interesting approach. These are programmable microcontrollers with a built in wifi interface. They are tiny and also only cost about a pound each. So my plan was: build a new doorbell push from scratch, which talks to the wifi network. The old doorbell has an electromechanical sounder, which I'm reusing by replacing the driver circuit.
|ESP-01 on stripboard
The theory of operation is as follows: the ESP-01 module will be put in deep sleep mode when idle. The button is wired between the ESP's reset pin and ground, so when someone pushes the button to ring the bell, it pulls reset low and wakes the device from deep sleep. The ESP-01 has an on board power LED which is always on and would drain the batteries quite quickly, so I've cut the track supplying power to that LED - the module now draws 20µA when in deep sleep mode, so I expect the batteries to last a while. When the ESP resets, it immediately associates with the wifi network and makes two HTTP requests - one directly to the sounder (more on this later) and the other to my home server. A php script on the server sends out "doorbell rang" instant messages to both myself and Mel via XMPP - this solves the problem of hearing the bell in the office, since the XMPP notification pops up on my workstation and phone.
|Everything just fits!
The web requests that the button makes include the current battery voltage, so I can figure out when to change the batteries. Its now been in use for about 15 weeks and the reported battery voltage has fallen from about 3.182v to 3.053v, which I think is pretty reasonable.
|The finished doorbell push
|On the door frame
SounderAs mentioned, I'm re-purposing the old electromechanical sounder by replacing the old circuit board and driving the solenoid directly. The old sounder was powered by 3 C cells. Unlike the button, the sounder will need to remain connected to the wifi all the time, so batteries aren't really an option. I've opted to using a USB power supply, and with no need for the batteries there's now a lot of space inside the sounder for my new circuit.
I'm using an ESP-12F in the sounder - it's a bit overkill really, but I wanted to have an output that didn't have to be pulled up on boot. The mini-USB port is connected to an LM1117T-3.3 linear regulator to provide the 3.3v supply voltage. The solenoid is driven by an RFD14N05L field effect transistor and I've included a fairly chunky capacitor to help with the high power requirements of the solenoid. Of course there's also a reverse biassed diode in parallel with the solenoid to absorb the back-EMF (although no magic smoke was released before I bothered adding it).
The whole thing is soldered up onto stripboard and just pushed into the battery compartment of the sounder (having removed the battery contacts).
The sounder connects to the wifi network as soon as it is powered up and sits there waiting for an HTTP request. Making a request to "/" returns a status page, requesting "/ring" causes it to fire the striker and make the classic "ding-dong".
|The old electromechanical sounder with an ESP-12F installed
Problems to be aware ofReceiving a notification on your phone to say the doorbell is being rung when you're a few hundred miles away is infuriating because you know you're going to have to drive up to the postal depot to collect a parcel when you get home. :)
Source codeSource code for the project is available in Subversion: