All projectsArtificial Intelligence & Robotics

AI-based Autonomous Firefighting Rover

Independently developed an AI-powered firefighting rover capable of detecting flames, navigating towards fire sources, positioning a servo-controlled water nozzle and extinguishing small flames autonomously. The system combines a fine-tuned YOLOv8 model, ESP32 motor control, multi-sensor verification and Wi-Fi communication. Developed as a freelance project, the prototype underwent over 1,000 reported testing and calibration iterations before successful delivery.

Artificial IntelligenceAutonomous RoboticsFire DetectionFirefighting RoverComputer VisionYOLOv8Object DetectionDeep LearningESP32PythonOpenCVUltralyticsEmbedded SystemsSensor FusionAutonomous NavigationWi-Fi CommunicationTCP SocketsRobotic ControlMotor ControlServo ControlWater SuppressionModel Fine-TuningRapid PrototypingSystem IntegrationFreelance Engineering
01

Project Background and Motivation

The AI-Based Autonomous Firefighting Rover was developed as an independent freelance engineering project focused on demonstrating how artificial intelligence and robotic systems can be combined to identify and suppress small fires without continuous human intervention. Development began on 31 December 2025, with the objective of creating a working educational prototype capable of detecting a flame, determining its location, navigating towards it and activating a water-based extinguishing mechanism. The project required the integration of computer vision, embedded electronics, mechanical design, wireless communication and intelligent decision-making into a single mobile platform. Conventional manually controlled firefighting robots require an operator to identify the target and navigate the vehicle to an appropriate position. This project explored an alternative approach in which a computer vision model could interpret camera information and automatically generate the commands required to perform a complete fire-engagement sequence. The rover was designed and developed at a home workshop for student clients as a freelance engagement. The work covered hardware assembly, electrical integration, firmware development, AI model training, Python application development, control logic, troubleshooting and final testing. The project also provided an opportunity to investigate the practical limitations of computer vision in physical robotic applications, including the effects of lighting conditions, camera perspective, distance estimation and mechanical actuator accuracy. The final objective was an affordable, functional proof-of-concept suitable for controlled demonstrations and engineering education rather than deployment in hazardous real-world firefighting environments.

02

Objectives and Functional Requirements

The primary objective was to create an autonomous mobile robot capable of completing a fire-detection and suppression sequence using visual intelligence and embedded control. The system needed to continuously monitor its surroundings through a camera, identify visible flames using an AI object detection model, determine the direction of the detected fire and issue movement commands to approach the target. A major requirement was ensuring that the rover stopped at an appropriate distance before activating the water pump. Because small flames can vary significantly in size and appearance, relying exclusively on image bounding-box dimensions was considered insufficient. The project therefore explored multiple methods of determining proximity, including camera calibration, visual positioning and infrared flame-sensor feedback. The robot also needed a controllable water-delivery system capable of directing a stream towards the identified target. A servo-actuated nozzle was selected to provide adjustable aiming, while a miniature DC pump and onboard water reservoir supplied the extinguishing mechanism. Additional requirements included wireless communication between the AI-processing computer and the ESP32, motor speed control, sensor integration, manual override for testing and a repeatable autonomous operating cycle. The design was constrained to small, visible flames in controlled indoor environments with smooth flooring and relatively predictable lighting. These limitations informed the choice of sensors, model architecture, movement behavior and suppression hardware.

03

Overall System Architecture

The firefighting rover uses a distributed control architecture consisting of an AI processing subsystem and an embedded hardware-control subsystem. The high-level intelligence operates on an external laptop running Python-based software. The laptop receives camera images, performs fire detection using a fine-tuned YOLOv8 model, estimates the target's direction and proximity, and determines the next action required by the robot. The low-level control system is based on an ESP32 microcontroller. It is responsible for receiving commands from the laptop, controlling the drive motors, positioning the servos, operating the water-pump relay and providing access to connected sensor readings. Communication between the laptop and ESP32 is established through Wi-Fi using TCP sockets. The ESP32 operates a network interface that allows the computer to transmit movement and actuator commands and receive relevant responses. This separation of responsibilities allows computationally demanding neural-network inference to be performed on a more capable computer while the ESP32 handles direct electrical control of the rover's physical components. The overall architecture integrates five major functional areas: visual perception, sensor monitoring, autonomous decision-making, locomotion control and fire suppression. The resulting system forms a complete perception–decision–action loop in which AI-generated information is translated into physical movement and extinguishing actions.

