Nowadays, Security system is one of the most researched fields and with increasing security threats, companies are launching new smart security products to combat these threats. IoT is an added advantage in this field which can automatically trigger an event, like calling the police, fire brigade or your neighbor, in case of any emergency. We previously built many security systems like Raspberry Pi Visitor monitoring system, video surveillance camera, wireless doorbell, IoT based Door Security Alarm etc. Today we will use ESP32 and camera to build a Smart Wi-Fi door bell.
In another tutorial, we have learned about ESP32-CAM and how to use it for video streaming, now we will make a Smart Wi-Fi Video Doorbell using ESP32-CAM. This Smart doorbell can easily be powered by an AC socket and whenever someone at the door presses the doorbell button, it will play a specific song on your phone and sends a text message with a link of video streaming page where you can see the person at the door from anywhere in world.
- FTDI Programming Board
- 220V AC to 5V DC Converter
- Push Button
- LED (2)
Circuit diagram for this Smart Wi-Fi Doorbell is very simple, just connect two LEDs, a push button and a buzzer to ESP32 GPIO pins. A buzzer is used to make a sound whenever the button is pressed. One LED is used to indicate the power status, and the other LED is used to indicate the network status. Network LED will be in a high state if ESP is connected to a network otherwise, it will blink.
IFTTT Setup for Wi-Fi Doorbell
IFTTT is a free web-based service that allows users to create chains of simple conditional statements, called “recipes”, which are triggered based on changes to other web services such as Gmail, Facebook, Instagram, and Pinterest. IFTTT is an abbreviation of “If This Then That”.
In this project, IFTTT is used to send an Email whenever the temperature or humidity goes beyond a predefined limit. We previously used IFTTT in many IoT based projects to send emails or SMS on particular events like on excessive electricity consumption, on high pulse rate, on intruder entry, etc.
First login to IFTTT with your credentials or Sign Up if you don’t have an account on it.
Now search for ‘Webhooks’ and click on the Webhooks in Services section.
Now, in the Webhooks window, click on ‘Documentation’ in the upper right corner to get the private key.
Copy this key. It will be used in the program.
After getting the private key, now we will create an applet using Webhooks and Email services. To create an applet click on your profile and then click on ‘Create.’
Now choose ‘Receive a Web Request’ trigger and in the next window, enter the event name as button_pressed and then click on create a trigger.
Now to complete the applet, click on ‘That’ to create a reaction for the button_pressed event.
Here we will play a specific song on the phone when the IoT doorbell button is pressed. For that search for ‘Android device’ in the search section.
Now enter the song title that you want to play when the doorbell button is pressed. In my case, I’m playing a song named ‘123’ from my Google play music. You can also use Spotify or other music apps.
After that, click on ‘Create action’ and then ‘Finish’ to complete the process.
Now create another applet to send a message with the webpage link to the phone when the doorbell button is pressed.
So to create this applet choose ‘Webhooks’ in ‘this’ section and in ‘that’ section choose ‘Android SMS.’
Now it will ask to enter the phone number and message body. For this Wi-Fi doorbell project, we are sending a message with the Webserver link so that you can see the live video streaming directly.