DIY Add WiFi to Normal Doorbell for Less Than 5$

by Ganesh Selvaraj in Circuits > Gadgets

1293 Views, 11 Favorites, 0 Comments

DIY Add WiFi to Normal Doorbell for Less Than 5$

DIY: Make your Doorbell smart for less than 5$ (350 INR) | ESP8266 based WiFi doorbell | IFTTT
RF doorbell.png
vlcsnap-2021-08-26-11h21m46s163.png
1.3 Costly ALternatives.png
1.4 Things Required.png
1.5 Tools Required.png
1.6 Softwares.png

In this project, I am going to show you how to turn this boring RF based wireless doorbell into a WiFi enabled doorbell for less than 5$

Once we do that, you will be able to receive calls/notifications on your phone when someone presses your doorbell.

Well a lot of you may be using this kind of RF doorbell. The problem with these is that you need to be close to the receiver to actually hear the bell. In case your house is slightly bigger or too noisy, you definitely wouldn’t hear it.

There are smart doorbells out there but are too expensive and have cameras which not everyone requires.

So I have added WiFi capabilities to this doorbell using a cheap controller.
Once we do that, the possibilities are endless, but for starters, I’ll show you how to get a notification or a call on your mobile when there is a bell press. And guess what, doing this costs you less than 5$ as compared to the commercial smart doorbells which costs around 100$

Supplies

These are the things you would require:

1 x RF doorbell

1 x ESP8266-01 module

1 x 10Kohm resistor A small general purpose PCB (Optional)

Few wires

All the above components will go inside the bell.

The following are the tools required:

Soldering Iron kit

USB programmer for ESP8266

Multimeter

We’ll be using Arduino IDE for programming the ESP board and IFTTT’s Webhooks to trigger the notification.

Looking Inside a Wireless Doorbell (Reverse Engineering Maybe)

hack (3).jpg
hack (4).jpg
hack (5).jpg
ic (2).png
music.png
New Project (20).png
ic (1).png

First, let’s see what’s inside these RF doorbells. The transmitter uses a tiny 12 Volt battery. It has a small tactile switch underneath. I am guessing though it requires higher voltage, the transmitter is powered up only when the button is pressed and at rest it consumes no current at all. Just like our IR remotes.

The receiver on the other end, uses standard AA batteries.

We will be placing our custom device into the receiver since It will be placed inside the house, so probably closer to the WIFI router It uses 2xAA batteries and hence gives us slightly above 3 volts which is perfect for our ESP module. Additional voltage regulator circuits can be skipped. It has enough space….. well, compared to the transmitter at least.

This PCB has the RF receiver and a music/tone generating IC within it. There is one button to choose between various tones and two wires emerge out for the speaker/LED.

We will tap into one of the speaker/LED wires to detect a signal whenever the doorbell is pressed. This will be the input for our ESP board.

Workflow

wifiDBseq (6).png

- When someone pressed the doorbell, the transmitter sends a signal to the receiver

- The receiver unit, once the signal gets to it, will power up the music generating IC and hence starts lighting up the LED and speaker.

- Our ESP board which by default is in deep-sleep mode, wakes up when there is a power sent to the speaker.

- Once awake, the ESP connects to WiFi, pings the webhooks server and goes back into deep-sleep mode immediately.

- The webhooks in turn runs an applet created in IFTTT which takes the predefined action.

Now, deep-sleep function is very important since we don’t want to be consuming much battery juice in idle state. Just like how the generic RF doorbell initially worked.

Configuring IFTTT

vlcsnap-2021-08-21-16h03m42s986.png
vlcsnap-2021-08-21-16h05m15s181.png

Let’s start with configuring the Webhooks in IFTTT. To do this, you need to download the IFTTT app from playstore/appstore and signup (it’s free)

- Go to https://ifttt.com/ on your PC and create an applet. Add Webhooks as trigger, keeping the event name as “dbPressed” or “RFdoorBell” or anything you like and remember this. Then add notification as response and type in whatever you want to be shown on screen.

- Now go to https://ifttt.com/maker_webhooks and click on documentation. It will take you to a page where your personal key is shown. Note this down and also if you want you can test your applet you just made by entering the event name and clicking on the “Test” button.

Configuring Arduino and Uploading Code Part 1

vlcsnap-2021-08-21-16h06m45s201.png
vlcsnap-2021-08-21-16h13m21s641.png
vlcsnap-2021-08-21-16h14m18s619.png
Capture2.PNG

- Next, let's go to setup the Arduino IDE.

In order to program the ESP, First, go to File->Preferences->Additional Boards Manager URLs and add the below URL: http://arduino.esp8266.com/stable/package_esp8266...

- In case you already have another board URL added, add this after a comma. Then go to Tools->Boards->Board Manager, search for ‘ESP8266’ and download the boards.

- Once you are done with these steps, restart the Arduino IDE and you should see the ESP boards in the board manager.

- Next, go to Sketch->Include library-> Manage libraries add this library

ESP8266 Webhooks by Rupak Poddar