04

Mechanical Design, Chassis Construction and Redesign

The mechanical platform was developed using a four-wheel-drive rover structure designed to accommodate the electronics, sensing hardware and water-suppression components. The documented chassis uses a dual-layer acrylic arrangement, providing separate mounting areas for the drivetrain and electronic hardware. Four geared DC motors provide mobility, while the upper structure supports the ESP32, sensors and control electronics. The water-delivery subsystem is mounted towards the rear of the rover, incorporating a reservoir with an approximate capacity of 750 mL and a miniature pump. The arrangement provides a compact method of carrying the water supply while keeping the nozzle and sensing components accessible. A servo-mounted camera and ultrasonic sensor assembly enables adjustable sensing orientation. A separate servo supports directional positioning of the water nozzle so that the robot can align the water stream with the detected fire. Mechanical development was not limited to the original assembly. During testing, several limitations became apparent, particularly the relationship between camera positioning, target-distance estimation, nozzle alignment and the effective reach of the water stream. Approximately halfway through development, the rover underwent a substantial redesign to address these problems. Component placement, sensing arrangements, electrical integration and physical actuation were reconsidered to improve operational consistency. This redesign was an important stage in transforming the system from a collection of functioning components into a coordinated robotic platform capable of reliably completing the intended task.

05

Electronics, Embedded Control and Power Distribution

The rover's electronic architecture is centered on an ESP32 microcontroller, which interfaces with the motor driver, sensors, servos and pump-control relay. Four 12 V geared DC motors provide locomotion and are driven through an L298N motor driver. The ESP32 generates direction and PWM control signals, allowing the rover to move forward, reverse and execute differential-speed turns for alignment with a target. The sensing system includes a camera for AI vision, an infrared flame-detection subsystem and an HC-SR04 ultrasonic sensor for distance measurements. Three flame sensors were evaluated during development, with one central flame sensor used for confirmation in the final operating configuration. The suppression mechanism uses a 12 V miniature water pump controlled through a relay module. A servo motor adjusts the direction of the water nozzle, while another servo is used for the camera and ultrasonic sensing assembly. Electrical power is supplied by an approximately 12 V, 2600 mAh battery. An LM2596 DC-DC buck converter provides regulated low-voltage power for the ESP32 and associated electronics. Power distribution required particular attention during development. The ESP32 initially experienced unexpected resets, which interfered with wireless communication and interrupted operation. These problems were addressed through improvements to the power configuration and electrical integration. The final battery-powered system provided approximately 45 minutes of operating runtime, depending on the load imposed by movement, sensing and water-pump operation. The completed electronics subsystem allowed the ESP32 to act as a reliable execution controller for the commands generated by the external AI software.

06

AI Dataset Preparation and YOLOv8 Model Training

The fire-detection system was developed using a YOLOv8n object detection model, selected for its relatively lightweight architecture and suitability for real-time visual inference. A public fire-detection dataset containing approximately 27,000 images was used for model development. The dataset included annotated examples of flames under different visual conditions, including candle flames, lighter flames and larger visible fire sources. The images were represented using bounding-box annotations so that the model could learn to localize visible flames within an image rather than simply classify an entire image as containing fire or not containing fire. The training process used pretrained YOLOv8n weights as its initial model parameters. These weights were fine-tuned on the fire-detection dataset, allowing the network to specialize in recognizing flame-related visual patterns. Training was performed using the Ultralytics YOLO framework with Python and PyTorch. The recorded configuration used 50 training epochs, an input image resolution of 640 × 640 pixels and a batch size of 16. Model training was performed with GPU acceleration, and training outputs were recorded for subsequent evaluation. The final training records reported approximately 87.5% precision, 78.2% recall, 85.1% mean Average Precision at IoU 0.50 and 50.8% mean Average Precision across IoU thresholds from 0.50 to 0.95. These results were obtained from model validation data and provide an evaluation of object-detection performance rather than an overall measurement of the robot's physical fire-extinguishing success rate. The trained model was subsequently integrated into the live camera-processing application to support real-time flame detection and target localization.

07

Computer Vision, Fire Localisation and Sensor Fusion

