Thursday, 11 June 2026

Agentic AI Climate Monitoring and Smart Environmental Decision System with Telegram Voice Assistant

Agentic AI Climate Monitoring and Smart Environmental Decision System ESP32 + Sensors + AI Agent + n8n Automation + Telegram Voice Assistant + Google Sheets + ThingSpeak Cloud Dashboard
<?php echo $title; ?>

Agentic AI Climate Monitoring and Smart Environmental Decision System

Project Overview

This project combines ESP32, IoT sensors, AI decision-making, n8n automation, Telegram voice notifications, Google Sheets logging, and ThingSpeak cloud analytics.

System Architecture

Sensors
   |
   V
ESP32
   |
WiFi
   |
+-------------+
| ThingSpeak  |
+-------------+
       |
       V
+-------------+
| n8n AI      |
+-------------+
       |
+------+------+
|             |
V             V
Google     Telegram
Sheets     Voice Alerts

Hardware Components

Component Quantity
ESP32 Dev Board 1
DHT22 Sensor 1
MQ135 Gas Sensor 1
LDR Sensor 1
Soil Moisture Sensor 1

Circuit Connections

DHT22
VCC  -> 3.3V
GND  -> GND
DATA -> GPIO4

MQ135
AO   -> GPIO34

LDR
OUT  -> GPIO35

Soil Moisture
AO   -> GPIO32

Flowchart

Start
 |
Initialize ESP32
 |
Connect WiFi
 |
Read Sensors
 |
Send to ThingSpeak
 |
Trigger n8n
 |
AI Analysis
 |
Google Sheets
 |
Telegram Alert
 |
Voice Notification
 |
Repeat

ESP32 Source Code

#include <WiFi.h>
#include <HTTPClient.h>
#include "DHT.h"

#define DHTPIN 4
#define DHTTYPE DHT22

DHT dht(DHTPIN,DHTTYPE);

void setup()
{
  Serial.begin(115200);
  dht.begin();
}

void loop()
{
  float temp=dht.readTemperature();
  float hum=dht.readHumidity();

  int air=analogRead(34);
  int light=analogRead(35);
  int soil=analogRead(32);

  // Upload data

  delay(30000);
}

ThingSpeak Integration

1. Create ThingSpeak Account
2. Create Channel
3. Add Fields
4. Copy API Key
5. Insert API Key in ESP32 Code

Google Sheets Integration

Timestamp Temperature Humidity Air Quality Light Soil Moisture Status

n8n Workflow

Webhook
  |
Function
  |
Google Sheets
  |
AI Analysis
  |
Telegram Alert
  |
Voice Message

AI Decision Logic

Temperature > 40°C
  => Heat Alert

Humidity < 25%
  => Dry Alert

Air Quality > 2500
  => Pollution Alert

Soil Moisture < 800
  => Irrigation Required

Power Consumption Prediction

Power =
(Fan Hours × 75W)
+
(Pump Hours × 120W)
+
(Light Hours × 20W)

Telegram Voice Alerts

The AI Agent generates text alerts and converts them to speech using TTS services such as OpenAI TTS, Google TTS, or ElevenLabs. The generated MP3 file is automatically sent to Telegram.

Future Enhancements

  • Machine Learning Forecasting
  • Automatic Irrigation Control
  • Smart Greenhouse Automation
  • LoRaWAN Support
  • Multi-language Voice Assistant

Deployment

Deploy n8n using Docker, AWS, Google Cloud, or Azure. ESP32 continuously streams sensor data to cloud services.

For a complete project submission, I would recommend splitting it into: /project │ ├── index.php ├── dashboard.php ├── config.php ├── esp32_code.ino ├── n8n_workflow.json ├── assets/ │ ├── style.css │ ├── flowchart.png │ ├── circuit_diagram.png │ ├── docs/ │ ├── project_report.pdf │ ├── user_manual.pdf │ └── database/ └── climate_monitor.sql This structure looks professional for final-year engineering, IoT, AI, and smart agriculture project submissions.

AI Agent Air Quality Intelligence Platform with Automated Voice Alerts and Predictive Pollution Analysis

AI Agent Air Quality Intelligence Platform ESP32 + Air Quality Sensors + n8n Automation + AI Agent + Telegram Voice Alerts + Google Sheets + ThingSpeak Dashboard
<?php echo $title; ?>

AI Agent Air Quality Intelligence Platform

ESP32 + AI Agent + n8n + Telegram Voice Alerts + Google Sheets + ThingSpeak

Project Overview

This project develops an AI-powered Air Quality Monitoring System using ESP32, MQ135 Air Quality Sensor, DHT22, ThingSpeak Cloud, n8n Automation, Telegram Voice Alerts, Google Sheets Logging, and Predictive Analytics.

  • Real-Time Air Quality Monitoring
  • Cloud Dashboard Visualization
  • AI-Based Pollution Prediction
  • Telegram Voice Notifications
  • Google Sheets Data Logging
  • Agentic Decision Making

System Architecture

MQ135 + DHT22
       |
       V
     ESP32
       |
       V
    WiFi Cloud
       |
       V
   ThingSpeak
       |
       V
       n8n
   /    |    \
Sheets Telegram AI
            |
            V
      Voice Alerts

Components List

Component Quantity
ESP321
MQ135 Sensor1
DHT22 Sensor1
OLED Display1
Breadboard1
Jumper Wires20
WiFi Router1

Circuit Connections

MQ135

VCC  -> 5V
GND  -> GND
AOUT -> GPIO34

DHT22

VCC  -> 3.3V
GND  -> GND
DATA -> GPIO4

OLED

VCC -> 3.3V
GND -> GND
SDA -> GPIO21
SCL -> GPIO22

Flowchart

Start
 |
Initialize ESP32
 |
Connect WiFi
 |
Read Sensors
 |
Calculate AQI
 |
Upload to ThingSpeak
 |
Trigger n8n
 |
AI Analysis
 |
High Pollution?
 / \
Yes No
 |   |
Send Alert
 |
Voice Notification
 |
Store in Google Sheets
 |
Loop

AQI Classification

AQI Status
0-50Good
51-100Moderate
101-150Unhealthy for Sensitive Groups
151-200Unhealthy
201-300Very Unhealthy
301+Hazardous

ESP32 Sample Code

#include <WiFi.h>
#include <HTTPClient.h>

const char* ssid="YOUR_WIFI";
const char* password="YOUR_PASSWORD";

void setup()
{
 Serial.begin(115200);

 WiFi.begin(ssid,password);

 while(WiFi.status()!=WL_CONNECTED)
 {
   delay(500);
 }
}

void loop()
{
 int airValue=analogRead(34);

 HTTPClient http;

 String url=
 "https://api.thingspeak.com/update?api_key=KEY"
 "&field1="+String(airValue);

 http.begin(url);
 http.GET();
 http.end();

 delay(60000);
}

ThingSpeak Setup

  1. Create ThingSpeak Account
  2. Create New Channel
  3. Add AQI Field
  4. Copy Write API Key
  5. Paste into ESP32 Code

Telegram Bot Setup

  1. Open Telegram
  2. Search BotFather
  3. Create New Bot
  4. Copy Bot Token
  5. Get Chat ID
  6. Configure in n8n

n8n Workflow

Webhook
  |
IF AQI > 150
  |
OpenAI Analysis
  |
Google Sheets
  |
Telegram Alert
  |
Text-to-Speech
  |
Telegram Voice Message

AI Prediction Logic

Moving Average

Predicted AQI =
(AQI1+AQI2+AQI3+AQI4+AQI5)/5

Linear Regression

AQI = m*x + c

Advanced AI Models

  • Random Forest
  • XGBoost
  • LSTM
  • Time Series Forecasting

Voice Notification Message

Warning!

Air quality is unhealthy.

Current AQI: 185

Predicted AQI: 230

Avoid outdoor activities.

Google Sheets Columns

Timestamp AQI Temperature Humidity Prediction Status

Future Enhancements

  • Machine Learning Forecasting
  • Solar-Powered ESP32
  • LoRaWAN Communication
  • Mobile Application
  • GIS Air Pollution Maps
  • Industrial Deployment
  • Smart City Integration

Estimated Cost

Item Cost (₹)
ESP32500
MQ135250
DHT22250
OLED250
Accessories200
Total 1450
For a professional final-year project, you could further split this into: index.php (dashboard) esp32_code.php thingspeak_setup.php telegram_setup.php n8n_workflow.php ai_prediction.php deployment_guide.php and add Bootstrap, charts, login authentication, live ThingSpeak data fetching, and downloadable PDF documentation.

Agentic AI Smart Grid Load Analytics and Real-Time Energy Optimization System Using ESP32

Agentic AI Smart Grid Load Analytics and Real-Time Energy Optimization System Using ESP32, n8n, Telegram Voice Alerts, Google Sheets & ThingSpeak
<?php echo $title; ?>

Agentic AI Smart Grid Load Analytics

ESP32 + n8n + AI Agent + Telegram Voice Alerts + Google Sheets + ThingSpeak

1. Project Overview

This project provides a real-time smart grid energy monitoring and optimization system using ESP32, AI-powered analytics, n8n workflow automation, Telegram alerts, Google Sheets logging, and ThingSpeak cloud visualization.

2. System Architecture

Smart Sensors
      |
      V
    ESP32
      |
      V
     n8n
      |
 ------------------
 |       |        |
 V       V        V
AI   Google   ThingSpeak
Agent Sheets Dashboard
 |
 V
Telegram Alerts

3. Components List

Component Quantity
ESP32 Dev Board1
ACS712 Current Sensor1
ZMPT101B Voltage Sensor1
Relay Module1
OLED Display1
WiFi Router1
Power Supply1

4. Circuit Connections

Module ESP32 Pin
ACS712 OUTGPIO34
ZMPT101B OUTGPIO35
OLED SDAGPIO21
OLED SCLGPIO22
Relay INGPIO26

