
ESP32
IoT-Based Fire Detection and Fire Fighting System Using ESP32
Abstract:
The IoT-Based Fire Detection and Fire Fighting System uses an ESP32, flame sensor, smoke sensor, water pump, and servo motor to detect fire conditions and demonstrate automatic water spraying. The system monitors flame and smoke levels, activates alerts, and controls the pump and servo when fire is detected. Wi-Fi connectivity enables remote monitoring through a compatible web dashboard.
Project Description:
The ESP32 acts as the main controller and receives information from the flame and MQ-2 smoke sensors. When the sensor readings indicate a possible fire condition, the controller activates a buzzer or alert indicator, switches on the water pump through a relay or MOSFET driver, and moves the servo motor to direct the water nozzle towards the detected area. The system can transmit sensor readings, fire status, and pump activity to a web dashboard using Wi-Fi. This project demonstrates how IoT and embedded systems can be used for automatic fire detection and a small-scale firefighting demonstration.
Working Principle:
1. The flame sensor detects infrared radiation from a flame.
2. The MQ-2 sensor detects smoke and certain combustible gases.
3. The ESP32 processes sensor readings and checks predefined thresholds.
4. When a fire condition is detected, the system activates an alert.
5. The ESP32 switches on the water pump through a suitable driver.
6. The servo motor adjusts the nozzle direction.
7. Water is sprayed towards the demonstration target.
8. Fire status and system activity are transmitted to a web dashboard through Wi-Fi.
Notes:
1. Use an ESP32 DevKit V1 as the main controller.
2. Use a flame sensor to detect fire.
3. Use an MQ-2 sensor for smoke and combustible gas detection.
4. Use an SG90 servo motor to control the water nozzle direction.
5. Use a suitable DC water pump for the demonstration.
6. Use a relay module or MOSFET driver to control the pump.
7. Never power the pump directly from an ESP32 GPIO pin.
8. Use a separate regulated power supply suitable for the pump.
9. Provide a suitable power supply for the servo motor.
10. Connect common grounds where required by the driver circuit.
11. Check sensor output voltages before connecting them to ESP32 ADC pins.
12. Use a voltage divider if a sensor output exceeds 3.3V.
13. Adjust flame and smoke detection thresholds according to the environment.
14. Use suitable tubing and a lightweight nozzle for the servo mechanism.
15. Keep water containers and plumbing away from exposed electronic circuits.
16. Configure Wi-Fi and a compatible web dashboard for remote alerts.
17. Test sensors, servo movement, and pump operation separately before integration.
18. This is an educational prototype. Never use water on electrical or live electrical fires; use appropriate fire safety procedures and emergency services.
19. Do not treat this prototype as a replacement for certified fire alarms or professional firefighting equipment.
Expected Outcome:
The completed prototype will detect flame and smoke, activate an alert, control a water pump, and adjust the spray direction using a servo motor. It will also demonstrate remote fire-status monitoring through an IoT dashboard.
All Projects




