Smart Home Devices
This project aims to automate basic home devices, mainly the main front door, based on the presence of the owner.
Author: Petre Teodora-Maria
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-dm-2025-730dora
Descriptionβ
This main focus of this project is to implement a Secure Access Smart Door system using the STM32 microcontroller and the Rust programming language. The main goal is to provide autonomous entry control: the door system activates when motion is detected and grants access only after a person provides the correct RFID scan. A servo motor manages the lock, and colored LEDs, along with a screen, provide feedback, displaying a personalized welcome message upon successful authentication.
Motivationβ
Since I was little I used to make dollhouses out of cardboard, but Iβve always felt like something was missing. I wanted to make them as real as possible β functional lights, doors, almost everything that a real house has β but I didnβt know how to.
Architectureβ

- STM32 - used for handling the logic of the project. It receives an interrupt from the PIR detector that a person is at the door which sends the RFID from an idle state to an active one.
- PIR Motion Detector (HC-SR501) β detects the person approaching the door
- RFID Reader Module β collects the security credentials for authentication
- LEDs β provides immediate visual feedback for granted/denied access
- Servomotor SG90 β mechanically closes and opens the door if the access is granted
- LCD Screen β displays personalized βWelcome, [userβs name]β message upon successful entry
- Photoresistor - inside the house after entry the photoresistor analyzes the state of the light and turns on a "main light" if necessary.
Week 5 - 11β
Put my idea on paper, drawings of hardware, design, connections to make it easier to follow later.

Week 12 - 18β
Bought the materials and started building.
Week 19 - 25β
Connected all the devices, finished and polished the code and finalized the setup (the house).

Hardwareβ

-
STM32 Microcontroller - the central processing unit, responsible for running the embedded Rust firmware, using PWM for motor control and SPI for the communication with the RFID module and the rest via GPIO pins
-
Servomotor SG90 - acts as the physical lock actuator, controlled via a PWM signal from the STM32 to precisely move the door mechanism between "locked" and "unlocked" positions
-
PIR Motion Detector (HC-SR501) - input device that triggers the security sequence by sending a digital signal to an STM32 GPIO pin when movement is detected
-
RFID Reader Module (RC522) - communicates via SPI to the STM32, reading credential data from passive RFID tags for secure user authentication
-
LEDs (Red/Green) - simple visual output indicators connected to GPIO pins, signaling "Access Granted" (Green) or "Access Denied" (Red)
-
LCD Screen - displays the personalized welcome message
Schematicsβ
Bill of Materialsβ
| Device | Usage | Price |
|---|---|---|
| STM32 NUCLEO-U545RE-Q | The microcontroller | 0 RON (borrowed) |
| SERVOMOTOR SG90 | The motor for the door | 20 RON |
| PIR | Motion Sensor | 15 RON |
| RFID | Reader Module | 20 RON |
| LEDs | denied/granted access visualisation & light | from an old kit |
| 830 points Breadboard | Connectivity | also from an old kit |
| Photoresistor | detects the level of natural light outside | from the same old kit |
| 16x2 I2C LCD Display | The "Welcome, user!" screen | free from the kit |
Softwareβ
| Library | Description | Usage |
|---|---|---|
| embassy-stm32 | Hardware Abstraction Layer (HAL) for STM32 microcontrollers. Provides async APIs for chip's peripherals | Used to initialize the hardware, configure GPIO pins (LEDs, PIR), set up SPI for the RFID, I2C for the LCD, and ADC for the light sensor |
| embassy-executor | Async runtime for embedded systems | Used Spawner to run the LDR and servo in the background while the main loop handles the RFID and PIR logic |
| embassy-time | Timekeeping, delays and timeouts | Stop waiting if card isn't scanned fast enough & manage motor to open/close door |
| mfrc522 | Driver library for the MFRC522 RFID | Gives the device the ability to read and write data from/to the card |
| lcd-lcm1602-i2c | A driver for 16x2 LCD screens using the I2C interface | To send text commands like lcd.write_str("Welcome home") and clear the screen |
| embedded-hal-bus | embedded-hal provides traits for SPI and I2C buses and devices | Uses ExclusiveDevice helper to ensure the RFID uses SPI pins alone |
| defmt-rtt | Transmit defmt log messages over the RTT (Real-Time Transfer) protocol | Used info! and error! to print messages to the terminal (via a debugger) while the code is running |
| panic-probe | A panic handler that works with defmt | In case the code crashes, it catches it, print the error to console to avoid freezing |
Linksβ
- The labs
- The Projects
- The Beautiful YouTube for PIR, RFID, LDR, LCD I2C 1602 and servo
- This man with his project