5. Flowchart

START
 |
ESP32 Initialization
 |
Connect WiFi
 |
Read Sensors
 |
Calculate Power
 |
Send Data to n8n
 |
AI Analysis
 |
Load High?
 /     \
Yes     No
 |       |
Alert  Continue
 |
Voice Alert
 |
Relay Control
 |
Repeat

6. Power Calculation

Power = Voltage × Current

7. ESP32 Arduino Source Code

#include <WiFi.h>
#include <HTTPClient.h>

const char* ssid="YOUR_WIFI";
const char* password="YOUR_PASSWORD";

String webhookURL=
"https://your-n8n-domain/webhook/energy";

void setup()
{
 Serial.begin(115200);

 WiFi.begin(ssid,password);

 while(WiFi.status()!=WL_CONNECTED)
 {
   delay(500);
 }
}

void loop()
{
 float voltage=220;
 float current=5;

 float power=voltage*current;

 HTTPClient http;

 http.begin(webhookURL);

 http.addHeader(
 "Content-Type",
 "application/json"
 );

 String payload=
 "{";

 payload += "\"voltage\":220,";
 payload += "\"current\":5,";
 payload += "\"power\":1100";

 payload += "}";

 http.POST(payload);

 http.end();

 delay(15000);
}

8. n8n Workflow

Workflow Sequence:

  1. Webhook Node
  2. Function Node
  3. AI Agent Node
  4. IF Condition
  5. Telegram Node
  6. Google Sheets Node
  7. ThingSpeak Update Node

9. Telegram Bot Setup

  1. Open Telegram
  2. Search BotFather
  3. Create new bot using /newbot
  4. Copy Bot Token
  5. Get Chat ID
  6. Configure in n8n

10. Google Sheets Integration

Timestamp Voltage Current Power Prediction Status
2026-06-12 230 4.2 966 1050 Normal

11. ThingSpeak Dashboard Fields

  • Field1 = Voltage
  • Field2 = Current
  • Field3 = Power
  • Field4 = Prediction

12. AI Prediction Logic

Future Power =
(P1+P2+P3+P4+P5)/5

The AI Agent predicts future energy consumption using historical readings, moving averages, machine learning, or LSTM forecasting models.

13. Voice Notification Logic

ESP32 Data
     |
     V
n8n Workflow
     |
Text-To-Speech
     |
MP3 Generation
     |
Telegram Voice Message

14. Agentic AI Decision Rules

Condition Action
Power > 1000W Warning Alert
Power > 1500W Relay Shutdown
Peak Load Expected Optimization Suggestion

15. Future Enhancements

  • LSTM Forecasting
  • MQTT Integration
  • Grafana Dashboard
  • Solar Monitoring
  • Battery Management
  • Reinforcement Learning
  • Edge AI Processing

16. Deployment Architecture

ESP32
 |
MQTT Broker
 |
n8n Automation
 |
AI Agent
 |
-----------------
|       |       |
V       V       V
Sheets  Cloud  Telegram
Project Folder Structure SmartGridProject/ │ ├── index.php ├── css/ │ └── style.css │ ├── images/ │ ├── architecture.png │ ├── circuit.png │ └── flowchart.png │ ├── docs/ │ ├── ESP32_Code.ino │ ├── n8n_Workflow.json │ └── README.pdf │ └── assets/ For a final-year project, a better approach is to create a complete PHP web application with Login Page, Live Dashboard, ThingSpeak API Integration, Google Sheets Logging, Telegram Alert Management, AI Prediction Charts, MySQL Database, and Admin Panel rather than a single static PHP page

AI-Powered Remote Patient Health Monitoring & Predictive Disease Alert System Using ESP8266 and Arduino

AI-Powered Remote Patient Health Monitoring & Predictive Disease Alert System Using ESP32/ESP8266 + Sensors + n8n Automation + AI Agent + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
<?php echo $title; ?>

AI-Powered Remote Patient Health Monitoring & Predictive Disease Alert System

ESP32 + IoT + AI Agent + n8n + Telegram Voice Alerts + Google Sheets + ThingSpeak

1. Project Overview

This project continuously monitors patient health parameters using IoT sensors connected to an ESP32 board. Data is uploaded to ThingSpeak Cloud, stored in Google Sheets, analyzed using AI, and critical alerts are sent through Telegram including voice notifications.

2. Features

  • Real-Time Health Monitoring
  • Heart Rate Monitoring
  • Blood Oxygen (SpO2) Monitoring
  • Body Temperature Monitoring
  • Cloud Dashboard
  • Google Sheets Data Logging
  • AI Disease Prediction
  • Telegram Notification Alerts
  • Voice Alerts
  • Remote Doctor Monitoring

3. Components List

Component Quantity
ESP32 Dev Board 1
MAX30102 Sensor 1
DHT11 Sensor 1
LM35 Sensor 1
OLED Display 1
Jumper Wires As Required
Breadboard 1

4. Circuit Connections

MAX30102 → ESP32

VIN  → 3.3V
GND  → GND
SDA  → GPIO21
SCL  → GPIO22

DHT11 → ESP32

VCC → 3.3V
GND → GND
DATA → GPIO4

LM35 → ESP32

VCC → 3.3V
GND → GND
OUT → GPIO34

5. System Architecture

Patient
   |
Sensors
   |
ESP32
   |
ThingSpeak Cloud
   |
+------------------------+
|                        |
Google Sheets         AI Agent
|                        |
Database            Risk Prediction
|                        |
+----------+-------------+
           |
     Telegram Alerts
           |
     Voice Notification

6. AI Prediction Logic

IF Temperature > 38°C
THEN Fever Risk

IF Heart Rate > 100
THEN Tachycardia

IF Heart Rate < 60
THEN Bradycardia

IF SpO2 < 92
THEN Respiratory Risk

IF SpO2 < 90 AND HR > 120
THEN Critical Alert

7. ESP32 Source Code

#include <WiFi.h>
#include <HTTPClient.h>

const char* ssid="YOUR_WIFI";
const char* password="YOUR_PASSWORD";

String apiKey="YOUR_THINGSPEAK_API_KEY";

void setup()
{
  Serial.begin(115200);

  WiFi.begin(ssid,password);

  while(WiFi.status()!=WL_CONNECTED)
  {
      delay(500);
      Serial.print(".");
  }
}

void loop()
{
   float hr=90;
   float spo2=98;
   float temp=36.8;

   HTTPClient http;

   String url=
   "http://api.thingspeak.com/update?api_key="+apiKey+
   "&field1="+String(hr)+
   "&field2="+String(spo2)+
   "&field3="+String(temp);

   http.begin(url);
   http.GET();
   http.end();

   delay(15000);
}

8. ThingSpeak Setup

  1. Create ThingSpeak Account
  2. Create New Channel
  3. Add Fields:
    • Heart Rate
    • SpO2
    • Temperature
    • Humidity
  4. Copy Write API Key
  5. Use API Key in ESP32 Code

9. Google Sheets Integration

function doPost(e)
{
 var sheet =
 SpreadsheetApp.getActiveSpreadsheet()
 .getSheetByName("Sheet1");

 var data =
 JSON.parse(e.postData.contents);

 sheet.appendRow([
   new Date(),
   data.hr,
   data.spo2,
   data.temp,
   data.status
 ]);

 return ContentService
 .createTextOutput("Success");
}

10. Telegram Bot Setup

  1. Open Telegram
  2. Search @BotFather
  3. Create New Bot
  4. Get Bot Token
  5. Get Chat ID
  6. Use Token in n8n Workflow

11. n8n Workflow

ThingSpeak Trigger
       |
       ▼
Webhook
       |
       ▼
AI Analysis
       |
       ▼
IF Condition
       |
   +---+---+
   |       |
Normal  Critical
   |       |
Sheets Telegram
 Update Alerts

12. Voice Notification Automation

ESP32 Data
     |
ThingSpeak
     |
n8n Workflow
     |
OpenAI / Gemini
     |
Generate Alert Text
     |
Google TTS
     |
MP3 Voice File
     |
Telegram Voice Message

13. Power Consumption Formula

Power = Voltage × Current

Battery Life =
Battery Capacity(mAh)
---------------------
Average Current(mA)

14. Future Enhancements

  • ECG Sensor Integration
  • Blood Pressure Monitoring
  • LSTM Disease Prediction
  • Doctor Mobile Application
  • AWS IoT Integration
  • Firebase Database
  • GPS Emergency Tracking
  • Hospital Dashboard

15. Deployment Guide

  1. Build Hardware
  2. Upload ESP32 Code
  3. Configure ThingSpeak
  4. Connect Google Sheets
  5. Configure n8n Workflow
  6. Create Telegram Bot
  7. Connect AI Agent
  8. Test Alerts
  9. Deploy System

AI-Based Smart Battery Management System for EV Applications

