Autonomous Vehicle with Dynamic Path Replanning
An autonomous robotic system capable of navigating along a predefined path and dynamically adapting its route in real time to avoid obstacles.
Author: ariana.pelcaru
GitHub Project Link : https://github.com/UPB-PMRust-Students/acs-project-2026-aryuqq
Description
The Autonomous Vehicle with Dynamic Path Reconfiguration demonstrates intelligent navigation in environments with unpredictable obstacles. Under normal conditions, it follows a predefined path using embedded control logic.
The vehicle continuously monitors its surroundings with distance sensors to detect obstacles in real time. When an obstacle is detected, the system analyzes the data, recalculates an alternative route, and adjusts its movement to safely avoid collisions while continuing toward its destination.
Motivation
Autonomous vehicles have the potential to significantly improve safety and efficiency in real-world transportation systems. Human error remains one of the main causes of accidents, especially in dynamic and unpredictable environments where quick reactions are required. This project was inspired by the idea of reducing such risks by enabling a system that can perceive obstacles and react instantly without human intervention.
Architecture
The main architectural components of the autonomous vehicle system are:
-
STM32 Main Controller (Nucleo Board) – central processing unit that runs the real-time control loop, handles sensor input, decision-making, and actuator control for navigation.
-
Ultrasonic Sensor (HC-SR04) – used for real-time obstacle detection in front of the robot; triggers avoidance logic when distance is below a defined threshold.
-
Motor Driver (L298N) + DC Motors – provides bidirectional control of the drive system, allowing forward movement, reverse motion, and turning maneuvers based on navigation decisions.
-
Servo Motor (Steering/Scanning System) – controls directional scanning of the environment, enabling the system to evaluate left/right paths when obstacles are detected.
-
ST7735 TFT Display – visual output module used to render the robot’s map, movement trail, obstacle positions, and system status messages in real time.
-
Buzzer (Audio Alert System) – provides immediate acoustic feedback when an obstacle is detected or when avoidance behavior is triggered.
-
Power Supply (Battery Pack) – ensures autonomous operation of the system by powering all modules, including motors, sensors, and microcontroller.

Project Photos



Log
Week 20-26 Apr
- This week, I focused on defining the overall architecture of the autonomous vehicle project based on STM32. I worked on shaping the main system modules (sensing, control, actuation, and user interface) and clarified how they interact in a real-time embedded system.
- I also worked on the project documentation, writing the initial structure and describing the main functionalities and expected system behavior.
- In addition, I made a first draft of the required components (HC-SR04 sensor, L298N motor driver, DC motors, servo motors) and researched their roles in the system.
- Connected the Hardware
- Tested the sensors
Week 11-17 May
- This week, I started the software development for the autonomous vehicle, implementing the main control logic
- I also improved the hardware structure by redesigning the connections and layout to ensure better compatibility and stable operation of all components together.
Week 19 - 27 May
- Completed the software implementation
- Completed the final design
- Finalized the documentation
Hardware
- Microcontroller: STM32 Nucleo Board
- Sensor: HC-SR04 Ultrasonic Sensor
- Actuators: DC Motors, Servo Motor
- Motor Driver: L298N Motor Driver
- Display: ST7735 LCD Display
- Input: ON/OFF Button
- Other: Breadboard, jumper wires, battery pack, Buzzer
Software Design
Description
1. Design Patterns:
- Controller / Manager pattern (Motor control, Display manager, Sensor handler)
- State machine navigation logic for autonomous obstacle avoidance
- Circular buffer processing for movement trail visualization
- Event-driven asynchronous execution using Embassy runtime
2. Key Features:
- Autonomous obstacle detection and avoidance using ultrasonic distance sensing
- Real-time navigation decision making with left/right path evaluation
- Graphical map visualization with robot tracking and obstacle marking
- Servo-based environmental scanning for route analysis
- PWM motor speed and steering control
- Audio warning system using buzzer feedback on obstacle detection
- Continuous position tracking with trail fading effect
Bill of Materials
Hardware
Software
| Library | Description | Usage |
|---|---|---|
| embassy-executor | Async runtime for embedded systems | Handles concurrent task execution for sensor reading, obstacle detection, motor control, and display updates |
| embassy-time | Embedded timing utilities | Manages delays for ultrasonic measurements, motor timing, servo positioning, and display refresh cycles |
| embassy-stm32 | STM32 Hardware Abstraction Layer | Provides access to GPIO, PWM timers, SPI communication, and peripheral initialization |
| embassy-stm32::gpio | GPIO control module | Controls motor driver pins, trigger signal, buzzer output, and reads ultrasonic echo input |
| embassy-stm32::spi | SPI communication interface | Drives communication with the ST7735 display |
| embassy-stm32::timer::simple_pwm | PWM timer control | Generates PWM signals for DC motor speed control and servo positioning |
| embedded-hal | Embedded hardware abstraction traits | Standardized peripheral access across drivers |
| embedded-hal-bus | Shared bus abstraction | Provides exclusive SPI device access for display communication |
| mipidsi | TFT display driver | Controls the ST7735s display initialization and rendering |
| embedded-graphics | 2D graphics rendering library | Draws robot map, obstacle markers, movement trail, countdown screen, and interface graphics |
| defmt | Lightweight embedded logging framework | Logs robot state, distance measurements, obstacle detection, and navigation decisions |
| defmt-rtt | RTT transport for defmt logs | Sends debugging information to host during execution |
| panic-probe | Panic handler for embedded debugging | Reports runtime crashes and diagnostic errors during development |