Skip to main content
Version: FILS English

Door Security System

A smart door lock system that detects intruders using a camera module and secures access with a passcode.

info

Author: Bumbacea Nicoleta-Alexandra
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-NicoletaBumbacea

Description

The project is a door security system built using a Raspberry Pi Pico 2, programmed in Rust. The system locks the door and requires a 4-digit code to unlock. When the correct code is entered, a green LED turns on, a confirmation sound is played, and the door unlocks. If the wrong code is entered, a red LED turns on, a warning sound is played, and a photo is taken using an Adafruit OV5640 Camera Module. This image is then stored for security purposes.​

Motivation

I chose this project because it combines embedded systems, security, and real-world problem-solving. Door security is a practical application, and building a smart lock system allows me to explore key concepts such as keypad input handling, device control with GPIO, audio/visual feedback, and basic image capture using a camera module.

Architecture

The project includes the following main components:

Input Handler: Captures the 4-digit PIN via a matrix keypad.

PIN Validator: Compares the input against a stored code.

Control Logic: Determines if the door should unlock or log an intruder.

Feedback System: Uses LEDs and buzzer to provide visual and audio feedback.

Communication Module: Sends a UART signal to ESP32-CAM to take a picture.

Image Handler: Receives image data over UART or forwards it to a connected device.

Architecture schematic

Log

Week 5 - 11 May

This week, I completed the hardware setup for my smart door lock system. All components — including the keypad, LEDs, buzzer, solenoid, and ESP32-CAM module — have been connected and tested for basic functionality.

Week 12 - 18 May

I transitioned into the software development stage. I initialized the Rust project using the Embassy framework and began writing basic control logic to interact with the hardware, starting with GPIO testing for LEDs and preparing the structure for handling keypad input. This lays the groundwork for implementing core features like code verification and door control in the coming week.

Week 19 - 25 May

This week, significant progress was made on the project. The software component for the access control system has been completed, including the integration of the keypad, LEDs, buzzer, solenoid control, and logic for password validation. An LCD module was also added to enhance user interaction by displaying messages such as code prompts, making the system more intuitive and user-friendly. While the core system is now functional, challenges remain with the camera integration.

Hardware

Raspberry Pi Pico 2W - Acts as the central microcontroller running the embedded Rust program.Handles keypad scanning, logic processing, UART communication, GPIO control for LEDs, buzzer, relay.

4x4 Matrix Keypad - Used for user input; allows the user to enter the 4-digit access code.

Green LED-Indicates successful code entry and that the door is being unlocked.

Red LED-Indicates failed code entry or unauthorized access attempt.

Piezo Buzzer - Provides audio feedback.

Relay Module (1 Channel, 5V) - Switches high-current 5V to drive the solenoid.

Solenoid Lock - Mechanically controls the locking/unlocking of the door.

Camera Module - Captures an image when an incorrect code is entered.

Power Supply -Powers the Raspberry Pi Pico and all connected peripherals.

Hardware imagine

Schematics

Kicad_Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON
SC0889 Raspberry Pi Debug ProbePrograms/debugs the Pico 2W74 RON
4x4 Matrix KeypadUsed to input the 4-digit unlock code7 RON
ESP32-CAM Development Board with OV2640 2MP Camera ModuleCamera Module-Captures intruder images on failed attempts61 RON
Solenoid - 5vLocks/unlocks the door37 RON
Relay moduleControls the solenoid safely from Pico5 RON
Breadboard kitFor circuit prototyping (includes breadboard, wires, LEDs, resistors,etc.)70 RON
Suport carcasa baterie 9V + mufapowers the components3.18 RON

Software

LibraryDescriptionUsage
embassy-executorAsync runtime for embedded systems.Runs tasks like keypad scanning and delays without blocking the main thread.
embassy-rpHardware Abstraction Layer (HAL) for Raspberry Pi Pico (RP2040)Controls GPIOs, I2C, timers, etc.
embassy-timeAsync-friendly timing utilitiesUsed for debounce delays, buzzers, and solenoid timing.
defmtOutputs structured logs during development.
defmt-rttSends defmt logs over Real-Time Transfer (RTT) to the development machine
panic-probeCaptures and prints panic messages using defmtHelpful for debugging runtime errors.
heaplessFixed-size collections without dynamic memory allocationUsed to store codes securely in no_std.
ag-lcdDriver for HD44780-compatible LCDs. Displays messages on a 1602 LCD via I2C.
port_expanderSupports PCF8574 and similar I2C I/O expanders.Allows the LCD to be controlled over I2C with fewer GPIOs.
static_cellHelps create static references required for Embassy peripheralsEnsures safe and valid lifetimes for hardware resources.
heaplessFixed-size collections without dynamic memory allocationUsed to store codes securely in no_std
  1. link
  2. link ...