Skip to main content
Version: FILS English

RustRescue

An autonomous firetruck robot that detects fire and puts it out.

info

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 and the HC-SR04 ultrasonic sensor via GPIO, and from the MQ-2 smoke sensor via ADC. 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.

img

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.

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 ADC 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 2N2222 NPN transistor 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

Place your KiCAD or similar schematics here in SVG format.

Bill of Materials

DeviceUsagePrice
STM32 Nucleo-U545RE-QThe microcontroller106.59 RON
IR Flame Sensor (×3)Detects fire direction (left, front, right)7.47 RON
MQ-2 Smoke SensorDetects smoke15.67 RON
HC-SR04 Ultrasonic SensorMeasures distance to obstacles14.99 RON
OLED Display SSD1306Displays system state in real time13.34 RON
LM2596 Step Down DC-DC Power Supply ModuleConverts battery voltage to 5V12.99 RON
BO Motors + Wheels (×4)Robot locomotion62.56 RON
L298N Motor DriverControls the DC motors10.35 RON
5V DC Water Pump + pipeExtinguishes the fire14.83 RON
[Water tank / bottle]Water reservoir for the pump[N/A]
Passive BuzzerEmits siren sound1.34 RON
Red LED (×2)Emergency flashing lights0.60 RON
Transistor NPN 2n2222Switches the water pump circuit0.17 RON
100nF CapacitorFilters noise from the water pump0.24 RON
1KΩ ResistorLimits current to transistor base0.10 RON
330Ω Resistor (×2)Limits current to LEDs0.20 RON
BreadboardPrototyping connections19.47 RON
Jumper wiresElectrical connections5.95 RON
18650 Battery (×2)Power source20.00 RON
Battery holderHolds the 18650 batteries3.99 RON

Software

LibraryDescriptionUsage
embassy-executorAsync task executorRuns concurrent tasks on the microcontroller
embassy-stm32STM32 hardware abstractionGPIO, PWM, ADC, I2C, timers for STM32U545
embassy-timeAsync time utilitiesDelays and timeouts
embassy-syncSynchronization primitivesCommunication between tasks
ssd1306OLED display driverDrives the SSD1306 display over I2C
embedded-halHardware abstraction traitsInterface for peripherals
embedded-hal-asyncAsync hardware abstraction traitsAsync interface for peripherals
defmt + defmt-rttDebug loggingLightweight logging over RTT
panic-probePanic handlerPanic handler with defmt output
heaplessFixed-size data structuresString formatting for OLED display
  1. The Rust Programming Language
  2. The Embedded Rust Book
  3. Embassy-rs Documentation
  4. STM32 datasheet
  5. Electric RC Car - Basic Concepts
  6. Hardware inspiration