Once the fire-detection model had been trained, the next challenge was translating visual detections into useful commands for robotic movement. During operation, the camera continuously supplies images to the Python-based vision system. When the YOLO model identifies a flame, its bounding-box coordinates are used to estimate the fire's position relative to the center of the camera frame. The horizontal position of the detection determines the required steering correction. A fire appearing towards the left or right of the image results in a corresponding movement adjustment, while a centered detection indicates that the rover is approximately aligned with the target. Estimating the distance to a flame proved more difficult. Initial experiments used the apparent dimensions of detected objects and a camera-calibration process to approximate target distance. However, visible flames vary in height, width and intensity, making bounding-box dimensions an imperfect basis for accurate ranging. To improve reliability, the development process combined camera-derived position and distance information with infrared flame-sensor confirmation. Visual overlap and the detected fire's position within the frame also contributed to determining whether the rover had approached sufficiently close to begin extinguishing. The final working system used this combined sensing approach to stop at an approximate distance of 18–25 cm, selected according to the effective reach of the water stream. The infrared sensor acted as an additional flame-confirmation input rather than replacing the AI detector. This helped ensure that pump activation decisions were informed by both camera-based detection and physical sensor feedback. The resulting perception system enabled the rover to localize small flames, maintain alignment while approaching and stop at a practical distance for water delivery.

08

Python Control Software and ESP32 Communication

The software system was developed using Python for AI inference and high-level decision-making, with Arduino C++ firmware running on the ESP32 for embedded execution. The computer-side application manages camera capture, object detection, target-position interpretation, autonomous state transitions and the generation of movement or suppression commands. The ESP32 implements a Wi-Fi TCP command interface through which the laptop communicates with the robot. The communication protocol supports commands for forward and reverse movement, directional turning, stopping, pump activation, pump deactivation, sensor readings and servo positioning. This architecture enables the laptop to make decisions based on visual and sensor information while the ESP32 performs the physical operations required to execute those decisions. The embedded firmware implements PWM-based drive-motor control, relay switching for the water pump and servo positioning for the sensing and nozzle assemblies. It also provides access to infrared and ultrasonic sensor information. The rover was designed with autonomous operation as its primary mode, while manual movement and testing controls were used during calibration and troubleshooting. Establishing reliable communication was essential because a loss of commands or interruption in the control loop could interfere with navigation or suppression. The modular separation between perception, decisions, communications and actuators made it possible to test different functions independently and refine individual subsystems without redesigning the complete application.

09

Autonomous Fire Detection, Approach and Extinguishing Workflow

The completed autonomous workflow begins with the robot monitoring its environment for visible fire sources. The camera feed is processed continuously by the YOLO detection model. When a valid flame is identified, the decision-making system determines the target's relative position and initiates the required movement commands. The rover adjusts its heading until the detected fire is sufficiently aligned with the forward direction of travel. It then approaches the target while updating its movement according to incoming camera observations and sensor information. As the rover gets closer, the system evaluates the estimated distance and infrared confirmation signal to determine whether the fire has entered the effective extinguishing range. Once the required proximity conditions are satisfied, the rover stops moving. The water-nozzle servo is positioned towards the detected flame, and the pump relay is activated to deliver water from the onboard reservoir. During suppression, the rover remains stationary to improve aiming consistency and prevent uncontrolled movement while water is being discharged. After the flame has been extinguished and is no longer detected, the software deactivates the pump and returns the system to its searching or monitoring state. The autonomous cycle can then repeat when another flame is detected. The completed prototype physically demonstrated all major stages of this process: AI-based fire detection, automatic approach, stopping, nozzle positioning, water discharge, successful extinguishing and return to the search state.

10

Experimental Obstacle Detection and Development Decisions

In addition to the primary fire-detection system, an obstacle-detection subsystem was investigated to explore the possibility of navigating around objects during autonomous operation. A separate YOLO object detection model was trained and evaluated for obstacle-related detection tasks. The system also incorporated an ultrasonic distance sensor capable of providing proximity measurements. The obstacle-detection model was tested independently from the fire-detection system. However, attempting to combine the obstacle-processing functionality with the primary firefighting workflow introduced inconsistencies in flame detection and the overall operating behavior. Rather than retaining a combined system that reduced the reliability of the main application, the decision was made to keep obstacle detection as a separate experimental subsystem. The completed autonomous firefighting demonstration therefore focused on detecting, approaching and extinguishing fire sources under controlled conditions. The separately tested obstacle model was not incorporated into the final integrated fire-engagement workflow. This distinction was an important engineering decision because reliable completion of the primary objective took priority over adding additional functionality that had not been sufficiently validated within the combined system. The obstacle-detection work remains a useful foundation for future research into multi-model perception, navigation and environmental awareness.

