Skip to main content
Version: ACS CC

SmartDoorGuard

A Smart Door Security System using Raspberry Pi Pico.

info

Author: Dragos-Florin Fromea
GitHub Project Link: link

Description

The system allows authorized users to unlock a door either by entering a PIN on a custom keypad or by using a smartphone-based control. When a correct PIN is entered, the door unlocks and a green LED lights up to indicate successful access, while the red LED remains off. At all other times, the red LED stays on to indicate that the system is locked. If an incorrect PIN is entered, a buzzer emits a warning sound to alert the user of the failed attempt. The system enhances home or office security by providing both visual (LEDs) and auditory (buzzer) feedback.

Motivation

One day, I saw an interesting door locking system at a friend's place. It had the option to unlock the door via a smartphone. I found the idea fascinating and decided to try building a similar system myself. This project gave me the opportunity to explore embedded hardware and learn how to implement secure access control using Rust.

Architecture

System architecture

The Raspberry Pi Pico reads button inputs, processes the PIN, and controls the servo, LEDs, and buzzer accordingly. All components are connected via GPIO pins. Additionally, the system supports door unlocking via smartphone communication over Wi-Fi by hosting a simple HTTP server, allowing authorized users to bypass PIN entry.

The system behavior changes depending on whether the door is locked or unlocked, a correct PIN has been entered, or an unlock signal has been received from the smartphone.

If an incorrect PIN is entered, the Pico sends a signal to turn on the red LED and activate the buzzer to indicate an invalid access attempt.

If the correct PIN is entered or the unlock button is pressed on the HTTP web page, the Pico sends a signal to turn on the green LED and activates the servo motor to unlock the door.

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

The system uses the following components:

  • Raspberry Pi Pico: acts as the central control unit
  • 4 push buttons: used for entering the PIN
  • Servo motor: used to physically open and close the door
  • Green LED: lights up when the door is successfully unlocked
  • Red LED: lights up when the PIN is incorrect or the door remains locked
  • Active buzzer: emits a warning sound when a wrong PIN is entered
  • Power supply: external battery powering the system
  • Breadboard and jumper wires: used for prototyping and connecting components

Schematics

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller79,32 RON
Micro Servomotor SG90 90°Controls door opening/closing mechanism13,99 RON
Green LEDProvides visual feedback for unlock0.39 RON
RED LEDProvides visual feedback for lock0.39 RON
Active BuzzerEmits warning sound on wrong PIN entry4,98 RON
Breadboard Kit + jumpersUsed for prototyping and connecting components22 RON
Buttons 6x6x6Used for entering PIN digits2,88 RON
ResistencesUsed for current limiting in LEDs and button debouncing~2 RON
Micro USB Cable 1 mUsed to power the Raspberry Pi Pico 2W3.99 RON
2x8 Pin Female HeaderUsed to connect Raspberry Pi Pico to breadboard1.98 RON

Software

LibraryDescriptionUsage
embassy-executorAsynchronous executor for embedded RustRunning tasks asynchronously
embassy-rpEmbassy support for Raspberry Pi Pico WAccess peripherals
embassy-timeTimer driver and time utilitiesDelays, alarms, and timekeeping
embassy-syncAsync channels, signals, and mutexesCommunication between tasks
cyw43Wi-Fi driver for CYW43439 chipWi-Fi connectivity
embassy-netAsynchronous embedded TCP/IP stackHTTP over TCP
defmtEfficient logging framework for embedded devicesDebug print messages
static_cellSafe statics for no_std environmentsStatic allocation
  1. Door lock