- And the WiFi manager library from the description below. This was originally written by Tzapu from github. I have made slight modifications and hence given the link in the description. Download the zip file and extract it to the libraries folder of your arduino IDE (You will find the folder usually where your sketches are stored).
Download Link: https://drive.google.com/uc?id=1C6Fz1UVsDEhQ9khYN...

My Code: https://github.com/robotsreloaded/ESP8266-doorbel...

Once all this is done, open the code I have written, add the Key and Event name from your IFTTT applet and compile it to see if the libraries have been installed correctly. You can change the timeout value according to your need.

Configuring Arduino and Uploading Code Part 2

vlcsnap-2021-08-21-16h23m41s840.png
vlcsnap-2021-08-21-16h28m16s753.png
vlcsnap-2021-08-21-16h29m49s280.png

- If compilation was successful, then let’s upload the program to ESP and test. To do that you need a programmer which can put ESP into programming mode. In case you have a normal serial interface like mine, add a button between ground and GPIO0 pin.

- While plugging in the programmer with ESP on it, press and hold the button. Once it powers up, you can release the button. Basically when GPIO0 is grounded on power up, the ESP goes into programming mode.

Now select the right port and “Generic ESP8266” as the board and click upload.

- Once the upload is successful, unplug the ESP from the programmer, open the Serial port and plug it again. This will start the board in boot mode and the code will start running. You will be able to see what it is doing, through the serial monitor.

Connecting ESP Board to WiFi for the First Time (Or Whenever You Want to Change WiFi Creds)

vlcsnap-2021-08-21-16h35m46s465.png
vlcsnap-2021-08-21-16h37m48s182.png

- For the first time it runs (Or in case the saved WiFi credentials don’t work), it will create an Access Point named “EspDoorBell” and “password” and password. Connect your phone to it and then it will open up a sign up page (Or go to 192.168.4.1) and you will see this page.

- This page will timeout in 180 sec and the board will go into deep-sleep mode. This is done in order to avoid the ESP being active indefinitely in case it is unable to connect the saved WiFi network. Click on configure to scan for available networks and then enter your home WiFi’s credentials and click save.

- Now you should see a success message on the serial port. Then unplug and replug the ESP. Now you should see that within a few seconds, the notification we configured will appear on your IFTTT app.

Note: The WiFi Manager library and code has been added so that once we upload the code, we can change the WiFi credentials without having to re-upload the code.

Circuit Explanation

5.9.1 circuit.png

The circuit is very simple, All you have to connect is +ve and -ve supply directly since the 2xAA batteries voltage range is within the operational range of our ESP board. And then one signal pin from the speaker pin of the doorbell to the Reset pin of ESP. The REST pin is also connected to the +ve terminal through a 10K ohm resistor in order to keep it high by default. When a low pulse is sent to this pin, the board resets and wakes up to execute the code inside. This low pulse is completed when the speaker finishes playing the tone.

This is how basically we are detecting and waking up our ESP everytime someone presses the bell.

Soldering

vlcsnap-2021-08-21-16h51m08s043.png
vlcsnap-2021-08-21-16h52m46s098.png
vlcsnap-2021-08-21-16h53m40s288.png
vlcsnap-2021-08-21-16h53m53s346.png
vlcsnap-2021-08-21-16h58m12s114.png
vlcsnap-2021-08-21-17h01m09s737.png

- I have chosen to solder all components to the PCB to make it more neat, But you can solder directly if you want to. I have cut a small PCB and made some filing to exactly fit inside the empty portion of the bell.

- First, solder the ESP board onto the PCB and cut off the excess length of leads to decrease the height of our circuit.

-Add the resistor just above the ESP board. Next, short the VCC and CH_PD pins of ESP since they both need to be high for the ESP to function.

- Attach one end of resistor to RESET pin and other to VCC

- and then add wires on the top side, to connect to VCC, GND and speaker output

At each point, make sure you test for any shorts or wrong connections using the multimeter. Well if your soldering skills are as shabby as mine, you definitely should.

Testing and Power Consumption Details

vlcsnap-2021-08-21-17h02m26s124.png
11. power details.png
vlcsnap-2021-08-26-11h21m46s163.png

Once you are sure every connection is perfect, attach the circuit to the receiver. Make sure you remove the batteries before doing this in order to avoid any short-circuit.

Now check if it works by pressing the bell button. You should see that the moment the bell tone finishes, the blue LED flashes on the ESP indicating it has just been reset. Within a few seconds, you should see the notification on your IFTTT app. The delay may be anywhere from 5 seconds to 20 seconds depending on the network.
If the notification appears, then congratulations on making a cheap smart doorbell at home ;)

Above are the power consumption details of the doorbell with and without ESP. I suggest you remove the power LED (Red) one from ESP since it's always on and consuming power for no useful reason.

Next Versions

Now the possibilities are endless once you connect it to IFTTT. I have even managed to make a bot call me in Telegram in case someone presses the bell button. (This takes more time than the notification. Sometimes about 30-40 seconds)

We can also turn on our smart light in the entrance as soon as someone presses the bell.

Features to be added:

If I build an upgraded version of this smart bell, I would add the following features:

- Custom button to turn on configuration mode on-demand when we need to change WiFi credentials.

- LED indicator conveying whether the connection to webhooks was successful or failed.

- Low battery notification.