Skip to main content
Version: ACS CC

AutoNav

Autonomous Robot with Mapping and Simplified SLAM

info

Author: Anca Stefania Maxim
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-ancamaxim

Description

AutoNav is an autonomous mobile robot that explores an unknown space, builds a 2D obstacle map in real time, and makes navigation decisions independently — without human intervention. The project implements a simplified SLAM (Simultaneous Localization and Mapping) system, adapted to the hardware constraints of an STM32 microcontroller.

The robot uses three ultrasonic sensors and a scanning servo to detect surrounding obstacles, wheel encoders for odometry, and an IMU for heading error correction. From this data, it builds a probabilistic occupancy grid — a 2D map where each cell has an associated probability of containing an obstacle.

The map is displayed live on a color LCD mounted on the robot, updated at 10Hz. Simultaneously, data is transmitted wirelessly via ESP8266 to a PC, where it can be visualized in real time through a graphical interface.

The exploration algorithm uses frontier-based exploration: the robot identifies boundaries between explored and unknown space and autonomously heads toward the nearest unexplored frontier until the accessible space is completely mapped.

Motivation

This project was chosen because it covers all peripherals and protocols studied in the lab — SPI, I2C, UART, PWM, GPIO, ADC, TIM input capture — demonstrated simultaneously in a functional integrated system. It implements algorithms relevant to real-world applications: odometry, sensor fusion, probabilistic mapping, and graph search for trajectory planning — all in Rust without an operating system. Similar SLAM systems are used in industrial robots (Amazon warehouses), autonomous vacuum cleaners (Roomba), exploration drones, and autonomous vehicles.

Architecture

The system is structured in four functional layers:

  • Perception Layer: 3x HC-SR04 + scanning servo + MPU-6050 IMU + wheel encoders — collects data about the environment and robot movement
  • Localization Layer: odometry from encoders, fused with the IMU gyroscope through a complementary filter — estimates the robot's position and orientation in space
  • Mapping Layer: 32x32 occupancy grid updated through Bresenham ray casting — builds the probabilistic obstacle map
  • Planning Layer: frontier-based exploration + PID on heading — decides the next destination and controls movement

Block Scheme

Processing Pipeline

At each 100ms cycle, the system executes sequentially:

  1. Read encoders -> calculate distance traveled per wheel
  2. Read IMU gyroscope -> heading correction through complementary filter
  3. Update odometry -> current position (x, y, theta) in space
  4. Servo scan 5 positions -> 5 ultrasonic distances -> 5 obstacle points in space
  5. Update occupancy grid -> ray casting for free cells + obstacle probability increment
  6. Frontier detection -> find nearest unexplored cell adjacent to free space
  7. PID heading -> direction correction calculation -> motor PWM
  8. LCD render -> updated 2D map + robot position + status
  9. UART ESP8266 -> compressed grid wireless transmission

Log

Week 5 - 11 May

Decided upon hardware components and designed a block scheme with the hardware architecture I will built.

Week 12 - 18 May

Asembled hardware components, tested each component (to verify its functionality) through simple tasks and finalized hardware implementation.

Week 19 - 25 May

Hardware

The robot is built on a 2WD chassis with two DC motors with Hall encoders for precise odometry. Three HC-SR04 ultrasonic sensors (front, left, right) mounted on an SG90 scanning servo provide obstacle detection. An MPU-6050 IMU handles heading correction, while two IR sensors detect floor edges. An ST7735 128x160 color LCD displays the live map, and an ESP8266 WiFi module streams data wirelessly to a PC. The system is powered by a 7.4V 2000mAh LiPo battery with an LM2596 voltage regulator.

Hardware

Schematics

Project Schematic

Bill of Materials

DeviceUsagePrice
STM32 Nucleo-U545RE-QMain microcontrollerprovided
2WD Robot ChassisPhysical robot structure30 RON
DC Motors with Hall Encoders x2Propulsion + precise odometry40 RON
L298N Motor DriverDual H-bridge motor control15 RON
HC-SR04 Ultrasonic Sensor x3Distance measurement front + left + right20 RON
SG90 Servo MotorFront sensor 180° rotation scanning15 RON
MPU-6050 IMUGyroscope heading + accelerometer15 RON
IR Sensors x2Floor edge / table edge detection10 RON
ST7735 LCD 128x160Live 2D map + robot status display20 RON
ESP8266 WiFi ModuleWireless map streaming to PC20 RON
RGB LEDs x4Visual robot state status8 RON
Passive BuzzerAudio feedback for events5 RON
LiPo Battery 7.4V 2000mAhAutonomous power supply (~45min)35 RON
LM2596 5V RegulatorVoltage step-down for logic10 RON
Capacitors 100uF x4Motor noise filtering5 RON
Breadboard + Jumper WiresPrototype circuit30 RON
Resistors + MiscProtection + connections8 RON

Software

LibraryDescriptionUsage
embassy-stm32Async HAL for STM32Used as the main async runtime and hardware abstraction layer for STM32U5
embassy-executorAsync executor without OSUsed for concurrent task scheduling (sensor, odometry, SLAM, display, WiFi tasks)
embassy-timePrecision timersUsed for microsecond-precision timing for sensor readings and task scheduling
embedded-graphics2D graphics libraryUsed for rendering the 2D occupancy grid map on the LCD
st7735-lcdDisplay driver for ST7735Used to drive the ST7735 128x160 color LCD via SPI
heaplessStatic data structuresUsed for Vec and Queue without heap allocation
libmMath functions in no_stdUsed for sin, cos, sqrt calculations in odometry and SLAM
  1. Embassy-rs Documentation
  2. Occupancy Grid Mapping - Wikipedia
  3. Frontier-Based Exploration
  4. Bresenham's Line Algorithm
  5. PID Controller