Creating a Smart Doorbell and Smart Lock with Raspberry Pi

If you don’t want to miss my updates, remember to check the public account in the upper right corner and mark it as a star, take down the star and give it to me.

Creating a Smart Doorbell and Smart Lock with Raspberry Pi
Creating a Smart Doorbell and Smart Lock with Raspberry Pi

During the COVID-19 pandemic, an engineer created a device to maintain a safe social distance—

Of course, even without COVID, this is a great item to cure “laziness”. When friends visit at home, you don’t need to open the door in person; you can directly control the system to open the door with your phone; it can also become a smart intercom, allowing you to talk to colleagues or family at the office or home.

As a smart doorbell, when a visitor presses the button, the Raspberry Pi-powered smart doorbell opens a virtual meeting room for the visitor. At this time, the system will send a notification to your phone, which includes a link to enter the same meeting room to chat with the guest. When you create two such smart doorbells, they can join the same meeting room, serving as a visual intercom system.

Today, we will share some of the production processes and coding ideas with you, which are definitely worth a try!

Hardware Components

The smart doorbell mainly consists of five parts: Raspberry Pi 3+, button + camera + LCD screen + speaker + microphone. The Raspberry Pi 3 needs no introduction; it is the most popular, but if you don’t have a 3, 3B and 4 can completely replace it. If you are a Raspberry Pi novice, click here to view the recommended learning path.
Next, let’s talk about the other components:
For aesthetic purposes, the on/off button uses a LED button.

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Compared to ordinary buttons, this switch button has four pins, and the wiring method is different from traditional push-button switches:
Creating a Smart Doorbell and Smart Lock with Raspberry Pi
Choose any wiring method according to your design idea, but note that if the purchased LED button does not have a built-in resistor, you need to solder a resistor onto it. This is because the LED typically operates at a voltage between 1.8-2.8V, while the Raspberry Pi operates at 3.3V.
The camera is a Raspberry Pi dedicated camera, which can be directly installed using a soft ribbon cable:
Creating a Smart Doorbell and Smart Lock with Raspberry Pi
The display uses a 3.5-inch LCD screen, and usually, when purchased, it will come with an integrated operating system driver. Even if you don’t know how to configure it, the seller will provide technical support, so you don’t have to worry too much in this regard.

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Regarding the case, many manufacturers in China are making them and they look very nice, which can be directly purchased on Taobao. Of course, you can also DIY your own case; to refer to this project’s case, you can reply in “Darwin Says”: smart doorbell to obtain CAD designs.

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

The microphone used is a mini USB microphone, very convenient and compact, and the configuration difficulty is low.
The speaker needs to connect the output end of the Raspberry Pi’s built-in 3.5mm audio jack to the audio output of the LCD screen. (Please note to choose an LCD screen with audio output function when purchasing, otherwise you need to add an external speaker)

Different Raspberry Pi models may use different audio jacks; here we take the PJ322 audio jack as an example:

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

The outer ring of the socket (large exposed area) is the ground part of pin 1, pins 2 and 3 are the left and right channels of the headphone, and pin 4 is the microphone interface of the headphone. You only need to connect the left and right channels of the audio jack on the Raspberry Pi to the audio output of the LCD screen with wires. Different audio jacks have different wiring methods; if you are unsure, you can use a multimeter to measure it yourself.
Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Software Configuration

After the hardware installation is complete, it’s time for software code configuration:
Enter the raspi-config command in the terminal and navigate to InterfacingOptions-camera
Use the following command in the terminal to save the image locally to test if the camera is working properly:
sudo raspistill -o test.jpg
Open the sound input settings:
alsamixer -c l
Press F4 to open the capture settings and raise the level to 100. Use the following command to test the audio capture function:
arecord --device=hw:1,0 --format S16_LE --rate44100 -c1 test.wav -V mono
Press control-c to stop, and an audio file named test.wav will be generated in the local directory.
Use the following command to play and test if the microphone function is working properly
aplay test.wav
Save settings to make them effective after reboot:
sudo alsactl store
The video call function requires the use of a third-party platform https://jitsi.org/jitsi-meet/.
It is easy to operate, and there are many tutorials online. Here’s a brief introduction to the configuration steps:
1. Add the Jitsi package
echo 'deb https://download.jitsi.org stable/' >> /etc/apt/sources.list.d/jitsi-stable.list
wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -
2. Open the following ports in the firewall
  • 80 TCP

  • 443 TCP

  • 10000 UDP