AI-Based Smart Battery Management System (BMS) for EV Applications Using ESP32 + Agentic AI + IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
AI-Based Smart Battery Management System (BMS) for EV Applications Using ESP32 + Agentic AI + IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard 1. Project Overview Project Title AI-Based Smart Battery Management System for Electric Vehicle Applications Using ESP32, Agentic AI, n8n Automation, Telegram Voice Notifications, Google Sheets, and ThingSpeak Cloud Analytics Objective Develop a smart battery monitoring and predictive maintenance system for EV batteries that: Monitors battery voltage, current, temperature, and State of Charge (SOC) Uploads data to cloud platforms Uses AI to predict battery health and power consumption Sends real-time Telegram notifications Generates voice alerts automatically Stores historical data in Google Sheets Displays live dashboard on ThingSpeak Uses n8n as an intelligent automation engine Supports future EV fleet management 2. System Architecture Battery Pack │ ▼ Voltage Sensor Current Sensor Temperature Sensor │ ▼ ESP32 │ ├────────► ThingSpeak Dashboard │ ├────────► n8n Webhook │ │ ▼ │ AI Prediction Agent │ ▼ │ Decision Engine │ ├────────► Google Sheets │ ▼ Telegram Bot │ ▼ Voice Alert Message 3. Features Real-Time Monitoring Battery Voltage Battery Current Battery Temperature State of Charge (SOC) AI Functions Battery Health Prediction Remaining Runtime Estimation Power Consumption Forecasting Fault Detection IoT Features Cloud Dashboard Data Logging Remote Monitoring Automation Features Telegram Alerts Voice Notifications Google Sheets Logging AI Recommendations 4. Hardware Components Component Quantity ESP32 Dev Board 1 INA219 Current Sensor 1 Voltage Divider Circuit 1 DS18B20 Temperature Sensor 1 EV Battery Pack (12V/24V/48V) 1 OLED Display (Optional) 1 Jumper Wires Several Breadboard/PCB 1 WiFi Router 1 5. Sensor Selection INA219 Current Sensor Measures: Voltage Current Power Communication: I2C Protocol DS18B20 Temperature Sensor Measures: Battery Temperature Range: -55°C to +125°C Voltage Divider Converts: 48V Battery ↓ 3.3V ESP32 ADC Formula: V out ​ =V in ​ × R 1 ​ +R 2 ​ R 2 ​ ​ Example: R1 = 100kΩ R2 = 10kΩ 6. Circuit Schematic Battery + │ ├── Voltage Divider ── GPIO34 Battery + │ └── INA219 Sensor INA219 SDA → GPIO21 SCL → GPIO22 DS18B20 DATA → GPIO4 VCC → 3.3V GND → GND ESP32 Connected to WiFi 7. Pin Configuration Device ESP32 Pin INA219 SDA GPIO21 INA219 SCL GPIO22 DS18B20 Data GPIO4 Voltage Sensor GPIO34 8. Working Principle Step 1 ESP32 reads: Voltage Current Temperature Step 2 Calculates: Battery Power State of Charge Power Formula: P=V×I Step 3 Uploads data to: ThingSpeak n8n Webhook Step 4 n8n receives data Example: { "voltage": 48.5, "current": 12.4, "temperature": 35, "soc": 82 } Step 5 AI Agent analyzes battery condition Possible outputs: Battery Healthy Battery Overheating High Power Consumption Low SOC Warning Step 6 Telegram Voice Alert Sent Example: Warning! Battery Temperature is 48°C. Please stop charging immediately. 9. State of Charge Calculation Simple SOC estimation: SOC= V max ​ −V min ​ V battery ​ −V min ​ ​ ×100 Example: Battery Voltage = 48V SOC = 80% 10. AI Power Consumption Prediction Inputs Voltage Current Temperature Historical Usage AI Logic Dataset: Voltage Current Temperature SOC Runtime Model: Linear Regression Random Forest LSTM Prediction: Expected Runtime Remaining Power Consumption Trend Battery Health Score Pseudo Logic if temperature > 45: health_score -= 20 if current > threshold: health_score -= 10 if soc < 20: alert = True 11. ESP32 Source Code #include #include #include #include const char* ssid="YOUR_WIFI"; const char* password="YOUR_PASSWORD"; String apiKey="THINGSPEAK_API_KEY"; Adafruit_INA219 ina219; float voltage; float current; float power; void setup() { Serial.begin(115200); WiFi.begin(ssid,password); while(WiFi.status()!=WL_CONNECTED) { delay(500); } ina219.begin(); } void loop() { voltage=ina219.getBusVoltage_V(); current=ina219.getCurrent_mA()/1000; power=voltage*current; sendThingSpeak(); sendn8n(); delay(15000); } ThingSpeak Upload Function void sendThingSpeak() { HTTPClient http; String url= "http://api.thingspeak.com/update?api_key="+ apiKey+ "&field1="+String(voltage)+ "&field2="+String(current)+ "&field3="+String(power); http.begin(url); http.GET(); http.end(); } n8n Webhook Function void sendn8n() { HTTPClient http; http.begin( "https://your-n8n-server/webhook/battery"); http.addHeader( "Content-Type", "application/json"); String data= "{\"voltage\":"+String(voltage)+ ",\"current\":"+String(current)+ "}"; http.POST(data); http.end(); } 12. n8n Workflow Design Workflow Nodes Webhook ↓ Set Data ↓ AI Analysis ↓ IF Condition ↓ Telegram Alert ↓ Google Sheets Detailed Flow Webhook Node Receives sensor data. Example: { "voltage":48, "current":10, "temperature":36, "soc":75 } AI Agent Node Prompt: Analyze battery data. Voltage: {{$json.voltage}} Current: {{$json.current}} Temperature: {{$json.temperature}} SOC: {{$json.soc}} Give: 1. Health Score 2. Remaining Runtime 3. Recommendation IF Node Condition: Temperature > 45°C OR SOC < 20% Telegram Node Message: ⚠️ Battery Alert Voltage: 48V SOC: 15% Action Required 13. n8n Workflow JSON (Simplified) { "nodes": [ { "name": "Webhook" }, { "name": "AI Agent" }, { "name": "Telegram" }, { "name": "Google Sheets" } ] } 14. Telegram Bot Setup Step 1 Open Telegram. Search: Telegram Step 2 Search: @BotFather Step 3 Create Bot /newbot Step 4 Copy: BOT TOKEN Example: 123456:ABCXYZ Step 5 Add token to n8n Telegram node. 15. Voice Notification Automation Method Use Text-To-Speech API. Workflow: AI Alert ↓ Google TTS ↓ Audio File ↓ Telegram Send Voice Voice Example: Attention! Battery temperature exceeds safe limit. Please inspect immediately. 16. Google Sheets Integration Create Sheet: Battery Monitoring Log Columns: Timestamp Voltage Current Temp SOC Health n8n Node Google Sheets Node Action: Append Row Stored Data Example 2026-06-11 48.4 10.3 35 80 Healthy 17. ThingSpeak Dashboard Setup Step 1 Create account on ThingSpeak Step 2 Create New Channel Fields: Field1 Voltage Field2 Current Field3 Temperature Field4 SOC Field5 Health Score Step 3 Enable Public Dashboard Step 4 Add Widgets Gauge Line Chart Battery Indicator Temperature Trend 18. Agentic AI Decision Engine AI evaluates: Battery Health Charging Pattern Discharge Pattern Thermal Condition Decision Rules: if temp > 45: send_alert() if soc < 20: send_alert() if health < 70: maintenance_required() 19. Future Enhancements Advanced AI LSTM Battery Degradation Prediction Predictive Maintenance Remaining Useful Life (RUL) EV Fleet Management Monitor: 100+ Vehicles through one dashboard. Mobile App Features: Live Battery Status Notifications Maintenance Alerts Route-Based Energy Prediction Digital Twin Create virtual battery model for simulation. 20. Project Execution Guide (Step-by-Step) Phase 1: Hardware Setup Assemble ESP32. Connect INA219. Connect DS18B20. Connect voltage divider. Verify sensor readings. Phase 2: Cloud Setup Create ThingSpeak channel. Obtain Write API Key. Test data upload. Phase 3: n8n Setup Install n8n. Create Webhook. Create AI Agent node. Configure Telegram node. Configure Google Sheets node. Phase 4: AI Integration Collect battery data. Train prediction model. Deploy model API. Connect API to n8n. Phase 5: Testing Simulate low SOC. Simulate overheating. Verify alerts. Verify voice notifications. Verify cloud logging. Phase 6: Deployment Install in EV battery enclosure. Enable Wi-Fi/4G connectivity. Secure API endpoints. Monitor dashboard. Perform periodic calibration. Expected Project Outcomes Real-time EV battery monitoring AI-based battery health prediction Automatic Telegram voice alerts Cloud-based analytics dashboard Historical logging in Google Sheets Predictive maintenance recommendations Industry-ready Agentic IoT architecture suitable for smart EVs, e-bikes, solar battery banks, and fleet management systems.

AI-Based Smart ATM Security System with Face Recognition

AI-Based Smart ATM Security System with Face Recognition ESP32 + AI Agent + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
AI-Based Smart ATM Security System with Face Recognition ESP32 + AI Agent + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard 1. Project Overview Project Title AI-Powered Smart ATM Security Monitoring System using ESP32-CAM, Face Recognition, n8n Automation, Telegram Voice Alerts, Google Sheets Logging, and ThingSpeak Cloud Analytics Objective Develop an intelligent ATM security system that: Detects unauthorized persons near ATM. Performs face recognition. Captures and uploads images. Sends instant Telegram alerts. Generates AI voice notifications. Logs events to Google Sheets. Stores sensor data in ThingSpeak Cloud. Uses AI to predict suspicious activity and power consumption. Provides real-time monitoring dashboard. 2. System Architecture +------------------+ | ESP32-CAM | | Face Recognition | +---------+--------+ | | WiFi / Internet Connection | v +---------------------------------------+ | n8n Server | | AI Agent + Automation Engine | +---------------------------------------+ | | | | | | v v v Telegram Bot Google Sheets ThingSpeak Voice Alert Logging Dashboard | v Security Personnel 3. Features Security Features Face Recognition Recognizes: Authorized ATM staff Security guards Maintenance personnel Detects: Unknown visitors Suspicious loitering Intrusion Detection Using PIR sensor: Human motion detection ATM door opening detection Night-time monitoring Real-Time Alerts Telegram notifications: ⚠ ATM ALERT Unknown person detected Location: ATM Branch 03 Time: 11:42 PM Confidence: 91% Image Captured Voice Alerts AI-generated voice: Warning. Unauthorized person detected near ATM. Please verify immediately. Cloud Monitoring ThingSpeak dashboard displays: Motion events Face recognition confidence Temperature Humidity Power usage Security score 4. Hardware Components Component Quantity ESP32-CAM AI Thinker 1 FTDI Programmer 1 PIR Motion Sensor HC-SR501 1 Magnetic Door Sensor 1 Buzzer 1 Relay Module 1 DHT22 Sensor 1 OLED Display 0.96" 1 LEDs 2 Jumper Wires Several Breadboard 1 5V Adapter 1 5. Pin Connections PIR Sensor PIR ESP32 VCC 5V GND GND OUT GPIO13 Door Sensor Sensor ESP32 One End GPIO12 Other End GND Buzzer Buzzer ESP32 Positive GPIO15 Negative GND DHT22 DHT22 ESP32 VCC 3.3V GND GND DATA GPIO14 6. Circuit Schematic +----------------+ | ESP32 CAM | +----------------+ GPIO13 ------ PIR OUT GPIO12 ------ Door Sensor GPIO15 ------ Buzzer GPIO14 ------ DHT22 DATA 5V ---------- Sensors VCC GND --------- Sensors GND 7. System Workflow Start | v Initialize ESP32 | Connect WiFi | Motion Detected? | Yes | Capture Image | Face Recognition | Known Face? / \ Yes No | | Log Trigger Alert | | Store Event | | Send Telegram | | Voice Alert | | Update Sheets | | ThingSpeak Update | Loop 8. Detailed Flowchart +--------------------+ | Power ON | +---------+----------+ | v +--------------------+ | Connect WiFi | +---------+----------+ | v +--------------------+ | Motion Detection | +---------+----------+ | v +--------------------+ | Capture Face | +---------+----------+ | v +--------------------+ | Face Recognition | +---------+----------+ | +----+----+ | | v v Known Unknown | | v v Log Telegram Alert | v Voice Message | v Google Sheets | v ThingSpeak 9. ESP32 Source Code (Core Example) #include #include const char* ssid = "YOUR_WIFI"; const char* password = "YOUR_PASSWORD"; #define PIR_PIN 13 #define BUZZER 15 void setup() { Serial.begin(115200); pinMode(PIR_PIN, INPUT); pinMode(BUZZER, OUTPUT); WiFi.begin(ssid,password); while(WiFi.status()!=WL_CONNECTED) { delay(500); } } void loop() { if(digitalRead(PIR_PIN)) { digitalWrite(BUZZER,HIGH); HTTPClient http; http.begin("YOUR_N8N_WEBHOOK"); http.addHeader("Content-Type", "application/json"); http.POST("{\"event\":\"motion\"}"); http.end(); delay(5000); digitalWrite(BUZZER,LOW); } } 10. Face Recognition Logic Face Enrollment Store authorized faces: Security Guard ATM Manager Maintenance Engineer Cash Loading Staff Recognition Process Camera Capture ↓ Face Detection ↓ Feature Extraction ↓ Embedding Generation ↓ Database Comparison ↓ Known / Unknown 11. n8n Automation Workflow Workflow Modules Webhook Trigger ↓ Receive ESP32 Event ↓ AI Agent ↓ Decision Engine ↓ Telegram Alert ↓ Google Sheets ↓ ThingSpeak Update ↓ Voice Notification Sample n8n JSON Structure { "nodes": [ { "name": "Webhook", "type": "n8n-nodes-base.webhook" }, { "name": "Telegram", "type": "n8n-nodes-base.telegram" }, { "name": "Google Sheets", "type": "n8n-nodes-base.googleSheets" } ] } 12. Telegram Bot Setup Step 1 Open Telegram. Search: @BotFather Step 2 Create Bot /newbot Step 3 Provide: ATM Security Bot Step 4 Receive: BOT TOKEN Example: 123456:ABCDEFxxxxx Save it. Step 5 Get Chat ID Use: @getidsbot Save Chat ID. 13. Telegram Alert Automation Message: 🚨 ATM SECURITY ALERT Unknown Person Detected Location: ATM Branch Hyderabad Confidence: 93% Timestamp: 2026-06-11 22:05:00 Image Attached 14. Telegram Voice Alert Automation n8n Flow Alert Generated ↓ AI Text ↓ Text-To-Speech API ↓ Generate MP3 ↓ Telegram Send Audio Voice: Attention. Suspicious activity detected near ATM. Immediate verification required. 15. Google Sheets Integration Columns Timestamp Face Status Confidence Motion Power Example: |2026-06-11|Unknown|94%|Detected|12W| n8n Node Google Sheets Append Row Stores every event. 16. ThingSpeak Setup Create Account Use the official platform: ThingSpeak Create Channel Fields: Field1 Motion Field2 Face Confidence Field3 Temperature Field4 Humidity Field5 Power Usage Field6 Security Score API Write URL https://api.thingspeak.com/update 17. ThingSpeak Dashboard Widgets: Gauge Security Score Line Chart Power Usage Bar Chart Motion Events Heat Map Intrusion Frequency 18. AI Agent Logic The AI Agent inside n8n evaluates: Motion Frequency Face Confidence Time of Day Door Status Power Consumption Risk Score Formula Risk Score=0.4M+0.3F+0.2D+0.1T Where: M = Motion Risk F = Face Risk D = Door Status Risk T = Time Risk Classification Score Status 0-30 Safe 31-60 Warning 61-100 High Risk 19. AI Power Consumption Prediction Inputs Temperature Camera ON Time WiFi Usage Sensor Activity Alert Frequency Linear Prediction Model P=aT+bC+cW+dS+eA Where: P = Predicted Power T = Temperature C = Camera Usage W = WiFi Activity S = Sensor Usage A = Alert Count Output Predicted Daily Consumption: 2.8 kWh Expected Monthly: 84 kWh 20. AI Decision Engine Example: Unknown Face + Motion Detected + After Midnight = Critical Alert Response: Activate Buzzer Capture 5 Images Send Voice Alert Notify Security Team 21. Security Enhancements Multi-Factor Verification Face Recognition Motion Detection Door Sensor Anti-Spoofing Detect: Mobile screen attacks Printed photographs Video replay attacks Techniques: Blink detection Head movement tracking Depth estimation 22. Deployment Architecture ATM Site | ESP32-CAM | Internet | n8n Cloud Server | +-------------+ | AI Agent | +-------------+ | Telegram Sheets ThingSpeak 23. Future Enhancements AI Enhancements YOLO person detection Weapon detection Crowd analysis Behavior analytics Anomaly detection Cloud Enhancements AWS IoT Core integration Azure IoT Hub integration MQTT broker support Edge AI inference ATM Security Upgrades SMS backup alerts Email escalation Police notification workflow Geofencing Multi-ATM centralized dashboard 24. Expected Project Outcome The completed system will: ✅ Detect suspicious ATM activity in real time ✅ Recognize authorized and unauthorized individuals ✅ Send instant Telegram text and voice alerts ✅ Log every event to Google Sheets ✅ Visualize security metrics on ThingSpeak ✅ Use AI-based risk analysis and power prediction ✅ Enable centralized monitoring through n8n automation ✅ Provide a scalable smart ATM security solution suitable for academic projects, research prototypes, and pilot deployments in banking environments.

AI-Based Sign Language to Speech Conversion System

AI-Based Sign Language to Speech Conversion System ESP32 + AI Agent + IoT Dashboard + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak
AI-Based Sign Language to Speech Conversion System ESP32 + AI Agent + IoT Dashboard + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak 1. Project Overview Project Title AI-Based Sign Language to Speech Conversion System using ESP32, Agentic AI, n8n Automation, Telegram Voice Alerts, Google Sheets, and ThingSpeak Cloud Objective The system recognizes sign language gestures using wearable sensors and converts them into: Text Speech Telegram Voice Alerts Cloud Data Logging AI-based Analytics The project combines: IoT Artificial Intelligence Agentic Automation Cloud Computing Real-Time Monitoring to assist speech-impaired individuals in communicating effectively. 2. System Architecture Gesture Input │ ▼ Flex Sensors + MPU6050 │ ▼ ESP32 │ ▼ WiFi Network │ ┌────┼─────┐ ▼ ▼ ▼ ThingSpeak Google Sheets n8n Workflow │ ▼ AI Agent │ ▼ Telegram Bot │ ▼ Voice Message Alert 3. Working Principle Step 1 User performs a sign language gesture. Example: Gesture = HELP Step 2 Flex sensors detect finger bending. MPU6050 detects hand orientation. Step 3 ESP32 reads sensor values. Example: Finger1 = 850 Finger2 = 300 Finger3 = 870 Finger4 = 900 Finger5 = 200 Step 4 ESP32 compares values with trained patterns. if(F1>800 && F2<400) { gesture="HELP"; } Step 5 Recognized text is sent to: ThingSpeak Google Sheets n8n Webhook Step 6 n8n AI Agent analyzes the message. Example: HELP AI can generate: Emergency Assistance Needed Step 7 Telegram Bot sends: Text Alert User Requested Help Voice Alert Attention. The user requires assistance immediately. 4. Hardware Components Component Quantity ESP32 Dev Board 1 Flex Sensors 5 MPU6050 Gyroscope 1 10kΩ Resistors 5 Breadboard 1 Jumper Wires Several Power Bank 1 WiFi Router 1 Speaker (Optional) 1 OLED Display (Optional) 1 5. Component Description ESP32 Main controller. Functions: Sensor Reading WiFi Communication Data Upload Features: Dual Core 240 MHz WiFi Bluetooth Flex Sensors Measure finger bending. Range: 10kΩ - 40kΩ Each finger has one sensor. MPU6050 Measures: Acceleration Rotation Hand Orientation Used for gesture accuracy improvement. 6. Circuit Diagram Flex Sensor Connections Thumb → GPIO34 Index → GPIO35 Middle → GPIO32 Ring → GPIO33 Little → GPIO25 MPU6050 Connections VCC → 3.3V GND → GND SDA → GPIO21 SCL → GPIO22 Complete Schematic ESP32 +----------------+ Flex1 -------- GPIO34 Flex2 -------- GPIO35 Flex3 -------- GPIO32 Flex4 -------- GPIO33 Flex5 -------- GPIO25 MPU6050 SDA -- GPIO21 MPU6050 SCL -- GPIO22 VCC ---------- 3.3V GND ---------- GND +----------------+ 7. Flowchart START | Initialize ESP32 | Connect WiFi | Read Sensors | Recognize Gesture | Upload Data | Trigger n8n Webhook | AI Agent Analysis | Telegram Alert | Store Data | Repeat 8. ESP32 Source Code #include #include const char* ssid="YOUR_WIFI"; const char* password="PASSWORD"; String webhookURL= "https://your-n8n-server/webhook/sign"; void setup() { Serial.begin(115200); WiFi.begin(ssid,password); while(WiFi.status()!=WL_CONNECTED) { delay(500); } Serial.println("Connected"); } void loop() { int flex1=analogRead(34); int flex2=analogRead(35); int flex3=analogRead(32); int flex4=analogRead(33); int flex5=analogRead(25); String gesture="Unknown"; if(flex1>3000 && flex2<1500) { gesture="HELP"; } if(WiFi.status()==WL_CONNECTED) { HTTPClient http; http.begin(webhookURL); http.addHeader("Content-Type", "application/json"); String payload= "{\"gesture\":\""+gesture+"\"}"; http.POST(payload); http.end(); } delay(3000); } 9. ThingSpeak Setup Step 1 Create account at: ThingSpeak Step 2 Create New Channel Fields: Field1 = Gesture Field2 = Confidence Field3 = Power Step 3 Copy Write API Key Example: ABC123XYZ Step 4 ESP32 Upload https://api.thingspeak.com/update? api_key=ABC123XYZ &field1=HELP 10. Google Sheets Integration Method ESP32 → n8n → Google Sheets Create Sheet Timestamp Gesture Confidence Power Example: 10:15 AM | HELP | 95% | 0.8W 11. Telegram Bot Setup Step 1 Open Telegram Search: BotFather on Telegram Step 2 Create Bot /newbot Step 3 Copy Token 123456:ABCDEF Step 4 Get Chat ID Send message: /start Store Chat ID. 12. Telegram Voice Notification Example Voice Message Attention. The user has requested help. Please assist immediately. n8n Flow Webhook ↓ AI Agent ↓ Text-to-Speech ↓ Telegram Send Voice 13. n8n Workflow Architecture Webhook Trigger │ ▼ JSON Parse │ ▼ AI Agent │ ┌─────┴─────┐ ▼ ▼ Sheets Voice Update Alert │ ▼ ThingSpeak 14. Detailed n8n Nodes Node 1 Webhook Trigger POST /webhook/sign Node 2 Set Node { "gesture":"HELP" } Node 3 AI Agent Prompt: Convert gesture into meaningful communication. Node 4 Google Sheets Append Row Node 5 HTTP Request Update ThingSpeak Node 6 Telegram Send Message User needs help Node 7 Telegram Send Voice Voice generated using TTS. 15. Sample n8n Workflow JSON { "nodes":[ { "name":"Webhook", "type":"n8n-nodes-base.webhook" }, { "name":"AI Agent", "type":"@n8n/n8n-nodes-langchain.agent" }, { "name":"Google Sheets", "type":"n8n-nodes-base.googleSheets" }, { "name":"Telegram", "type":"n8n-nodes-base.telegram" } ] } 16. AI Power Consumption Prediction Objective Predict battery life. Parameters: WiFi Usage CPU Usage Sensor Usage Transmission Count Formula P=VI Where: P = Power V = Voltage I = Current Example Voltage = 5V Current = 0.18A Power: 0.9W Battery: 5000mAh Runtime: 27 Hours Approximate. 17. AI Agent Logic Input { "gesture":"HELP" } AI Interpretation Emergency communication request detected. AI Output { "priority":"HIGH", "message":"User needs help immediately" } 18. Voice Automation Logic Gesture ↓ AI Agent ↓ Generate Sentence ↓ Text-to-Speech ↓ Telegram Voice Example: HELP becomes Attention. Emergency assistance requested. 19. Database Structure Google Sheets Columns Timestamp Gesture AI Message Priority Power 10:00 HELP Emergency HIGH 0.9W 20. Testing Procedure Sensor Test Check raw values. Serial.println(flex1); Gesture Test Verify each sign. HELP YES NO WATER FOOD Cloud Test Verify: ThingSpeak Graphs Google Sheet Entries Telegram Alerts 21. Future Enhancements AI Gesture Recognition Replace rule-based system with: CNN LSTM TinyML for higher accuracy. Multilingual Speech Support: English Hindi Telugu Tamil Mobile App Features: Live Speech Dashboard Analytics Edge AI Deploy model directly on ESP32 using: TensorFlow Lite Micro Edge Impulse 22. Deployment Guide Step 1 Assemble glove. Step 2 Upload ESP32 firmware. Step 3 Configure WiFi. Step 4 Create: Telegram Bot Google Sheet ThingSpeak Channel Step 5 Import n8n workflow. Step 6 Start workflow. Step 7 Wear glove and test gestures. Expected Output Example User Gesture HELP ESP32 Gesture Detected: HELP Google Sheets 12:30 PM | HELP | HIGH ThingSpeak Gesture Frequency Graph Power Consumption Graph Telegram Text: 🚨 User needs help immediately. Voice: Attention. The user requires assistance. AI Agent Priority: HIGH Suggested Action: Immediate Response This architecture demonstrates a complete Industry 4.0/Agentic IoT solution integrating wearable sign-language recognition, ESP32 edge computing, AI interpretation, cloud analytics, workflow automation, voice notifications, and real-time monitoring.

Monday, 1 June 2026

AI - IoT Integrated Emergency Response System for Women Protection Using ESP32

AI–IoT Integrated Emergency Response System for Women Protection Using ESP32, n8n, Telegram, Google Sheets & ThingSpeak
AI–IoT Integrated Emergency Response System for Women Protection Using ESP32, n8n, Telegram, Google Sheets & ThingSpeak 1. Project Overview Project Title AI-Powered Women Safety Emergency Response System using ESP32, Agentic IoT, n8n Automation, Telegram Voice Alerts, Google Sheets, and ThingSpeak Cloud Dashboard Objective Develop an intelligent women protection device that can: Detect emergency situations through a panic button. Send instant SOS alerts. Track GPS location. Notify family members and authorities. Generate AI-based threat analysis. Store incident records in Google Sheets. Display real-time data on ThingSpeak. Send Telegram voice notifications automatically. Predict battery/power consumption using AI logic. 2. System Architecture +---------------------+ | Emergency Button | +----------+----------+ | v +---------------------+ | ESP32 Controller | +----------+----------+ | v +---------------------+ | GPS Module | +----------+----------+ | v +---------------------+ | WiFi Internet | +----------+----------+ | +-------------------+ | | v v +----------------+ +----------------+ | ThingSpeak | | n8n Workflow | | Dashboard | | Automation | +----------------+ +--------+-------+ | +-----------+-----------+ | | v v +---------------+ +---------------+ | Telegram Bot | | Google Sheets | +-------+-------+ +---------------+ | v +---------------+ | Voice Alerts | +---------------+ | v +---------------+ | AI Analysis | +---------------+ 3. Components Required Component Quantity ESP32 Dev Board 1 GPS Module NEO-6M 1 Push Button (SOS) 1 Buzzer 1 LED 1 220Ω Resistor 1 Power Bank (5V) 1 Jumper Wires Several Breadboard 1 Smartphone with Telegram 1 WiFi Network 1 Optional: Component Purpose SIM800L GSM Backup communication MPU6050 Fall detection MAX9814 Mic Voice distress detection 4. Working Principle When the woman presses the emergency button: ESP32 detects SOS signal. Reads GPS coordinates. Sends data to ThingSpeak. Sends HTTP request to n8n webhook. n8n triggers: Telegram alert Voice notification Google Sheet logging AI analysis Guardian receives: SOS message Location link Voice call alert 5. Circuit Diagram Connections SOS Button Button Pin1 → GPIO 18 Pin2 → GND Buzzer Buzzer + GPIO 19 Buzzer - GND LED LED Anode GPIO 2 LED Cathode 220Ω GND GPS NEO6M GPS TX → ESP32 GPIO16 GPS RX → ESP32 GPIO17 GPS VCC → 3.3V GPS GND → GND 6. Flowchart START | Initialize ESP32 | Connect WiFi | Read GPS | Wait for SOS Button | Button Pressed? | YES | Activate Buzzer | Get Location | Send Data to n8n | Update ThingSpeak | Telegram Alert | Voice Alert | Save to Google Sheet | AI Risk Analysis | END 7. ESP32 Source Code Libraries #include #include #include #include WiFi Credentials const char* ssid = "YOUR_WIFI"; const char* password = "YOUR_PASSWORD"; n8n Webhook String webhook = "https://your-n8n-domain/webhook/sos"; Pins #define BUTTON_PIN 18 #define BUZZER_PIN 19 #define LED_PIN 2 Main Logic void loop() { if(digitalRead(BUTTON_PIN)==LOW) { digitalWrite(BUZZER_PIN,HIGH); digitalWrite(LED_PIN,HIGH); String latitude="17.3850"; String longitude="78.4867"; HTTPClient http; http.begin(webhook); http.addHeader("Content-Type","application/json"); String payload = "{\"latitude\":\""+latitude+ "\",\"longitude\":\""+longitude+ "\"}"; http.POST(payload); http.end(); delay(5000); digitalWrite(BUZZER_PIN,LOW); digitalWrite(LED_PIN,LOW); } } 8. n8n Workflow Design Node 1: Webhook Receives SOS request. Input: { "latitude":"17.3850", "longitude":"78.4867" } Node 2: AI Agent Prompt: Analyze emergency alert. Location: {{$json.latitude}}, {{$json.longitude}} Generate threat level: Low Medium High Generate response advice. Node 3: Telegram Message Message: 🚨 WOMAN SAFETY ALERT Emergency Triggered Location: https://maps.google.com/?q={{$json.latitude}},{{$json.longitude}} Threat: {{$json.threat}} Node 4: Telegram Voice Alert Use Telegram API. Text: Emergency Alert. Immediate assistance required. Location received. Convert to speech using TTS node. Node 5: Google Sheets Columns: Timestamp Latitude Longitude Threat Level Status Append row automatically. Node 6: ThingSpeak Update API URL https://api.thingspeak.com/update Fields: field1 = latitude field2 = longitude field3 = threat level field4 = battery % 9. n8n Workflow JSON (Basic) { "nodes": [ { "name": "Webhook", "type": "n8n-nodes-base.webhook" }, { "name": "AI Agent", "type": "n8n-nodes-base.openAi" }, { "name": "Telegram", "type": "n8n-nodes-base.telegram" }, { "name": "Google Sheets", "type": "n8n-nodes-base.googleSheets" } ] } 10. Telegram Bot Setup Step 1 Open Telegram Search: @BotFather Step 2 Create Bot /newbot Example: WomenSafetyBot Step 3 Get Token 123456:ABCDEF... Save token. Step 4 Get Chat ID Send: /start Use: https://api.telegram.org/botTOKEN/getUpdates Get Chat ID. 11. Google Sheets Integration Create Sheet: Women_Safety_Logs Columns: Date Time Latitude Longitude Threat Status Battery Connect n8n Credentials: Google OAuth2 Action: Append Row 12. ThingSpeak Dashboard Setup Create Account Use: ThingSpeak New Channel Fields: Field1 → Latitude Field2 → Longitude Field3 → Threat Level Field4 → Battery Obtain Write API Key Read API Key Dashboard Widgets Location Monitoring Map Widget Emergency Count Gauge Widget Battery Status Chart Widget Threat Trend Line Chart 13. AI Power Consumption Prediction Inputs Battery Voltage WiFi Usage GPS Usage Alert Frequency Formula Energy: E=V×I×t Remaining Battery: Remaining = Current Battery - Estimated Consumption AI Logic Example: If GPS active continuously AND WiFi active Then battery drain = HIGH Suggest: Enable Deep Sleep Prediction Levels Battery Prediction >80% Excellent 50-80% Good 20-50% Moderate <20% Critical 14. Voice Notification Automation Workflow SOS Trigger | Generate Text | Google TTS | MP3 Audio | Telegram Send Voice Message: Attention. Emergency alert received. Please respond immediately. Location shared. 15. AI Agent Features The AI agent can: Risk Assessment Low Risk Medium Risk High Risk Critical Pattern Analysis Detect: Repeated alerts Unsafe locations Night-time emergencies Battery anomalies Smart Suggestions Example: Nearest police station Nearest hospital Fastest route 16. Future Enhancements Computer Vision ESP32-CAM Detect: Stalking Physical aggression Suspicious movement Voice Recognition Commands: HELP ME SOS SAVE ME Fall Detection MPU6050 Detect: Sudden impact Unconscious state GSM Backup SIM800L Works without WiFi. Mobile App Flutter App Features: Live tracking Alert history Guardian management AI recommendations 17. Deployment Guide Hardware Assembly Connect ESP32. Connect GPS. Connect SOS button. Connect LED and buzzer. Verify wiring. Software Setup Install Arduino IDE. Install ESP32 Board Package. Install required libraries. Upload code. Cloud Setup Create Telegram bot. Configure n8n workflow. Connect Google Sheets. Create ThingSpeak channel. Test webhook. Testing Test Case 1 Press SOS button. Expected: Buzzer ON Telegram alert received Sheet updated ThingSpeak updated Test Case 2 Battery low. Expected: AI predicts low battery. Notification generated. 18. Expected Output When SOS is pressed: 🚨 WOMEN SAFETY ALERT 🚨 Emergency Triggered Latitude: 17.3850 Longitude: 78.4867 Google Maps: https://maps.google.com/?q=17.3850,78.4867 Threat Level: HIGH Battery: 72% Timestamp: 2026-06-01 10:15:20 Project Outcomes Real-time emergency response. Cloud-connected IoT safety device. AI-assisted threat assessment. Automated voice alerts. Incident logging and analytics. Scalable smart-city safety solution. This architecture is suitable for a final-year B.Tech/M.Tech engineering project, research prototype, startup MVP, or smart safety deployment with AI + IoT + Agentic Automation integration.

Sunday, 31 May 2026

AI-Based Real-Time Air Pollution Monitoring and Prediction

AI-Based Real-Time Air Pollution Monitoring and Prediction System ESP32 + AI Agent + IoT Cloud + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Dashboard
AI-Based Real-Time Air Pollution Monitoring and Prediction System Project Overview This project develops an AI-Powered Real-Time Air Pollution Monitoring and Prediction System using ESP32, environmental sensors, Agentic AI Analytics, n8n Automation, Telegram Voice Alerts, Google Sheets Logging, and ThingSpeak Cloud Dashboard. The system continuously monitors air quality parameters, predicts future pollution trends using AI models, and automatically sends intelligent alerts when pollution levels exceed safe limits. Main Features Real-Time Monitoring Air Quality Index (AQI) PM2.5 Concentration PM10 Concentration Carbon Monoxide (CO) Carbon Dioxide (CO₂) Smoke Detection Temperature Humidity AI Analytics AQI Prediction Pollution Trend Analysis Risk Classification Anomaly Detection Power Consumption Forecasting Cloud Integration ThingSpeak Dashboard Google Sheets Database Telegram Notifications AI Agent Monitoring Interface Automation n8n Workflow Voice Alerts Automatic Data Logging AI Recommendations System Architecture Air Sensors │ ▼ ESP32 Controller │ WiFi Internet │ ▼ ThingSpeak Cloud │ ▼ n8n Workflow Engine │ ┌───┼─────────────┐ ▼ ▼ ▼ AI Agent Google Sheets Analysis Database │ ▼ Telegram Bot (Text + Voice Alerts) Components Required Component Quantity ESP32 Dev Board 1 MQ135 Air Quality Sensor 1 PMS5003 PM2.5 Sensor 1 DHT22 Temperature Sensor 1 OLED Display 0.96" 1 Buzzer Module 1 LED Indicators 3 Breadboard 1 Jumper Wires As Required 5V Power Supply 1 WiFi Internet Connection 1 Sensor Functions MQ135 Measures: CO₂ Smoke Air Quality Output Clean Air : < 200 Moderate Air : 200-400 Poor Air : > 400 PMS5003 Measures: PM1.0 PM2.5 PM10 Used for AQI calculation. DHT22 Measures: Temperature Humidity Environmental compensation. Circuit Connections MQ135 MQ135 → ESP32 VCC → 5V GND → GND AO → GPIO34 DHT22 DHT22 → ESP32 VCC → 3.3V GND → GND DATA → GPIO4 PMS5003 PMS5003 → ESP32 VCC → 5V GND → GND TX → GPIO16 (RX2) RX → GPIO17 (TX2) OLED Display OLED → ESP32 VCC → 3.3V GND → GND SDA → GPIO21 SCL → GPIO22 Buzzer Positive → GPIO27 Negative → GND Circuit Schematic +-------------------+ | ESP32 | | | MQ135 --->| GPIO34 | DHT22 --->| GPIO4 | PMS TX -->| GPIO16 | PMS RX -->| GPIO17 | OLED SDA->| GPIO21 | OLED SCL->| GPIO22 | BUZZER -->| GPIO27 | +-------------------+ Flowchart Start │ Initialize Sensors │ Connect WiFi │ Read Sensor Values │ Calculate AQI │ Upload ThingSpeak │ Store Google Sheets │ AI Prediction │ Check Threshold │ Send Telegram Alert │ Generate Voice Message │ Repeat AQI Prediction Logic Inputs PM2.5 PM10 CO2 Temperature Humidity AI Formula Predicted AQI AQI Future = 0.5 × PM2.5 + 0.3 × PM10 + 0.1 × CO2 + 0.1 × Temperature Classification AQI Status 0-50 Good 51-100 Moderate 101-150 Unhealthy 151-200 Very Unhealthy >200 Hazardous ESP32 Source Code Structure Required Libraries WiFi.h HTTPClient.h DHT.h ThingSpeak.h ArduinoJson.h WiFi Setup const char* ssid = "YOUR_WIFI"; const char* password = "PASSWORD"; ThingSpeak Setup unsigned long channelID = XXXXX; const char* writeAPIKey = "WRITE_KEY"; Sensor Reading Function float temperature = dht.readTemperature(); float humidity = dht.readHumidity(); int mq135 = analogRead(34); float pm25 = getPM25(); float pm10 = getPM10(); AQI Calculation float AQI = (pm25*0.5) + (pm10*0.3) + (mq135*0.2); Upload to ThingSpeak ThingSpeak.setField(1, pm25); ThingSpeak.setField(2, pm10); ThingSpeak.setField(3, AQI); ThingSpeak.writeFields( channelID, writeAPIKey ); ThingSpeak Dashboard Setup Create Channel Fields: Field1 = PM2.5 Field2 = PM10 Field3 = AQI Field4 = CO2 Field5 = Temperature Field6 = Humidity Dashboard Widgets AQI Gauge PM2.5 Graph PM10 Graph Temperature Graph Humidity Graph Pollution Heatmap Google Sheets Integration Create Sheet Timestamp PM2.5 PM10 AQI Temperature Humidity Status n8n Webhook Receives { "pm25": 35, "pm10": 55, "aqi": 92, "temp": 30, "humidity": 70 } Append Row Node Automatically stores every reading. n8n Workflow Workflow Steps Webhook Trigger │ ▼ Data Validation │ ▼ AI Agent Analysis │ ▼ Google Sheets │ ▼ Threshold Check │ ▼ Telegram Message │ ▼ Telegram Voice Alert Sample n8n Workflow JSON Structure { "nodes":[ { "name":"Webhook" }, { "name":"Google Sheets" }, { "name":"Telegram" } ] } Telegram Bot Setup Step 1 Open Telegram Search: @BotFather Step 2 Create Bot /newbot Step 3 Copy Token 123456:ABCDEF Step 4 Get Chat ID https://api.telegram.org/botTOKEN/getUpdates Telegram Alert Message 🚨 Air Pollution Alert AQI: 175 Status: Very Unhealthy PM2.5: 120 PM10: 180 Recommendation: Wear mask and avoid outdoor activities. Voice Notification Automation n8n Process AQI > 150 │ Generate Text │ Text-to-Speech │ Telegram Voice Message Voice Message Example Warning. Air quality is unhealthy. AQI has reached one hundred seventy five. Avoid outdoor activities. AI Agent Analytics The AI Agent continuously evaluates: Pollution Trend Increasing Stable Decreasing Health Risk Low Risk Medium Risk High Risk Prediction Horizon 1 Hour 6 Hours 24 Hours Recommendations Wear Mask Close Windows Avoid Outdoor Exercise Use Air Purifier Power Consumption Prediction Data Used WiFi Usage Sensor Sampling Rate OLED ON Time Cloud Upload Frequency Simple Model Power = ESP32 Current + Sensor Current + Display Current Predicted Daily Usage 0.8 to 1.5 Wh/day IoT Web Dashboard Features Live Monitoring Current AQI PM2.5 PM10 CO2 Temperature Humidity AI Panel Future AQI Pollution Forecast Risk Level Recommendations Alert Panel Last Alert Voice Alert History Telegram Logs Future Enhancements Machine Learning Random Forest AQI Prediction LSTM Time-Series Forecasting XGBoost Prediction Models Advanced Sensors SDS011 BME680 CCS811 SGP30 Mobile App Flutter Dashboard Push Notifications Live Maps Smart City Integration Multiple ESP32 Nodes Central Cloud Server GIS Pollution Mapping Deployment Guide Indoor Installation Schools Hospitals Offices Laboratories Outdoor Installation Traffic Junctions Industrial Zones Smart Cities Construction Sites Final Outcome This project creates a complete Industry 4.0 AI-Powered Air Pollution Monitoring Platform combining: ✅ ESP32 IoT Monitoring ✅ Real-Time AQI Calculation ✅ AI Agent Analytics ✅ n8n Workflow Automation ✅ Google Sheets Database ✅ Telegram Text Alerts ✅ Telegram Voice Notifications ✅ ThingSpeak Cloud Dashboard ✅ Pollution Forecasting ✅ Power Consumption Prediction ✅ Cloud-Based Monitoring ✅ Smart City Ready Architecture ✅ Environmental Safety Intelligence System The result is a scalable, low-cost, AI-enabled environmental monitoring solution capable of detecting pollution in real time, predicting future air-quality conditions, and automatically notifying users through cloud dashboards and voice alerts.

AI-Based Intelligent Fire Fighting Robot with Vision Navigation

AI-Based Intelligent Fire Fighting Robot with Vision Navigation ESP32 + AI Agent + IoT Cloud + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Dashboard
AI-Based Intelligent Fire Fighting Robot with Vision Navigation ESP32 + AI Agent + IoT Cloud + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Dashboard 1. Project Overview The AI-Based Intelligent Fire Fighting Robot is an autonomous robot capable of: Detecting fire using flame sensors Navigating toward fire sources Avoiding obstacles automatically Activating a water pump to extinguish fire Sending real-time alerts through Telegram Uploading sensor data to ThingSpeak Storing logs in Google Sheets Using AI Agent analytics for predictive monitoring Generating voice notifications via Telegram Providing cloud-based remote monitoring This project combines: ESP32 IoT Controller Computer Vision Navigation AI Agent Analytics n8n Workflow Automation Google Sheets Cloud Logging ThingSpeak IoT Dashboard Telegram Alert System 2. System Architecture Flame Sensor | | Ultrasonic Sensor | | ESP32 Controller | -------------------------------- | | | | | | ThingSpeak Telegram Bot Google Sheets | | | -------------------------------- | n8n Server | AI Agent | Voice Notifications 3. Major Features Fire Detection Flame Sensor detects fire Multiple detection zones Vision Navigation ESP32-CAM identifies fire location Robot rotates toward fire source Obstacle Avoidance Ultrasonic sensor detects objects Robot changes path automatically Fire Extinguishing Water pump activated automatically Cloud Monitoring Real-time dashboard AI Prediction Predicts: Battery usage Water consumption Fire occurrence patterns 4. Hardware Components List Component Quantity ESP32 Dev Board 1 ESP32-CAM Module 1 Flame Sensor 3 Ultrasonic Sensor HC-SR04 1 L298N Motor Driver 1 DC Gear Motors 2 Water Pump 5V 1 Relay Module 1 Servo Motor SG90 1 Li-ion Battery Pack 1 Robot Chassis 1 Jumper Wires As required Water Tank 1 Buzzer 1 LED Indicators 2 5. Working Principle Step 1 Robot continuously scans surroundings. Step 2 Flame sensors detect fire. Step 3 ESP32 receives fire coordinates. Step 4 Robot moves toward flame. Step 5 Obstacle avoidance activates if necessary. Step 6 Water pump turns ON. Step 7 Fire extinguished. Step 8 Alert sent to: Telegram Google Sheets ThingSpeak Step 9 AI Agent analyzes event. 6. Pin Connections Flame Sensors Flame Sensor ESP32 OUT1 GPIO34 OUT2 GPIO35 OUT3 GPIO32 Ultrasonic Sensor HC-SR04 ESP32 Trig GPIO5 Echo GPIO18 Motor Driver L298N ESP32 IN1 GPIO12 IN2 GPIO13 IN3 GPIO14 IN4 GPIO27 Relay Module Relay ESP32 IN GPIO26 Servo Motor Servo ESP32 Signal GPIO25 7. Circuit Schematic Flame Sensors | | ESP32 Board / | \ / | \ Motor WiFi Relay Driver | | | Motors Water Pump | Fire Control ESP32 ----> ThingSpeak ESP32 ----> Telegram ESP32 ----> n8n ESP32 ----> Google Sheets 8. Flowchart Start | Initialize ESP32 | Connect WiFi | Read Sensors | Fire Detected? | Yes | Move Toward Fire | Obstacle Present? | Yes --> Avoid Obstacle | No | Activate Pump | Fire Extinguished? | Yes | Send Alert | Update Cloud | Store Data | Repeat 9. ESP32 Source Code Structure Required Libraries WiFi.h HTTPClient.h ThingSpeak.h ESP32Servo.h Variables const char* ssid="WiFi_Name"; const char* password="WiFi_Password"; long channelID = 123456; const char* apiKey = "THINGSPEAK_KEY"; Flame Detection int flame1=digitalRead(34); int flame2=digitalRead(35); int flame3=digitalRead(32); if(flame1==0 || flame2==0 || flame3==0) { fireDetected(); } Pump Activation digitalWrite(RELAY,HIGH); delay(5000); digitalWrite(RELAY,LOW); Upload Data ThingSpeak.setField(1,temperature); ThingSpeak.setField(2,fireStatus); ThingSpeak.writeFields(channelID,apiKey); 10. ThingSpeak Dashboard Setup Create Account Register at: ThingSpeak Create Channel Fields: Fire Status Temperature Distance Battery Voltage Water Level Motor Status Copy Channel ID Write API Key Insert into ESP32 code. 11. Telegram Bot Setup Step 1 Open: Telegram BotFather Step 2 Create new bot. /newbot Step 3 Get: BOT TOKEN Step 4 Find Chat ID. Send Alert Example https://api.telegram.org/botTOKEN/sendMessage Message: 🔥 FIRE DETECTED Robot Activated Pump Running Location Protected 12. Google Sheets Integration Create Sheet Columns: Date Time Fire Status Distance Battery Water Level Pump Status Create Google Apps Script function doPost(e) { var sheet= SpreadsheetApp.getActiveSpreadsheet() .getSheetByName("Data"); sheet.appendRow([ new Date(), e.parameter.fire, e.parameter.distance, e.parameter.battery ]); return ContentService .createTextOutput("Success"); } Deploy as: Web App Anyone Access 13. n8n Automation Workflow Install n8n Official website: n8n Automation Platform Workflow Webhook | ESP32 Data | IF Fire Detected | Telegram Node | Google Sheets Node | AI Agent Node | Voice Alert Node 14. n8n Workflow JSON Structure { "nodes":[ { "name":"Webhook" }, { "name":"IF Fire" }, { "name":"Telegram" }, { "name":"Google Sheets" }, { "name":"AI Agent" } ] } 15. AI Agent Analytics AI Agent continuously analyzes: Fire frequency Battery consumption Water tank usage Motor runtime Sensor health Outputs: Normal Warning Critical 16. AI Power Consumption Prediction Logic Inputs Motor Runtime Pump Runtime Battery Voltage WiFi Usage Formula Daily Power: P=V×I Energy: E=P×t Example Battery = 12V Motor = 1A Pump = 2A Total Current = 3A Power = 36W 2 Hours Usage Energy = 72Wh AI predicts: Remaining Battery Recharge Time Future Consumption 17. Telegram Voice Notification Automation Event Trigger Fire detected. n8n Process Fire Event | Generate Voice | Convert Text-to-Speech | Send Telegram Audio Voice Message: Warning. Fire detected. Robot has started extinguishing operation. 18. AI Agent Prompt Example Analyze incoming fire robot data. Check: - Fire frequency - Battery status - Water tank level - Motor health Generate: - Risk level - Maintenance suggestions - Prediction report 19. Future Enhancements Computer Vision AI Smoke recognition Human detection Fire localization GPS Tracking Outdoor firefighting robots Edge AI On-device fire classification Drone Integration Fire surveillance Multi-Robot Collaboration Swarm firefighting system 20. Deployment Guide Phase 1 Hardware Assembly Phase 2 ESP32 Programming Phase 3 Sensor Calibration Phase 4 ThingSpeak Dashboard Phase 5 Google Sheets Logging Phase 6 Telegram Bot Integration Phase 7 n8n Workflow Deployment Phase 8 AI Agent Analytics Phase 9 Field Testing Phase 10 Production Deployment Final Outcome This project delivers a complete Industry 4.0 Intelligent Fire Fighting Robot platform featuring: ✅ ESP32 IoT Monitoring ✅ Vision-Based Fire Navigation ✅ Autonomous Fire Extinguishing ✅ AI Agent Analytics ✅ n8n Workflow Automation ✅ Google Sheets Database Logging ✅ Telegram Text & Voice Alerts ✅ ThingSpeak Cloud Dashboard ✅ AI Power Consumption Prediction ✅ Cloud-Based Monitoring & Reporting ✅ Predictive Maintenance Analytics ✅ Real-Time Emergency Notifications ✅ Scalable Smart Safety Infrastructure

AI-Based Industrial Fault Prediction and Monitoring System

AI-Based Industrial Fault Prediction and Monitoring System AI-Powered ESP32 + Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
AI-Based Industrial Fault Prediction and Monitoring System AI-Powered ESP32 + Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard 1. Project Overview Project Title AI-Based Industrial Fault Prediction and Monitoring System Using ESP32, AI Agent, n8n Automation, Telegram Voice Alerts, Google Sheets, and ThingSpeak Cloud Objective Develop an Industry 4.0 smart industrial monitoring platform capable of: Monitoring machine temperature Monitoring vibration levels Monitoring current consumption Monitoring humidity Predicting machine faults using AI Sending instant alerts Logging data to cloud Providing dashboard visualization Generating voice notifications Predicting power consumption trends The system continuously monitors machine health and predicts failures before breakdowns occur. 2. System Architecture Industrial Machine │ ▼ Sensors Layer ┌─────────────────┐ │ DHT22 │ │ Vibration SW420 │ │ ACS712 Current │ │ LM35 Temperature│ └─────────────────┘ │ ▼ ESP32 │ ▼ WiFi Network │ ┌──────┼───────────┐ ▼ ▼ ▼ ThingSpeak Google Sheets n8n Automation Server │ ▼ AI Agent Engine │ ┌─────────┴────────┐ ▼ ▼ Telegram Alerts Voice Alerts 3. Features Real-Time Monitoring Temperature Humidity Vibration Current Consumption AI Prediction Fault Prediction Power Usage Forecast Machine Health Analysis Cloud Services ThingSpeak Dashboard Google Sheets Storage Automation n8n Workflow Telegram Bot Voice Notifications 4. Components Required Component Quantity ESP32 Dev Board 1 DHT22 Sensor 1 SW420 Vibration Sensor 1 ACS712 Current Sensor 1 LM35 Temperature Sensor 1 Breadboard 1 Jumper Wires Several 5V Power Supply 1 WiFi Router 1 Computer 1 5. Pin Connections DHT22 DHT22 ESP32 VCC 3.3V GND GND DATA GPIO4 SW420 SW420 ESP32 VCC 3.3V GND GND OUT GPIO27 ACS712 ACS712 ESP32 VCC 5V GND GND OUT GPIO34 LM35 LM35 ESP32 VCC 5V GND GND OUT GPIO35 6. Circuit Schematic Diagram +----------------+ | ESP32 | | | GPIO4 <---- DHT22 DATA GPIO27 <---- SW420 OUT GPIO34 <---- ACS712 OUT GPIO35 <---- LM35 OUT | | WiFi ▼ Cloud Services 7. Flowchart Start │ ▼ Initialize ESP32 │ ▼ Connect WiFi │ ▼ Read Sensors │ ▼ Calculate Parameters │ ▼ AI Prediction │ ▼ Fault Detected? │ ┌───────┴─────────┐ │ │ Yes No │ │ ▼ ▼ Send Alerts Store Data │ │ ▼ ▼ Update Cloud Dashboard │ ▼ Repeat 8. ESP32 Source Code #include #include #include #define DHTPIN 4 #define DHTTYPE DHT22 DHT dht(DHTPIN,DHTTYPE); const char* ssid="YOUR_WIFI"; const char* password="YOUR_PASSWORD"; String apiKey="THINGSPEAK_API_KEY"; void setup() { Serial.begin(115200); dht.begin(); WiFi.begin(ssid,password); while(WiFi.status()!=WL_CONNECTED) { delay(500); } } void loop() { float humidity=dht.readHumidity(); float temperature=dht.readTemperature(); int vibration=digitalRead(27); int currentRaw=analogRead(34); float current=currentRaw*0.026; int lm35=analogRead(35); float machineTemp=(lm35*3.3*100)/4095; String health="Normal"; if(machineTemp>60 || vibration==1) { health="Fault Predicted"; } if(WiFi.status()==WL_CONNECTED) { HTTPClient http; String url= "http://api.thingspeak.com/update?api_key=" +apiKey+ "&field1="+String(temperature)+ "&field2="+String(humidity)+ "&field3="+String(machineTemp)+ "&field4="+String(current)+ "&field5="+String(vibration); http.begin(url); http.GET(); http.end(); } delay(15000); } 9. AI Fault Prediction Logic Input Parameters Temperature Humidity Current Vibration AI Rules Critical Fault Temp > 70°C AND Current > 15A AND Vibration = HIGH Result: Machine Failure Likely Warning Temp > 60°C OR Current > 10A Result: Maintenance Required Normal All parameters within limits Result: Healthy Machine 10. Power Consumption Prediction Formula: P=V×I Example: Voltage = 230V Current = 5A Power = 1150W AI Agent stores historical data and predicts: Next hour power usage Daily energy usage Monthly energy consumption 11. ThingSpeak Dashboard Setup Create Channel Fields: Field 1: Temperature Field 2: Humidity Field 3: Machine Temperature Field 4: Current Field 5: Vibration Field 6: Fault Status Dashboard Widgets Gauge Line Chart Fault Indicator Energy Consumption Graph 12. Google Sheets Integration Create Sheet: Timestamp Temperature Humidity Current Vibration MachineTemp Status Prediction 13. n8n Workflow Workflow Logic Webhook │ ▼ Receive ESP32 Data │ ▼ AI Analysis Node │ ▼ IF Fault? │ ┌─┴───────────┐ ▼ ▼ Telegram Google Sheet Alert Update n8n Workflow JSON Structure { "nodes":[ { "name":"Webhook" }, { "name":"AI Agent" }, { "name":"IF Fault" }, { "name":"Telegram" }, { "name":"Google Sheets" } ] } 14. Telegram Bot Setup Step 1 Open Telegram Search: @BotFather Create bot: /newbot Step 2 Get: BOT TOKEN Step 3 Get Chat ID Send: /start Use chat ID API. 15. Telegram Alert Messages Text Alert ⚠ INDUSTRIAL ALERT Machine Temperature : 75°C Current : 12A Vibration : HIGH Prediction : Bearing Failure Expected Immediate Inspection Required. 16. Voice Notification Automation n8n uses: Text Warning. Machine Number 3. Abnormal vibration detected. Maintenance required. Convert To Speech Using: Telegram Voice Google TTS OpenAI TTS Edge TTS Send Voice Message Telegram Voice Notification 🎤 Voice Alert Sent 17. AI Agent Analytics The AI Agent performs: Root Cause Analysis Example: High Temperature + High Current Cause: Motor Overloading Predictive Maintenance Example: Bearing Wear Motor Failure Cooling Fan Fault Power Supply Issues 18. Cloud Dashboard Features Real-Time Machine Status Live Charts Sensor Monitoring Historical Daily Reports Weekly Reports Monthly Reports AI Analytics Fault Prediction Energy Forecasting Maintenance Suggestions 19. Future Enhancements Machine Learning Random Forest XGBoost LSTM Prediction Edge AI Run TinyML directly on ESP32 Computer Vision Add camera-based fault detection Digital Twin Virtual machine monitoring Multi-Machine Monitoring 100+ industrial machines Mobile App Android and iOS app MQTT Industrial-grade communication AWS/Azure Integration Enterprise deployment 20. Deployment Guide Small Factory 1 ESP32 1 Machine ThingSpeak Dashboard Medium Industry 10 ESP32 Nodes Central n8n Server Google Sheets Database Large Industry 100+ ESP32 Devices MQTT Broker AI Analytics Server Cloud Dashboard ERP Integration Final Outcome This project creates a complete Industry 4.0 AI-Based Industrial Fault Prediction and Monitoring Platform combining: ✅ ESP32 IoT Monitoring ✅ Temperature, Vibration & Current Sensing ✅ AI Agent Fault Prediction Analytics ✅ n8n Workflow Automation ✅ Google Sheets Database Logging ✅ Telegram Text & Voice Alerts ✅ ThingSpeak Cloud Dashboard ✅ Power Consumption Prediction ✅ Predictive Maintenance System ✅ Cloud-Based Industrial Monitoring Solution ✅ Scalable Smart Factory Deployment Architecture ✅ Real-Time Fault Detection and Early Warning System