π₯ Edge-Optimized Firefighting Robot: Autonomous Navigation via PID Control and Fire Detection with FOMO Vision
This project presents the design and implementation of Fire-Bot, an image processing-based autonomous firefighting robot. The system addresses the complex challenge of real-time fire detection and response using a low-powered microcontroller, onboard stereoscopic cameras, PID-controlled motion, and integrated IMU feedback for precise mobility. The solution brings together machine learning, control systems, real-time image processing, and robotics in a single cohesive system.
- Real-Time Fire Detection using an optimized ML model deployed on a 248kB microcontroller.
- Autonomous Navigation with discrete-time PID control coded from scratch.
- Stereoscopic Distance Estimation using dual ESP32-CAMs with custom frame synchronization.
- IMU Feedback Integration using MPU6050 DMP for orientation correction.
- Custom Communication Protocol for transmitting image data with structured identifiers (camera ID + frame number).
- Efficient deployment of FOMO (Fast Object Detection Model) on edge hardware.
Fire-Bot/
βββ report/
β βββ Fire-Bot_Project_Report.pdf # Contains detailed documentation, methodology, and experimental analysis
βββ source code/
βββ Camera/
β βββ esp32_camera_one/
β β βββ camera_one_code.ino # ESP32-CAM node 1 with object detection
β βββ esp32_camera_two/
β β βββ camera_two_code.ino # ESP32-CAM node 2 with stereo calibration
β βββ src/
β βββ fire_detection_fomo.tflite # Optimized TFLite ML model for fire detection
βββ Rover/
β βββ Rover.ino # Main rover code: diff drive + stereo camera manager + IMU PID feedback
β βββ pins_me.h # Pin mapping and hardware definitions
- Model: FOMO (Fast Object Detection Model)
- Optimized and quantized for deployment on ESP32-CAM (approx. 248kB footprint)
- Detects fire/flame regions in real-time under diverse lighting conditions
- 2 Γ ESP32-CAM modules for stereoscopic imaging
- MPU6050 with DMP support for orientation data
- Custom-built Differential Drive Rover with geared motors
- Power-efficient ESP-32 Dev microcontroller (no external GPU/CPU needed)
- A discrete-time PID controller built from scratch
- Corrects for orientation drift using MPU6050 DMP data
- Ensures stable and accurate movement towards detected fire source
- Custom image frame packet includes:
Camera IDFrame Number
- Data transmitted over ESP-Now Data Transmission Protocol
- Stereo vision logic aligns frames from both cameras to estimate fire distance
-
Flash ESP32-CAMs:
- Upload
esp32_camera_oneto one ESP32-CAM - Upload
esp32_camera_twoto the second ESP32-CAM
- Upload
-
Flash the Rover:
- Upload
Rover.inoto the rover's MCU - Ensure correct IMU pin mapping via
pins_me.h
- Upload
-
Connect Hardware:
- Mount and align cameras for stereoscopic vision
- Power up the system
-
Test & Debug:
- Use Serial Monitor to view distance estimates and PID outputs
- Tune PID gains as needed
Feel free to open issues or contribute to the codebase!
git clone https://github.com/AbrarMahmud/Ai_FireBot.git

