Labyrinth game
A physical labyrinth platform that mirrors the orientation of a handheld Nucleo board using IMU sensors and servo actuation.
Author: PETREA Bianca-Iulia
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-biancapetrea16
Description
The project implements a physical 2-axis (X-Y) labyrinth platform driven by two servomotores. Instead of a traditional joystick, the system uses a handheld Nucleo board equipped with an MPU6050 accelerometer and gyroscope to detect tilt. The hardware labyrinth "mirrors" the handheld board's orientation in real-time. A proximity sensor (IR) marks the end of the maze, and the completion time is recorded onto an SD card to maintain a "High Score" leaderboard.
Motivation
I chose this project to explore the concept of remote motion mirroring. It requires a precise synchronization between the handheld controller (IMU data processing) and the mechanical platform (PWM actuation).
Architecture
The project is built as a motion mirroring system between the controller and the maze:
- Handheld Controller (Nucleo + IMU): Detects pitch and roll angles via I2C.
- Main Processor: Translates orientation data into PWM duty cycles.
- Mechanical Platform: Uses two servos to tilt the physical maze.
- End-of-Game Logic: An IR sensor triggers the timer stop.
- Persistence Layer: An SD card module stores the leaderboard via SPI.
Log
Week 14 - 20 April
- Finalized project theme and received approval.
- Researched and ordered all hardware components (IMU, servos, SD module, IR sensor).
Week 4 - 8 May
Week 12 - 18 May
Week 19 - 25 May
Hardware
The project uses the STM32 Nucleo-U545RE-Q board as the brain, connected to sensors for input and motors for output.
Schematics
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| STM32 Nucleo-U545RE-Q | Main Controller | Lab Provided |
| MPU6050 IMU (Soldered) | Handheld tilt detection (I2C) | 15.49 RON |
| 2x SG90 Servomotors | Labyrinth tilt control (PWM) | 27.98 RON |
| Micro SD Card Slot Module | SPI Interface for SD card | 4.39 RON |
| MediaRange 4GB MicroSDHC | Storage for High Scores | 23.00 RON |
| IR Obstacle Sensor | Finish line detection | 19.99 RON |
| Breadboard Kit + MB102 Power | Prototyping and power rail | 35.00 RON |
| 6xAA Battery Holder (DC Jack) | Power for motors | 11.00 RON |
| Varta Longlife Power AA (8 pcs) | Power source | 22.00 RON |
| Resistors Set (600 pcs) | Circuit components | 28.00 RON |
| Jumper Wires (F-M 20cm) | Connections | 14.00 RON |
| Jumper Wires (F-M 40cm) | Long range connections | 19.00 RON |
| Jumper Wires (M-M 30cm) | Breadboard connections | 16.00 RON |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-stm32 | Hardware Abstraction Layer | Handling I2C, SPI, and PWM peripherals |
| mpu6050 | IMU Driver | Converting raw data to tilt angles |
| embedded-sdmmc | SD Card File System | Managing the High Score log file |