11

Engineering Challenges, Debugging and Iterative Redesign

The development process involved substantial practical challenges that required repeated changes to the system's hardware, perception logic and control architecture. One of the earliest difficulties was achieving consistent fire detection under changing visual conditions. Camera perspective, background lighting, flame shape and the size of the detected bounding box all influenced the stability of visual localization. Distance estimation was another major challenge. The initial camera-calibration approaches could produce inconsistent results because flames are dynamic objects whose apparent dimensions change during combustion. To address these issues, the perception logic was revised to combine visual positioning, estimated proximity and infrared sensor confirmation. The electronic subsystem also experienced power-related instability. The ESP32 could reset during operation, interrupting communication and preventing the robot from completing its autonomous sequence. Improvements to power regulation and electrical integration were required to achieve more reliable behavior. The water-suppression subsystem introduced further mechanical challenges. The initial water stream did not provide sufficient spread or effective reach for consistent flame extinguishing, requiring adjustments to nozzle positioning and the relationship between stopping distance and water delivery. A water-flow sensor was also evaluated during development. However, the selected component was not appropriately sized for the project's water-delivery arrangement and was removed from the final hardware configuration. Approximately midway through the project, the rover underwent a substantial redesign to address the combined mechanical, electrical and software limitations encountered during testing. From 20 January to 13 February 2026, the system underwent more than 1,000 reported testing and calibration iterations. These involved repeated checks and adjustments to detection, movement, sensor feedback, wireless communication and suppression behavior. This extensive iterative process was fundamental to achieving a functional autonomous system rather than a prototype capable of operating only under isolated ideal conditions.

12

Testing, Performance Evaluation and Final Validation

The final testing phase focused on validating both the AI model and the physical firefighting workflow. The computer vision model was evaluated using recorded validation metrics, with the final training results demonstrating approximately 87.5% precision, 78.2% recall and 85.1% mAP@50. These metrics establish the model's performance on the recorded validation dataset but do not independently determine the probability of successful fire detection in every real-world environment. The complete rover was separately evaluated through repeated physical experiments involving small open flames in controlled indoor conditions. Testing examined whether the robot could detect the fire, determine its direction, approach at an appropriate speed, stop within the effective water-delivery range, aim the nozzle and activate the pump successfully. The calibrated stopping distance was approximately 18–25 cm, depending on the water stream's practical reach and the detected flame's position. The rover also underwent repeated power and operational testing, with an approximate runtime of 45 minutes from its 12 V, 2600 mAh battery under the tested operating loads. Following extensive calibration and physical experimentation, the completed prototype successfully extinguished small flames during multiple demonstrations. The first fully functional demonstration was completed on 14 February 2026. The successful result validated the integrated perception, decision-making, embedded control and water-suppression architecture within the intended controlled environment. No formal field-deployment success rate or independently certified firefighting performance was established, and the platform was not intended for use in hazardous emergency-response environments.

13

Project Delivery, Recognition and Final Outcome

The AI-Based Autonomous Firefighting Rover was successfully completed as a freelance engineering project following approximately six weeks of development, experimentation and testing. The finished prototype demonstrated the full autonomous workflow required for the project: detecting a small flame using computer vision, navigating towards it, stopping at a calibrated distance, directing the water nozzle, extinguishing the flame and returning to the search state. The development involved independent responsibility for mechanical and electrical integration, ESP32 programming, AI model training, Python software implementation, computer vision, communication logic, testing and system troubleshooting. Following the successful demonstration on 14 February 2026, the project was handed over to the student clients for whom it had been developed. The recipient students subsequently received First Prize in their department's engineering competition at Technovate. The achievement reflected the successful use and presentation of the delivered robotic prototype. From an engineering perspective, the project's most valuable outcome was the successful integration of deep-learning-based perception with physical robotic actuation. The development process also demonstrated the importance of iterative testing and practical validation. Although the individual hardware components and AI model could be tested separately, achieving reliable autonomous operation required extensive calibration and refinement of their combined behavior. The project remains an example of successfully delivering a technically complex robotics solution through independent freelance development. Future improvements could include fully integrated obstacle avoidance, more accurate depth estimation, onboard AI computation, automated water-level monitoring, improved pump control and additional safety monitoring. The completed system serves as a practical educational demonstration of intelligent robotics, machine vision and autonomous physical response in a controlled environment.