RustRescue
An autonomous firetruck robot that detects fire and puts it out.
Author: Ioniță Carmen Ana-Maria
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-carmen020305#
Description
RustRescue is a small autonomous robot designed to detect and extinguish fires without human intervention. It is built around the STM32 NUCLEO-U545RE-Q microcontroller and programmed in Rust using the embassy-rs framework. The firetruck continuously monitors its surroundings using three flame sensors and one smoke sensor. When a flame or smoke is detected, the robot determines the direction of the threat and steers toward it while activating a siren and flashing LEDs, autonomously avoiding any obstacles in its path using an ultrasonic distance sensor. A display shows the current state of the system in real time. Once close enough to the fire, it stops and activates a small water pump to put it out. When the flame is no longer detected, the pump, siren, and LEDs turn off automatically. Then the robot will continue to look for another fire.
Motivation
The inspiration behind this project is my father, who is a firefighter. Knowing that he puts his life in danger every time he goes to work made me think about ways technology could help. While a small robot cannot replace a firefighter, it could serve as a first responder in situations involving small or early-stage fires, acting quickly before the situation escalates and reducing the need for human intervention in dangerous environments.
Architecture
The STM32 Nucleo-U545RE-Q is the central component of the system. It reads data from three flame sensors, the MQ-2 smoke sensor and the HC-SR04 ultrasonic sensor via GPIO. Based on this input, it controls the L298N motor driver and the water pump via GPIO, the buzzer via PWM, and the OLED display via I2C. The entire system is powered by two 18650 batteries (7.4V), with a buck converter (LM2596) stepping the voltage down to 5V for the microcontroller and sensors.
Log
Week 13 - 19 April
The STM32 NUCLEO-U545RE-Q and the first batch of components arrived. After checking what was missing, placed another order for the remaining parts.
Week 20 - 26 April
Started putting the project documentation together. Created the architecture diagram showing how all the components connect to the microcontroller. Also began working on the KiCad schematic.
Week 27 April - 3 May
Received the last order of components and finished the KiCad schematic.
Week 4 - 10 May
Started working on hardware.
Week 11 - 17 May
Started working on the firmware. Set up the Embassy project and tested the flame sensors and the smoke sensor.
Week 18 - 24 May
Worked on hardware assembly. Wired up the power system and the water pump transistor circuit. Replaced the motors. Continued firmware development, adding support for the ultrasonic sensor and the OLED display.
Week 25 - 28 May
Continued hardware assembly. Worked on mounting the components on the chassis and replaced the transistor circuit with a relay module for controlling the water pump. Made further progress on the firmware.

Hardware
The hardware is built around the STM32 NUCLEO-U545RE-Q microcontroller, which connects to all the other components. Three IR flame sensors and an HC-SR04 ultrasonic sensor are wired via GPIO, the flame sensors to detect where the fire is coming from, and the ultrasonic sensor to avoid obstacles along the way. The MQ-2 smoke sensor connects via GPIO to detect smoke in the surroundings. For movement, four BO motors are controlled through an L298N motor driver using PWM signals. A passive buzzer produces a siren sound via PWM, and two red LEDs are used as visual alerts via GPIO. The SSD1306 OLED display communicates over I2C and shows the current system state of the robot in real time. The water pump is switched on and off through a relay module driven by a GPIO pin. The entire system is powered by two 18650 batteries in series (7.4V), brought down to 5V by an LM2596 buck converter.
Schematics
Bill of Materials
Software
| Library | Description | Usage |
|---|---|---|
| embassy-executor | Async task executor | Runs concurrent tasks on the microcontroller |
| embassy-stm32 | STM32 hardware abstraction | GPIO, PWM, ADC, I2C, timers for STM32U545 |
| embassy-time | Async time utilities | Delays and timeouts |
| embassy-sync | Synchronization primitives | Communication between tasks |
| ssd1306 | OLED display driver | Drives the SSD1306 display over I2C |
| embedded-graphics | 2D graphics library | Used for rendering text on the OLED display |
| embedded-hal-async | Async hardware abstraction traits | Async interface for peripherals |
| defmt + defmt-rtt | Debug logging | Lightweight logging over RTT |
| panic-probe | Panic handler | Panic handler with defmt output |
| heapless | Fixed-size data structures | String formatting for OLED display |