Skip to main content
Version: ACS CC

Battery Safe Box

A battery-powered electronic safe box.

info

Author: John-Roberto Nau
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-JohnRobertoNau

Description

This project implements an electronic safe that opens only after entering a valid PIN code. The user inputs the PIN using a 4x4 matrix keypad. Visual feedback is provided on an LCD display, while audio feedback is generated using a passive buzzer. The unlocking mechanism is controlled by a servo motor. The device is battery-powered and includes a MicroSD card module to log access attempts.

Motivation

I chose this project because I wanted to have a useful device to use in my daily life, knowing that is built by me. I wanted to combine practical embedded Rust programming with hardware interaction. It will be a challenge to work with GPIOs, I2C, PWM, and SPI for developping the this safe box.

Architecture

A schematic diagram is provided to illustrate the connections and layout of the components.

Architecture diagram

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

  • Raspberry Pi Pico 2W: the main microcontroller
  • 4x4 Matrix Keypad: used to securely enter the PIN code to unlock the safe
  • LCD 1602 with I2C and yellow-green backlight: provides visual feedback
  • Passive buzzer: provides audio feedback
  • Micro Servo Motor SG90: physically locks or unlocks the safe mechanism
  • SPI microSD card reader module:
  • Kit Breadboard HQ830 + jumper wires: used for prototyping and connecting all components
  • Female-to-male and male-to-male jumper wires: used to connect components like the keypad, LCD, and sensors to the microcontroller
  • Battery holder for 4x R6 (AA) batteries: powers the entire system
  • Pin headers (2.54 mm, 40p): used to connect the components with the breadboard

Schematics

A KiCad schematic is provided:

KiCad schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller2 X 35 RON
[Matrix Keypad 4x4]Pin input6.99 RON
[LCD 1602 with I2C]Display14.99 RON
[Passive Buzzer Module]Audio feedback2.99 RON
Micro Servo Motor SG90Lock mechanism13.99 RON
[MicroSD SPI Reader Module]Logging access attempts3.99 RON
[Breadboard HQ830 + Wires]Prototyping and wiring22 RON
[Female-to-male jumper wires]Wiring keypad, LCD, etc.7.99 RON
[Male-to-male jumper wires]General conections4.99 RON
[Battery Holder (4x R6 AA)]Power supply4.86 RON
[4 X Red Pin Headers (2.54 mm, 40p)]Connecting components on breadboard4 X 0.99 RON

Software

LibraryDescriptionUsage
embassy-rsHAL support for RaspberryAccess to GPIO, PWM, I2C, SP
defmtLightweight logging frameworkFor printing debug via probe-rs
probe-rsDebugging and flashingUsed for debugging on Raspberry
heaplessFixed-capacity buffersFor handling user input

...