Close
0%
0%

Telegram Fingerprint Lock and Surveillance Camera

Via Telegram, get apprised of every attempt to lock or unlock the door w/ surveillance footage by 5MP night vision camera or USB webcam.

Similar projects worth following
For a long time, I had been contemplating installing a security system for my balcony garden door with ample features to grant permission to lock or unlock the door to anyone but me. Thus, I decided to create this project that suffices my balcony garden seclusion with a fingerprint sensor and lets me check its status by sending me surveillance footage by a night vision camera or a USB webcam.

Since Telegram is a cross-platform cloud-based messaging service compatible with iOS and Android, I decided to create a Telegram bot to manage my security system on disparate devices easily. In Telegram, it is effortless to create bots with a command list unalike any other messaging application, which are special accounts that do not require an additional phone number to set up. IoT Surveillance System, the Telegram bot I created for this project, allows me to change the camera type option, request surveillance footage, and display the entry log with these commands:

  • enable_night_vision
  • disable_night_vision
  • status_check
  • last_access
  • entry_log

To fetch and transfer data via the Telegram bot, I developed a PHP web application (outgoing) that gets updated from the Telegram Bot API, sends surveillance footage to the bot, and saves information to the database.

When the fingerprint sensor detects a fingerprint (enrolled or unmatched), I programmed my Raspberry Pi to capture an image and record a video with the selected camera type (night vision camera or USB webcam) to send them to the bot as surveillance footage via the web application. Also, it sends surveillance footage when directly requested by the bot:

  • access
  • failed
  • requested

Finally, I added an electromagnetic lock to lock or unlock the door if the fingerprint sensor detects an enrolled fingerprint.

Huge thanks to DFRobot for sponsoring this project.

Sponsored products by DFRobot:

⭐ DFRobot Fingerprint Sensor | Inspect

⭐ 5MP Night Vision Camera for Raspberry Pi | Inspect

Step 1: Building a bot for Telegram with BotFather

BotFather is a Telegram bot that lets us create and manage bots on Telegram without any coding required.

⭐ First of all, open BotFather on Telegram and enter /start to view the available command list and manuals.

⭐ Use the /newbot command to create a new bot. Enter the name of your bot when BotFather asks you for a name. It is displayed in contact details and elsewhere.

IoT Surveillance System

⭐ Then, enter the username of your bot. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. They must end in 'bot', e.g. 'tetris_bot' or 'TetrisBot'.

surveillance_system_bot

⭐ After these steps, BotFather generates an authorization token for your new bot. The authorization token is a string along the lines of 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 that is required to authorize the bot and send requests to the Telegram Bot API. Keep your token secure and store it safely.

⭐ Also, you can change your bot's profile picture by using the /setuserpic command.

⭐ Finally, enter the /setcommands command to create the list of commands supported by the bot. Users will see these commands as suggestions when they type / in the chat with the bot.

⭐ The command list I created for my Telegram bot (IoT Surveillance System):

  • /enable_night_vision - activate the 5MP Night Vision Camera
  • /disable_night_vision - activate the USB Webcam (default)
  • /status_check - run the surveillance system without triggered by the fingerprint sensor
  • /last_access - display the preceding entry to the fingerprint sensor
  • /entry_log - list all attempts to open the fingerprint smart lock
  • /help - functions and instructions

Step 2: Developing a web application in PHP to communicate with the bot via the Telegram Bot API

I developed this web application in PHP, named telegram_surveillance_bot, in order to:

  • get updates from my Telegram bot (IoT Surveillance System) via the Telegram Bot API,
  • fetch captured surveillance footage (image and video) transferred by Raspberry Pi,
  • send messages and surveillance footage to my Telegram bot,
  • save information to the database to send commands from the bot to Raspberry Pi.

⭐ First...

Read more »

  • 1 × Raspberry Pi 3B+ or 4
  • 1 × DFRobot Fingerprint Sensor
  • 1 × USB-to-Serial Converter (CP2102)
  • 1 × DFRobot 5MP Night Vision Camera for Raspberry Pi
  • 1 × USB Webcam

View all 8 components

  • 1
    Schematic-1
  • 2
    Schematic-2

View all instructions

Enjoy this project?

Share

Discussions

kutluhan_aktar wrote 04/15/2021 at 21:23 point

Please feel free to leave a comment here if you have any questions or concerns regarding this project 😃

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates