Skip to main content
Version: FILS English

Smart Door

A Raspberry Pi Pico 2 W based door security system.

info

Author: Octavian Mihai Cretu
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-octavian2411

Description

This project aim is to develop a smart door lock system powered by a Raspberry Pi Pico 2 W. It uses a fingerprint sensor to authenticate users, a servo motor to simulate locking and unlocking the door, and a buzzer to signal access. An LED display shows real-time status messages, while an ultrasonic sensor monitors the door's open or closed state. The system combines biometric security with sensor-based monitoring to create an interactive and responsive door locking simulation.

Motivation

I chose this project because I’ve always found fingerprint matching really interesting. The idea that you can use something as unique as a fingerprint to unlock a door seemed like a fun and useful concept to explore. I wanted to learn how to use a fingerprint sensor with a microcontroller and see how everything works together. This project also lets me combine different parts like a servo motor, buzzer, LED display, and ultrasonic sensor to create a full system. By using the Raspberry Pi Pico 2 W programmed in Rust, I’m gaining a better understanding of how Rust works in embedded systems, especially with its concurrency features, and async behavior for handling multiple tasks efficiently.

Architecture

Architecture photo

  1. Authentication Module

    • Handles fingerprint scanning and matching.
    • Communicates with the fingerprint sensor over UART.
    • Sends authentication results (success/failure) to the Control Module.
  2. Control Module

    • Core decision-making unit of the system.
    • Receives input from the Authentication Module and Sensor Interface.
    • Controls actuators (servo, buzzer) and updates the display.
    • Manages system states such as Locked, Unlocked.
  3. Sensor Interface

    • Reads distance data from the ultrasonic sensor using GPIO.
    • Determines if the door is open or closed.
    • Sends door state updates to the Control Module.
  4. Actuator Interface

    • Controls output devices.
    • Servo Motor via PWM for locking/unlocking.
    • Buzzer via GPIO or PWM for alerts.
  5. Display Interface

    • Updates the LED display with system status messages (e.g., "Locked", "Access Granted").
    • Communicates with the display using I2C.

Log

Week 10 - 28 April

Assembeled componenets on a breadboard and tested how they all work separately.
Started working on interfacing with the R503 fingerprint sensor

Hardware

Raspberry Pi Pico 2 W:

  • Central microcontroller that manages all inputs, outputs, and logic.
  • Runs the program written in Rust.

Fingerprint Sensor (R503):

  • Authenticates users by matching scanned fingerprints with stored data.
  • Communicates with the Pico via UART.

Servo Motor:

  • Simulates the physical locking and unlocking of the door.
  • Controlled via a PWM signal from the Pico.

Ultrasonic Distance Sensor (HC-SR04):

  • Detects if the door is open or closed by measuring distance.
  • Uses GPIO pins for trigger and echo.

LED Display (LCD 1602 - I2C):

  • Shows system status messages like "Locked", "Access Granted", or "Register Fingerprint".
  • Communicates with the Pico via I2C.

Buzzer:

  • Sounds a short alert when the door is unlocked or about to be locked.
  • Controlled via PWM.

Schematics

Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2 WThe microcontroller with Wi-Fi for phone notification39.50 lei
R503 - Fingerprint SensorFor fingerprint detection132 lei
LCD1602 - I2CDisplays system messages16 lei
HC-SR04 Ultrasonic Distance SensorFor measuring distances to door6.50 lei
SG90 Micro Servo MotorFor simulating locking mechanism14 lei
Passive Buzzer ModuleFor audible alerts1.50 lei
Wires + BreadboardFor connections15 lei

Software

LibraryDescriptionUsage
embassy-rpHardware Abstraction LayerInterfaces with Raspberry Pi Pico 2 W hardware
embassy-executorTask executorHandles asynchronous tasks
embassy-timeTiming moduleProvides timing functions for operations
lcd1602-driverLCD1602 InterfaceCommunication with the display
pwmPWM ModuleFor buzzer and servo
uartUART ModuleFor fingerprint senzor
  1. YouTube video of fingerprint sensor
  2. Github R503 example wtih RP2040