Though several smart video door locks are available in the market, they are not open source and are very expensive. I love open source and hope you do too and as a maker, I always like to make my own stuff. After doing a few days of research I made this Smart Lock + Video Doorbell and made it open source. Following this project, you will be able to make an intelligent video door lock/doorbell on your own and can modify it according to your choice. You can do it at a very low cost. The only expensive parts here are Raspberry Pi and Camera module and will not exceed 60 USD in total.
This can be operated by Alexa and an Open source Alexa Skill was developed for this project. My skill is live at Amazon Store (Skill ID: amzn1.ask.skill.4ba64998-cb8f-461d-8712-16c5dfcfc9d3)
By following this guide you can make your own skill also.
Before going into detailed instructions let me first explain how it works. I am calling this device Intelligent Door Lock and for making the device I used a Raspberry Pi with an official camera module and an Arduino with a servomotor for controlling the lock. Using Arduino is optional and you can use Raspberry Pi GPIO for controlling the servo motor. For this demo project, I used a 3D printed servo-controlled lock but for practical use, you can replace it with an electrical solenoid lock.
When a guest comes to your door and press the calling button, Raspberry Pi performs three tasks:
- It takes a picture of the guest and uploads it to AWS S3 Bucket and S3 Bucket triggers an SNS notification to a specific topic.
- It sends an email with the photo to the house owner.
- It sends a greeting text to AWS Polly and then plays the audio greeting for the guest by name returned by Polly.
After getting the notification from AWS SNS or the email house owner can ask Alexa to introduce the guest by invoking the custom skill "Door Guard" and saying:
Alexa, ask the door guard who is at the front door? or
Alexa, ask the door guard who came?
Alexa triggers a Lambda function and the Lambda function does the following jobs:
- Read the image uploaded to the S3 Bucket.
- Sends a face search request for the image to AWS Rekognition.
- After getting the face matches, the result is returned by Rekognition, Lambda search for the name to AWS DynamoDB and returns the name to the Alexa if found.
Alexa provides the name to the house owner and the house owner again calls Alexa to open the door for the guest. In this case, Lambda sends an open door command to AWS IoT to a specific topic. Raspberry Pi receives this command and sends it to Arduino using the serial port. Arduino controls the lock accordingly. The following block diagram can help for better understanding.
- Preparing Raspberry Pi (installing required libraries)
- Writing program for Raspberry Pi (for capturing an image on button press, uploading the image to S3, sending email to the owner, receiving a message from MQTT broker, greeting guest, sending a control signal to Raspberry Pi)
- Setting AWS Services (AWS S3 Bucket, AWS DynamoDB, AWS Lambda, AWS SNS, AWS Rekognition)
- Writing program for uploading Images of knows persons and storing Face Index in the DinamoDB table.
- Making Custom Alexa Skill and writing code for Lambda function.
- Writing code for Arduino.
- Connecting all the hardware.
- Testing & Debugging.
Short Demo Video