BACK TO PROJECTS
2025-09-12

Autonomous Fire-Extinguishing Turret

Dual-stage mechatronics fire suppression system with 180-degree IR scanning, fine backtrack flame targeting, submersible pump control, and Blynk IoT monitoring.

C++ESP32ESP32ServoFlame SensorRoboticsBlynkIoT
[ Source Code ]✓ VERIFIED STABLE
[ Target Hardware ]Microcontroller / Edge Node

The goal of this project was to build a self-contained, automated mechatronics turret capable of continuously patrolling an indoor perimeter, detecting the infrared optical signature of an open flame, aiming a high-pressure nozzle directly at the heat source, and suppressing it with a water jet without human intervention.

The physical build centers around an Espressif ESP32 controlling an SG90 micro-servo that sweeps a high-sensitivity analog infrared flame sensor and a 5V submersible DC water pump nozzle across a 180-degree horizontal arc. While the high-level logic sounds straightforward, getting analog optics to play nicely with mechanical actuators on a shared breadboard required solving several real physical hurdles.

The suppression algorithm operates in two coordinated phases:

  1. Coarse Search Sweep: The turret scans continuously across 0° to 180° in 5° intervals (SWEEP_STEP = 5). At each discrete step, the firmware pauses briefly for 40 milliseconds to let mechanical inertia dampen out—otherwise, the physical vibration of the servo bracket causes optical noise spikes in the analog photodiode readings.
  2. Fine Backtrack Targeting: The moment the normalized infrared intensity breaches the trigger threshold, the coarse sweep immediately halts. The servo reverses direction and steps in fine 1° increments (FINE_STEP = 1) across the target sector, sampling analog values to lock the nozzle directly onto the peak optical emission vector.
  3. Suppression & Failsafe Guard: Once targeted, the ESP32 drives a high-current transistor switch to power the submersible pump. To prevent accidental room flooding or pump motor burnout if the optical sensor is saturated by direct sunlight or a lingering ember, the firmware enforces a strict safety cutoff (PUMP_MAX_RUNTIME = 8000ms).

The biggest hardware headache was electrical noise and brownouts. The SG90 servo and water pump motor both produce massive inductive current spikes when starting under load. When I originally powered everything off the ESP32's 5V dev-board rail, the micro-controller suffered brownout resets (Brownout detector was triggered) the second the servo jerked into motion. I had to decouple the circuit into two isolated power rails—a dedicated 5V 2A regulator line for the motors and a smoothed rail for the ESP32 logic, bridged by a common ground and decoupling electrolytic capacitors.

The turret also bridges to the Blynk IoT cloud over 2.4 GHz Wi-Fi, providing an emergency manual killswitch, manual servo panning controls, and real-time infrared telemetry on a smartphone dashboard.