π Smart Door Lock with Face Recognition
A secure, AI-powered door lock system using ESP32-CAM and Raspberry Pi Pico 2.
Author: Matei-Alexandru TiΘΔ
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-MateiTita
π§Ύ Descriptionβ
This project implements a smart door lock system that uses face recognition for access control.
The system relies on an ESP32-CAM to detect and recognize faces and streams video live over Wi-Fi.
When a known face is detected, it sends a signal to a Raspberry Pi Pico 2, written in Rust, which activates a servo motor to unlock the door and triggers visual (LED) and audio (buzzer) feedback.
All access events are logged in real time to a connected laptop via USB.
π‘ Motivationβ
The goal of this project is to explore a practical application of embedded systems and machine vision, combining:
- Offline, low-cost AI via ESP32
- Embedded Rust programming
- Real-time feedback and logging
- A functional and extendable prototype for smart home security
π§ Architectureβ
System Flowβ
-
ESP32-CAM
- Captures live video
- Performs face detection and recognition
- Streams to browser via local IP
- Sends
"GRANT"
or"DENY"
to Pico over UART
-
Raspberry Pi Pico 2
- Waits for serial commands
- Controls:
- Servo for door lock
- LEDs (Green = granted, Red = denied)
- Buzzer for audio feedback
- Sends event logs to laptop via USB
-
Laptop
- Runs a Python script to receive and timestamp events
β
ποΈ Development Logβ
Week 1 β Initial Planningβ
I set up and powered the Raspberry Pi Pico 2 and ESP32-CAM, tested the ESP32-CAM by flashing the CameraWebServer example and viewing the live video stream on my laptop, and verified the Pico environment by writing a simple Rust program to blink an LED, confirming basic GPIO control and that both boards were functioning properly.
Week 2 β Core Setupβ
Week 3 β Hardware Integrationβ
Week 4 β Logging and Testingβ
π© Hardwareβ
Components Usedβ
Component | Purpose |
---|---|
ESP32-CAM | Face recognition and video streaming |
Raspberry Pi Pico 2 | Hardware control (Rust) |
Servo Motor (SG90) | Lock/unlock mechanism |
Red and Green LEDs | Visual status indication |
Buzzer | Audio feedback |
Breadboard + Wires | Connections and prototyping |
Laptop (USB) | Real-time log receiver |
Bill of Materialsβ
Component | Qty | Price (RON) | Total (RON) |
---|---|---|---|
ESP32-CAM | 1 | 50 | 50 |
Raspberry Pi Pico 2 | 1 | 35 | 35 |
SG90 Servo | 1 | 20 | 20 |
LEDs + Buzzer | 4 | 5 | 5 |
Breadboard + Wires | 1 | 15 | 15 |
Total | 125 |
π» Softwareβ
Tools & Frameworksβ
π· ESP32-CAMβ
- CameraWebServer example
- Face recognition + streaming over Wi-Fi
π¦ Raspberry Pi Pico 2β
- Rust with
rp2040-hal
,embedded-hal
,usb-device
- UART parser for GRANT/DENY commands
- PWM control for servo + GPIO for feedback
π Laptop Loggerβ
- Python 3 +
pyserial
- Receives USB serial data
- Timestamps and saves logs to
door_log.txt