Skip to main content
Version: ACS CC

Maze Solver

An autonomous two-wheeled robot designed to navigate and solve a physical (3D) maze using infrared and ultrasonic sensors.

info

Author: Avramoniu Calin-Stefan
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-calinstefan025

Description

This project is an autonomous two-wheeled robot designed to solve physical mazes. It reads distances from a front ultrasonic sensor and receives "clear" or "blocked" signals from two infrared side sensors. Then it analyzes these combined signals to identify the current position and state, such as dead end or intersection, and makes a decision regarding the way to proceed solving the maze. In the end the final goal is to exit the maze and cross the finish line.

Motivation

I wanted to build an autonomous robot and thought this usecase for the robot was really interesting and challenging. I have never worked with hardware before and figured this project would teach me to handle and assemble most of the basic hardware components like dc motors, sensors and motor drivers. The hardware combined with rust code creates something real and entertaining.

Architecture

Architecture

The project is divided in 4 main components: Input, Processing, Output and Power

Main Components:

  • Input: The distance perception and wall detection modules send signals to the processing unit via the GPIO and the UI Button sends the start signal.
  • Processing: The board processes these signals and runs the algorithm and state machine to determine what the next move is. Then it translates the action to control signals (PWM) and sends them to the Motor Controller.
  • Output: The Motor Controller receives the commands and actuates the motors to execute the mechanical motion.
  • Power: There is a 5V power supply for the Processing Unit and a 6V power supply for the Motor Controller and motors.

Maze layout

Maze Layout

Log

Week 13 - 19 April

  • Bought the hardware components
  • Designed the schematics of the robot.
  • Designed the desired maze layout.

Week 20 - 26 April

  • Tested individual IR sensors
  • Tested individual HC-SR04 sensor to ensure it works as intended
  • Tested the whole suite of sensors together (both IR and ultraonic)
  • Completed 1st version of the documentation

Week 27 - 03 May

Hardware

The robot is built on a 2WD chassis. The "brain" of the robot is an STM32 Nucleo STM32U545RE-Q board. For environmental input and navigation, it uses two Infrared Obstacle Avoidance sensors, one on the left and one on the right side of the robot (to detect walls) and one HC-SR04 Ultrasonic sensor (acting as the front detecting sensor). Power delivery and motor control are handled by an L298N motor driver.

Schematics

Schematics

Bill of Materials

DeviceUsagePrice
STM32 Nucleo-64 BoardThe central microcontroller running the Rust logicFree (Provided by faculty)
2WD Smart Car Chassis KitProvides the physical frame, wheels, and 2 DC motors46.99 RON
L298N Motor DriverTranslates logic signals to power for motors11 RON
HC-SR04 Ultrasonic SensorMeasures distance to obstacles in front8.13 RON
IR Obstacle Sensor (x2)Detects walls on the left and right sides6.24 RON
4x AA Battery HolderProvides 6V power specifically for the L298N and motors5.92 RON
Breadboard, Wires & Resistors1k/2k resistors for the HC-SR04 voltage divider and wiring~25.00 RON
Ball wheels (x2)Provides support for the robot15 RON
TOTAL-118.28 RON

Software

LibraryDescriptionUsage
embassy-stm32Basic hardware libraryUsed to set up the input and output pins for the IR and Ultrasonic sensors.
embassy-timeTime and delaysUsed to measure how long it takes for the ultrasonic echo to come back, and to add small pauses in the code.
defmtConsole printing toolUsed to print the distances and sensor status (like "Clear" or "Blocked") to my laptop screen so I could test them.
embassy-executorCode runnerUsed to run the main loop of the program without freezing the board.
  1. https://embedded-rust-101.wyliodrin.com/docs/acs_cc/category/lab