3. Install Jitsi Meet
# Ensure support is available for apt repositories served via HTTPS
apt-get install apt-transport-https
# Retrieve the latest package versions across all repositories
apt-get update
# Perform jitsi-meet installation
apt-get -y install jitsi-meet
During the installation process, you will be asked to enter the hostname for the Jitsi Meet instance. If you have already set the FQDN of the instance in DNS, enter this instance name. If you do not have a resolvable hostname, you can enter the static IP address of the computer. This hostname (or IP address) will be used for virtual host configuration inside Jitsi Meet, and others will use it to access the online meeting.
4. Test if the installation was successful
After the installation and configuration are complete, you can enter the Raspberry Pi’s instance name or IP address in your computer’s browser to enter the video conference.

Note: The actual configuration process will be more complicated than described above. If you are interested, you can reply in “Darwin Says” on WeChat for the official configuration instructions.

Lock Design and Configuration

With a smart doorbell, shouldn’t we pair it with a smart lock? This way, you can directly control the door remotely. Due to the different door-opening methods in each household, here we only provide inspiration and ideas for the lock setup.

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

The principle of the lock’s production is not difficult; it sends control signals from the Raspberry Pi to the servo, and the servo twists the bolt to lock or unlock. The real challenge is how to match the servo with your home’s bolt (lever lock, push-pull lock, spherical lock).
Using the MG996R servo (cheap and powerful) to twist the spherical lock, to ensure that the servo system fits tightly with the lock, you can create a matching case through 3D printing, allowing it to perfectly twist the lock (which is very unfriendly for those without a 3D printer).

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Adjust the servo’s twisting center so that it is at the center of the case shown in the right image, and then put the case from the left image on the servo, as shown below:
Creating a Smart Doorbell and Smart Lock with Raspberry Pi
To enhance the interactive experience, add a red LED in the case to indicate the lock’s on/off status:

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

This simple smart lock is complete and perfectly matches the smart doorbell! Friends who want to do this project can reply in “Darwin Says” on WeChat: smart doorbell to obtain the overall project code.
Seeing others do projects so well, are you not tempted? Follow the Darwin project practical training: Linux video surveillance system project in progress, Teacher Wei Dongshan’s first lesson is available for viewing immediately:

Add WeChat zm857827273, and join the project group chat

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Darwin’s Exclusive Star Rating

Practicality:★★★★★

Difficulty: ★★★★☆

Innovation: ★★★★☆
END
Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Darwin Project Sharing Series—— Focusing on popular application technologies such as IoT, Embedded Systems, AI, FPGA, etc., open source sharing schematics, code, and project solutions, making you a knowledge base at hand.

Project Sharing Series Highlights:

STM32 IoT Smart Home Project

Raspberry Pi + Compute Stick 2 for Real-time Face Recognition Project

Building a Cloud Computing Platform for Embedded Development Boards

STM32 Achieving the Simplest Air Mouse

Arduino Rubik’s Cube Robot

STM32 Version “AI Soul Painter”

STM32 Electronic Photo Album Production

STM32 + DDS Homemade Signal Generator

Using Raspberry Pi and Web Interface to Remotely Control Appliances

STM32 “Cloud” Music Player

Raspberry Pi Remote Monitoring

Designing a Neon Tube Clock Based on STM32

Homemade FPGA Minimum System Board (PCB can be directly made)

Building NAS with Raspberry Pi 4 for Easy Networking of Hard Drives

ESP32 Car Hardware and Software Practical Sharing

Complete Creative Gesture Recognition with Only 79 Lines of Code

IoT + Electronic Ink Screen Can Create Custom Display Screens

Creating a Pathfinding Robot Worth Over a Thousand with Just Dozens of Yuan

Glasses-free 3D Holographic Display, Visual Persistence POV Project

DIY Gesture Recognition Module

Practical Small Designs You Can DIY with Zero Basics

We are Nimo, the founder of Darwin, a technical girl who only talks about technology and not flirting. The Darwin online education platform aims to serve professionals in the electronics industry, providing skill training videos covering popular topics in various subfields, such as embedded systems, FPGA, artificial intelligence, etc., and tailoring layered learning content for different groups, such as common knowledge points, disassembly assessments, competitions/smart cars/postgraduate entrance examinations, etc. Welcome to follow.

Official website: www.darwinlearns.com

Bilibili: Darwin

QQ group:Group 1: 786258064 (full)

Group 2: 1057755357

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Creating a Smart Doorbell and Smart Lock with Raspberry Pi

Leave a Comment

×