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

Week 12 - 18 May

Week 19 - 25 May

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 (USB or 5V external) -Powers the Raspberry Pi Pico and all connected peripherals.

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

Software

LibraryDescriptionUsage
embassyAsync framework for embedded RustRun async tasks like input, delays
embassy-rpEmbassy HAL for Raspberry Pi Pico 2WControl GPIO, PWM, I2C, SPI
cortex-mLow-level support for ARM Cortex-M chipsSet up interrupt handling, registers
cortex-m-rtRuntime and entry point for ARM Cortex-MRequired for running code on Pico
defmtLightweight logging crate for embeddedRust Debug messages over USB/debug probe
probe-rsFlash and debug embedded devicesUpload firmware and debug over USB
  1. link
  2. link ...