|
| 1 | +# Inteligent Vault |
| 2 | +A one line project description |
| 3 | + |
| 4 | +:::info |
| 5 | + |
| 6 | +**Author**: Andrei Teodor-Mihai \ |
| 7 | +**GitHub Project Link**: [link_to_github](https://github.com/Teodor04/website#) |
| 8 | + |
| 9 | +::: |
| 10 | + |
| 11 | +<!-- do not delete the \ after your name --> |
| 12 | + |
| 13 | +## Description |
| 14 | + |
| 15 | +Intelligent Vault is a smart electronic safe controlled by an STM32 Nucleo board. |
| 16 | +The safe can be unlocked using a PIN entered from a keypad. It controls a physical locking mechanism using a servo motor, detects unauthorized movement or forced opening attempts, triggers an alarm, and stores important events in a log. |
| 17 | + |
| 18 | +The project also includes a USB connection to a PC/laptop. Through a local web interface, the user can monitor the safe status, view logs and configure some settings such as the PIN or tamper detection. |
| 19 | + |
| 20 | + |
| 21 | +## Motivation |
| 22 | + |
| 23 | +I chose this project because it combines several important embedded systems concepts: GPIO, PWM, SPI, I2C, serial communication, sensors, actuators and real-time event handling. |
| 24 | + |
| 25 | +The project is also practical and easy to demonstrate. It has a visible physical result: the safe can lock/unlock, detect tampering and trigger an alarm. The web admin interface adds a connectivity component and makes the project more complex than a basic local-only embedded system. |
| 26 | + |
| 27 | + |
| 28 | +## Architecture |
| 29 | + |
| 30 | +The system is split into the following main software components: |
| 31 | + |
| 32 | +- Authentication Manager |
| 33 | + - Handles PIN input, checks if the PIN is correct and manages failed attempts. |
| 34 | + - After several wrong attempts, it activates a temporary lockout. |
| 35 | + |
| 36 | +- Lock Controller |
| 37 | + - Controls the servo motor used for the physical locking mechanism. |
| 38 | + - Manages the LOCKED and UNLOCKED states. |
| 39 | + |
| 40 | +- Tamper Detection |
| 41 | + - Reads data from the accelerometer/gyroscope. |
| 42 | + - Detects movement, shaking or forced opening. |
| 43 | + - Uses a reed switch or microswitch to detect if the door was opened while locked. |
| 44 | + |
| 45 | +- Alarm Manager |
| 46 | + - Controls the buzzer and status LEDs. |
| 47 | + - Activates when tamper is detected or when too many wrong PIN attempts occur. |
| 48 | + |
| 49 | +- Display/UI Manager |
| 50 | + - Shows the current state of the vault on the LCD display. |
| 51 | + - Displays messages such as LOCKED, ENTER PIN, UNLOCKED, ALARM and LOCKOUT. |
| 52 | + |
| 53 | +- Event Logger |
| 54 | + - Stores important events such as BOOT, LOCKED, UNLOCKED, WRONG_PIN, TAMPER and ALARM. |
| 55 | + - Logs can be saved on a microSD card or sent to the PC through USB serial. |
| 56 | + |
| 57 | +- Communication Manager |
| 58 | + - Sends status and events to a PC/laptop through USB serial. |
| 59 | + - Receives commands from the local web admin interface, such as LOCK, UNLOCK, SET_PIN or ARM_TAMPER. |
| 60 | + |
| 61 | + |
| 62 | +## Log |
| 63 | + |
| 64 | +<!-- write your progress here every week --> |
| 65 | + |
| 66 | +### Week 5 - 11 May |
| 67 | + |
| 68 | +Created the project idea and defined the main requirements. |
| 69 | +Selected the STM32 Nucleo board as the main microcontroller platform. |
| 70 | +Researched the required hardware components: servo motor, keypad, LCD, IMU sensor, reed switch, buzzer and microSD module. |
| 71 | + |
| 72 | +### Week 12 - 18 May |
| 73 | + |
| 74 | +Connected the keypad and tested PIN input. |
| 75 | +Connected the servo motor and implemented basic LOCK/UNLOCK control. |
| 76 | +Added the main vault state machine: BOOT, LOCKED, PIN_ENTRY, UNLOCKED, LOCKOUT and ALARM. |
| 77 | +Added serial communication between the STM32 board and the PC server. |
| 78 | +Displayed vault status and logs in the web admin interface. |
| 79 | + |
| 80 | +### Week 19 - 25 May |
| 81 | + |
| 82 | +Connected the IMU sensor and implemented basic motion/tamper detection. |
| 83 | +Connected the reed switch for detecting forced door opening. |
| 84 | +Added buzzer alarm and LED feedback. |
| 85 | +Added event logging for wrong PIN attempts, unlock events and tamper events. |
| 86 | +Tested the complete system and prepared the final demo. |
| 87 | + |
| 88 | +## Hardware |
| 89 | + |
| 90 | +The project uses an STM32 Nucleo-U545RE-Q development board as the main controller. The board controls the safe mechanism and communicates with several external modules. |
| 91 | + |
| 92 | +The keypad is used for entering the PIN. The servo motor physically locks and unlocks the safe. The LCD display shows the current state of the system. The MPU6050 accelerometer/gyroscope detects movement or shaking, while a reed switch detects if the door is opened while the vault is locked. A buzzer is used for the alarm. A microSD module can be used for event logging. |
| 93 | + |
| 94 | +The board is connected to a PC/laptop through USB serial. A local Python web server reads messages from the board and exposes a web admin interface. |
| 95 | + |
| 96 | +### Schematics |
| 97 | + |
| 98 | +The following schematic shows the main connections between the STM32 Nucleo board and the external modules used by the Intelligent Vault project. |
| 99 | + |
| 100 | +<img src="./schema.svg" alt="Schema conexiuni Intelligent Vault" width="800"/> |
| 101 | + |
| 102 | +### Bill of Materials |
| 103 | + |
| 104 | +<!-- Fill out this table with all the hardware components that you might need. |
| 105 | +
|
| 106 | +The format is |
| 107 | +``` |
| 108 | +| [Device](link://to/device) | This is used ... | [price](link://to/store) | |
| 109 | +
|
| 110 | +``` |
| 111 | +
|
| 112 | +--> |
| 113 | + |
| 114 | +| Device | Usage | Price | |
| 115 | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------- | |
| 116 | +| [STM32 Nucleo-U545RE-Q](https://www.st.com/en/evaluation-tools/nucleo-u545re-q.html) | Main microcontroller board, provided by the teacher | Provided by teacher | |
| 117 | +| [MG90S Servo Motor](https://www.optimusdigital.ro/motoare-servomotoare/271-servomotor-mg90s.html) | Controls the physical lock mechanism | Check store price | |
| 118 | +| [Reed Switch Module](https://www.optimusdigital.ro/en/buttons-and-switches/12717-reed-switch-module.html) | Detects if the safe door is opened/forced | Check store price | |
| 119 | +| [4x4 Matrix Keypad](https://www.optimusdigital.ro/senzori-senzori-de-atingere/2441-tastatura-matriceala-4x4-cu-butoane.html) | Used for PIN input | Check store price | |
| 120 | +| [1.8 inch SPI LCD ST7735](https://www.optimusdigital.ro/optoelectronice-lcd-uri/3554-modul-lcd-de-18-cu-spi-i-controller-st7735-128x160-px.html) | Displays system state and messages | Check store price | |
| 121 | +| [MPU6050 Accelerometer and Gyroscope](https://www.optimusdigital.ro/senzori-senzori-inertiali/96-modul-senzor-triaxial-mpu-6050.html) | Detects movement, shaking and tamper attempts | Check store price | |
| 122 | +| [Active Buzzer Module](https://www.optimusdigital.ro/audio-buzzere/10-modul-cu-buzzer-activ.html) | Alarm output | Check store price | |
| 123 | +| [MicroSD Card Module](https://www.optimusdigital.ro/memorii/1516-modul-slot-card-microsd.html) | Stores event logs | Check store price | |
| 124 | +| [Female-Male Wires](https://www.optimusdigital.ro/en/wires-with-connectors/92-female-male-wire40p-20-cm.html) | Used for connecting modules to the board | Check store price | |
| 125 | +| [Female-Female Wires](https://www.optimusdigital.ro/en/wires-with-connectors/90-20-cm-40p-female-female-wire.html) | Used for connecting modules and headers | Check store price | |
| 126 | +| [Breadboard](https://www.optimusdigital.ro/prototipare-breadboard-uri/8-breadboard-830-points.html) | Used for prototyping connections | Check store price | |
| 127 | +| [Breadboard Power Supply](https://www.optimusdigital.ro/electronica-de-putere-stabilizatoare-liniare/61-sursa-de-alimentare-pentru-breadboard.html) | Provides external 5V for the servo motor | Check store price | |
| 128 | +| [1000 uF Capacitor](https://www.optimusdigital.ro/ro/componente-electronice-condensatoare/7822-condensator-electrolitic-1000-uf-16-v.html) | Stabilizes servo power supply | Check store price | |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +## Software |
| 133 | + |
| 134 | +| Library | Description | Usage | |
| 135 | +| --------------------------------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------- | |
| 136 | +| [embassy-stm32](https://github.com/embassy-rs/embassy) | Async embedded framework for STM32 microcontrollers | Used for GPIO, timers, SPI, I2C, UART/USB and async tasks | |
| 137 | +| [embedded-hal](https://github.com/rust-embedded/embedded-hal) | Common traits for embedded Rust drivers | Used as abstraction layer for peripherals and drivers | |
| 138 | +| [embedded-graphics](https://github.com/embedded-graphics/embedded-graphics) | 2D graphics library for embedded displays | Used for drawing text, status screens and UI elements on the LCD | |
| 139 | +| [mipidsi](https://github.com/almindor/mipidsi) | Display driver for SPI TFT displays such as ST7735/ST7789/ILI9341 | Used for controlling the SPI LCD display | |
| 140 | +| [heapless](https://github.com/rust-embedded/heapless) | Fixed-capacity data structures without dynamic allocation | Used for command buffers, logs and serial messages | |
| 141 | +| [embedded-sdmmc-rs](https://github.com/rust-embedded-community/embedded-sdmmc-rs) | SD card and FAT filesystem library for embedded systems | Used for writing event logs to the microSD card | |
| 142 | +| [defmt](https://github.com/knurling-rs/defmt) | Logging framework for embedded Rust | Used for debugging firmware during development | |
| 143 | +| [panic-probe](https://github.com/knurling-rs/probe-run) | Panic handler for embedded debugging | Used for debugging panics through probe-run/defmt | |
| 144 | +| [Flask](https://flask.palletsprojects.com/) | Python web framework | Used for the local web admin interface | |
| 145 | +| [PySerial](https://pyserial.readthedocs.io/) | Python serial communication library | Used by the web server to communicate with the STM32 board over USB serial | |
| 146 | + |
| 147 | + |
| 148 | +## Links |
| 149 | + |
| 150 | +<!-- Add a few links that inspired you and that you think you will use for your project --> |
| 151 | + |
| 152 | +1. [STM32](https://www.st.com/en/evaluation-tools/nucleo-u545re-q.html) |
| 153 | +2. [Rust_Book](https://docs.rust-embedded.org/book/) |
| 154 | +... |
0 commit comments