Smart Door Lock System using esp32-cam and Telegram chatbot
Home automation gives you access to control devices in your home from a mobile device anywhere in the world. One of the biggest advantages of home automation is that it keeps your abode safe, and prevents accidental fires, water leaks, gas leaks, and other disasters. This project shows how we can use Telegram in our IoT and Home Automation projects. Home Security System using ESP32 CAM which will notify us on Telegram App about person entering the house by capturing and sending his/her photo to us and Door can be controlled by chatbot. With this project we can take multiple photos, unlock and lock the door with the Telegram app.
Version 1: Code
When anyone presses the doorbell, home owner will get a notification in the telegram app with a photo of that person. After that, we can easily unlock and lock the door from the telegram app.
Version 2: Code
Some images of authorized people are registered in the esp32-cam with SD card .
when someone is at the door , if the person is recognizable by the esp32cam as an authorized user then Door unlocks , else capture and send an image of the person to the home owner and let him / her take the decision.
In simple diagram :
Demo :
Changes to be made to reuse the code :
Importing Libraries
Start by importing the required libraries.
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClientSecure.h>
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#include "esp_camera.h"
#include <UniversalTelegramBot.h>
#include <ArduinoJson.h>
Network Credentials
Insert your network credentials in the following variables.
const char* ssid = "REPLACE_WITH_YOUR_SSID";
const char* password = "REPLACE_WITH_YOUR_PASSWORD";
Telegram User ID
Insert your chat ID. The one you’ve got from the IDBot.
String CHAT_ID = "XXXXXXXXXX";
Telegram Bot Token
Insert your Telegram Bot token you’ve got from Botfather on the BOTtoken variable.
String BOTtoken = "XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
Full code in the github repository : https://github.com/guhankesav/IOT-esp32-cam
Ten articles before and after
How to create a telegram bot in GOLANG – Telegram 中文版
Telegram iOS Translate Feature — How the hell did they do it? – Telegram 中文版
YGG SEA Sticker Contest. We have an exciting competition for… – Telegram 中文版
Digital Privacy: A Myth or Reality..? – Telegram 中文版
Как закрепить сообщение в Телеграм. Что нужно сделать? – Telegram 中文版
Minipod do Telegram – Telegram 中文版
An overview of Telegram monetization efforts – Telegram 中文版
Translate text through Google Translate using Python – Telegram 中文版
10 телеграм каналов для дизайнера – Telegram 中文版
We Need to Change How We Talk About Technology – Telegram 中文版