🤖 AI-Based Intelligent Fire Fighting Robot
ESP32 + AI Vision + IoT + n8n Automation + Telegram Alerts
🔥 Project Overview
This project is an AI-powered autonomous fire-fighting robot using ESP32, sensors, cloud IoT platforms, and automation tools like n8n. It detects fire, takes action, and sends real-time alerts via Telegram and cloud dashboards.
🔩 Components List
- ESP32 Dev Board
- Flame Sensor
- MQ-2 Gas Sensor
- DHT11 Temperature Sensor
- Ultrasonic Sensor
- L298N Motor Driver
- Water Pump + Relay
- Chassis + Wheels
🧠 System Architecture
Sensors → ESP32 → WiFi → n8n Server
↓
Telegram Alerts | Google Sheets | ThingSpeak Dashboard
🔁 System Flow
Start
↓
Read Sensors
↓
Fire Detected?
↓ YES → Activate Pump + Buzzer
↓
Send Data to n8n
↓
AI Analysis + Alerts + Cloud Logging
💻 ESP32 Source Code
#include <WiFi.h>
#include <HTTPClient.h>
#include "DHT.h"
#define FLAME 34
#define MQ2 35
#define PUMP 32
#define BUZZER 13
void setup() {
Serial.begin(115200);
pinMode(FLAME, INPUT);
pinMode(MQ2, INPUT);
pinMode(PUMP, OUTPUT);
pinMode(BUZZER, OUTPUT);
}
void loop() {
int flame = analogRead(FLAME);
int gas = analogRead(MQ2);
if(flame < 2000 || gas > 400) {
digitalWrite(PUMP, HIGH);
digitalWrite(BUZZER, HIGH);
} else {
digitalWrite(PUMP, LOW);
digitalWrite(BUZZER, LOW);
}
delay(1000);
}
⚙️ n8n Workflow Logic
Webhook Trigger → AI Risk Analysis → Telegram Alert → Google Sheets → ThingSpeak Update
📱 Telegram Alerts
Real-time fire alerts are sent using Telegram Bot API integrated with n8n automation.
📊 Google Sheets Logging
Sensor data (temperature, gas, flame, risk level) is stored in cloud spreadsheets for analysis.
📡 ThingSpeak Dashboard
Live IoT visualization of sensor values using cloud dashboards.
🧠 AI Logic
IF temperature > 50 OR gas high:
Risk = HIGH
ELSE:
Risk = LOW
🚀 Future Enhancements
- AI Vision using ESP32-CAM
- YOLO Fire Detection Model
- Autonomous Navigation (SLAM)
- Cloud AI Decision Making

No comments:
Post a Comment