Skip to content

Implement the vision model in a memory-constrained environment (ESP-32 board) and integrate it with its differential drive-based platform.

Notifications You must be signed in to change notification settings

AbrarMahmud/Ai_FireBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ 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.


github-small

πŸš€ Project Highlights

  • 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.

github-small

πŸ“‚ Repository Structure

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

🧠 Machine Learning Model

  • 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

βš™οΈ Hardware Used

  • 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)

πŸ”„ Control System

  • 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

πŸ§ͺ Data Handling & Communication

  • Custom image frame packet includes:
    • Camera ID
    • Frame Number
  • Data transmitted over ESP-Now Data Transmission Protocol
  • Stereo vision logic aligns frames from both cameras to estimate fire distance

πŸ“š How to Run

Steps

  1. Flash ESP32-CAMs:

    • Upload esp32_camera_one to one ESP32-CAM
    • Upload esp32_camera_two to the second ESP32-CAM
  2. Flash the Rover:

    • Upload Rover.ino to the rover's MCU
    • Ensure correct IMU pin mapping via pins_me.h
  3. Connect Hardware:

    • Mount and align cameras for stereoscopic vision
    • Power up the system
  4. Test & Debug:

    • Use Serial Monitor to view distance estimates and PID outputs
    • Tune PID gains as needed

🀝 Contributing

Feel free to open issues or contribute to the codebase!

git clone https://github.com/AbrarMahmud/Ai_FireBot.git


About

Implement the vision model in a memory-constrained environment (ESP-32 board) and integrate it with its differential drive-based platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages