Skip to main content
Version: ACS CC

SafePi

A smart and secure mini-safe that unlocks with RFID and fights back against intruders.

info

Author: Nămoianu Petre
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-PetreNamo

Description

SafePi is a compact, smart security safe controlled via RFID authentication. It is designed to be unlocked using authorized RFID cards or a smartphone. When an unauthorized access attempt is detected, the system triggers a loud audible alarm, sends a notification to the user's smartphone, and activates a physical deterrent mechanism that launches small projectiles to discourage tampering.

Motivation

The motivation behind SafePi is to enhance personal security with an accessible and affordable system. It not only alerts you instantly via phone notification, but also discourages and delays access through physical deterrents.

Architecture

  • Main Controller (Raspberry Pi Pico 2W):
    Acts as the central unit managing all inputs and outputs and sends notifications to your phone.

  • RFID Module:
    Reads the tag of the person attempting to open the safe.

  • Servo Motors:
    One opens the door when told by the controller, the others launch small objects if an intruder is trying to open the safe.

  • LEDs, Buzzer:
    Used as a visible and audible alarm.

Log

Week 5 - 11 May

Started gathering the required components, checked to see what voltage some parts work at. Started writing the documentation and researching how to make a safe shoot "projectiles".

Week 12 - 18 May

During this week I acquired all the remaining parts, decided to switch from 4x1.5V batteries to a single 9V battery in case my DC motor needed more voltage to spin faster. I put all my hardware in the safe for the first time and came up with a rough idea for the launching mechanism for the "projectiles".

Week 19 - 25 May

Started writing the code for the safe. First made the LEDs blink and the buzzer sound, then I made the servomotor twist. After a brief pause, I continued with the PN532. I initially forgot to connect the RESET pin and did not know why I had to disconnect the PN532 every time i wanted to run the code. After that I struggled a little with an issue that would make the module not read keycards after about 1 minute.

Hardware

For my safe, I used a Raspberry Pi Pico 2W as my MCU. With the help of a PN532 module I am able to scan any access keys with NFC/RFID. My locking mechanism is a SG90 servomotor. I have also installed two LEDs, one blue and one red, and an active buzzer, meant to resemble an alarm. The "projectiles" are fired with the help of a DC motor that is spinning a wheel. Below is a photo with the hardware outside the box:

Hardware

Schematics

Kicad

YouTube Demo

SafePi Demo

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON
Red LEDBlinking when the alarm goes off0.39 RON
Blue LEDBlinking when the alarm goes off0.29 RON
BuzzerUsed when the alarm goes off1 RON
PN532 RFID ModuleUsed for opening the safe50 RON
9V BatteryUsed for powering the motors and the RFID Module10 RON
Battery SupportConnecting the battery to the breadboard1.29 RON
BreadboardConnecting all the components4.56 RON
Step-Down moduleUsed to limit the voltage to 5V6.49 RON
ServomotorSafe locking mechanism11.99 RON
DC MotorUsed for throwing small balls33 RON
TransistorUsed for commanding the DC motor2 RON

Software

LibraryDescriptionUsage
embassyAsync embedded framework for RustMain framework for handling async tasks
embassy-rpRP2350 support for EmbassyProvides access to GPIO, I2C, and timers for Raspberry Pi Pico 2
defmtLogging framework for embedded RustDebugging tool
embedded-hal-asyncasynchronous traits for embedded hardware access using asyncasynchronous I2C
Own PN532 cratea lightweight pn532 implementationwrote it to be able to use with async with better logging

1. PWM

2. I2C