Thursday, 18 June 2026

AI-Based Intelligent Fire Fighting Robot with Vision Navigation

Below is a complete, structured end-to-end documentation for your: 🤖 AI-Based Intelligent Fire Fighting Robot (ESP32 + Vision + IoT + n8n + Telegram Alerts) This system is an Agentic IoT fire-fighting robot built using: ESP32 n8n Telegram Google Sheets ThingSpeak
Here is your complete project documentation converted into a single PHP webpage file format. You can save it as: 👉 fire_fighting_robot.php AI Fire Fighting Robot - IoT Project

🤖 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
🚀 How to Run Save file as: fire_fighting_robot.php Run using: XAMPP / WAMP / Laragon Place file in htdocs folder Open browser: http://localhost/fire_fighting_robot.php If you want next upgrades, I can also build: 🔥 Admin Dashboard (PHP + MySQL) 📊 Real-time IoT live graph dashboard 🤖 AI chat assistant inside webpage 📱 Mobile responsive UI (Bootstrap version) 🌐 Full final year project website Just tell me 👍

AI-Based Real-Time Air Pollution Monitoring and Prediction

Below is a complete, structured, end-to-end documentation for your project: 🌍 AI-Based Real-Time Air Pollution Monitoring & Prediction System (ESP32 + IoT + n8n Automation + Telegram Voice Alerts + ThingSpeak + Google Sheets + AI Prediction)
Below is your complete project documentation converted into a single PHP file format (ready for a website/webpage display). You can save this as: air_pollution_iot_project.php and run it on XAMPP / WAMP / Laravel / any PHP server. ✅ PHP FILE (FULL WEBPAGE FORMAT) AI IoT Air Pollution Monitoring System

🌍 AI-Based Real-Time Air Pollution Monitoring System

ESP32 + IoT + n8n Automation + Telegram Alerts + ThingSpeak + AI Prediction


1. 🚀 Project Overview

This system monitors air quality using ESP32 sensors and sends real-time data to cloud platforms. It uses AI to predict pollution levels and sends Telegram alerts with voice notifications.

2. 🧰 Components List

  • ESP32 Development Board
  • MQ-135 Air Quality Sensor
  • DHT11 Temperature & Humidity Sensor
  • Jumper Wires
  • WiFi Connection
  • ThingSpeak + Google Sheets + Telegram Bot

3. 🏗 System Architecture

MQ Sensors → ESP32 → WiFi → ThingSpeak
                     ↓
                 n8n Automation
                     ↓
 Google Sheets + Telegram Alerts + AI Prediction

4. ⚡ Circuit Diagram (Connections)

  • MQ135 → GPIO 34
  • DHT11 → GPIO 4
  • VCC → 5V
  • GND → GND

5. 💻 ESP32 Code

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

#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

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

const char* server = "api.thingspeak.com";
String apiKey = "YOUR_API_KEY";

int mq135Pin = 34;

void setup() {
  Serial.begin(115200);
  dht.begin();
  WiFi.begin(ssid, password);

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

void loop() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  int airValue = analogRead(mq135Pin);

  float AQI = map(airValue, 0, 4095, 0, 500);

  WiFiClient client;
  if (client.connect(server, 80)) {
    String url = "/update?api_key=" + apiKey +
                 "&field1=" + String(AQI) +
                 "&field2=" + String(t) +
                 "&field3=" + String(h);

    client.print("GET " + url + " HTTP/1.1\r\nHost: api.thingspeak.com\r\nConnection: close\r\n\r\n");
  }

  delay(15000);
}

6. 🔁 n8n Workflow Logic

Webhook → Google Sheets → IF AQI Check → Telegram Alert

7. 🤖 Telegram Bot Setup

  • Open Telegram → BotFather
  • Create bot using /newbot
  • Copy API Token

8. 📊 Google Sheets Setup

  • Create sheet with columns: Time, AQI, Temperature, Humidity
  • Enable Google Sheets API
  • Connect in n8n

9. ☁️ ThingSpeak Setup

  • Create channel
  • Fields: AQI, Temp, Humidity
  • Use API Key in ESP32 code

10. 🧠 AI Prediction Logic

from sklearn.linear_model import LinearRegression
import pandas as pd

data = pd.read_csv("aqi.csv")

X = data[["temperature", "humidity", "aqi"]]
y = data["future_aqi"]

model = LinearRegression()
model.fit(X, y)

11. 🔊 Voice Alerts

  • Use Google TTS API or ElevenLabs API
  • Convert alert text → voice
  • Send via Telegram Bot

12. 🚨 AQI Alert Levels

  • 0–50 → Good
  • 51–100 → Moderate
  • 101–150 → Unhealthy for sensitive people
  • 151–200 → Unhealthy
  • 200+ → Hazardous

13. 🚀 Future Enhancements

  • Mobile App Dashboard
  • LSTM AI Forecasting
  • GPS Pollution Mapping
  • Edge AI on ESP32-S3

✔ Project Completed: AI Agentic IoT Air Pollution System

🚀 What you get from this PHP file ✔ Full website documentation ✔ Clean UI for project presentation ✔ Ready for college submission ✔ Works on XAMPP / hosting server ✔ Includes code + architecture + AI + IoT flow If you want next upgrade 👇 I can also convert this into: 🌐 Professional portfolio website (React + PHP backend) 📱 Mobile-friendly dashboard (Bootstrap UI) 🤖 Live real-time dashboard with charts (Chart.js) 🔥 Admin panel + login system 📡 Live ESP32 data visualization web app Just tell 👍

AI-Based Sign Language to Speech Conversion System

Below is a complete step-by-step documentation for your project: 🤖 AI-Based Sign Language to Speech Conversion System 🌐 ESP32 + IoT + AI Agent + n8n Automation + Telegram + Google Sheets + ThingSpeak
Below is your complete project documentation converted into a PHP file format. You can directly save it as: sign_language_iot_project.php ESP32 Sensor Reading -> WiFi/MQTT Transmission -> n8n Webhook Trigger -> AI Gesture Classification -> Output: - Telegram Voice Alert - Google Sheets Logging - ThingSpeak Dashboard - Speech Output ----------------------------------------------------------- COMPONENTS LIST ----------------------------------------------------------- Hardware: - ESP32 Development Board - Flex Sensors (5 fingers) OR MPU6050 - Jumper Wires - Breadboard - 5V Power Supply - Optional OLED Display Software: - Arduino IDE - n8n Automation Tool - Telegram Bot API - Google Sheets API - ThingSpeak IoT Platform - AI Python Backend (optional) ----------------------------------------------------------- ESP32 SOURCE CODE (REFERENCE) ----------------------------------------------------------- */ ?>
#include <WiFi.h>
#include <HTTPClient.h>

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

String serverUrl = "http://YOUR_N8N_WEBHOOK_URL";

int flexPins[5] = {34, 35, 32, 33, 36};

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

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting...");
  }
  Serial.println("Connected to WiFi");
}

void loop() {
  int sensorData[5];

  for (int i = 0; i < 5; i++) {
    sensorData[i] = analogRead(flexPins[i]);
  }

  String jsonData = "{";
  jsonData += "\"f1\":" + String(sensorData[0]) + ",";
  jsonData += "\"f2\":" + String(sensorData[1]) + ",";
  jsonData += "\"f3\":" + String(sensorData[2]) + ",";
  jsonData += "\"f4\":" + String(sensorData[3]) + ",";
  jsonData += "\"f5\":" + String(sensorData[4]);
  jsonData += "}";

  if (WiFi.status() == WL_CONNECTED) {
    HTTPClient http;
    http.begin(serverUrl);
    http.addHeader("Content-Type", "application/json");

    int response = http.POST(jsonData);
    Serial.println(response);

    http.end();
  }

  delay(3000);
}
AI Function Node -> Telegram Node -> Google Sheets Example AI Logic: if (f1 > 2000 && f2 < 1500) => HELLO if (f3 > 2000) => HELP ----------------------------------------------------------- TELEGRAM BOT SETUP ----------------------------------------------------------- Steps: 1. Open Telegram 2. Search BotFather 3. Create bot using /newbot 4. Get API Token 5. Connect token in n8n Telegram Node ----------------------------------------------------------- GOOGLE SHEETS STRUCTURE ----------------------------------------------------------- Columns: Timestamp | Gesture | F1 | F2 | F3 | F4 | F5 ----------------------------------------------------------- THINGSPEAK SETUP ----------------------------------------------------------- Channel Fields: Field1 = Gesture Field2 = Sensor Average API Example: https://api.thingspeak.com/update?api_key=YOUR_KEY&field1=HELLO ----------------------------------------------------------- AI POWER PREDICTION LOGIC ----------------------------------------------------------- Formula: Power = Base + (Sensor Load × Transmission Factor) Example: function predictPower($gesturesPerMin) { $base = 0.5; $tx = 0.2 * $gesturesPerMin; return $base + $tx; } ----------------------------------------------------------- VOICE NOTIFICATION FLOW ----------------------------------------------------------- Gesture -> Text -> TTS Engine -> Audio -> Telegram Voice Message ----------------------------------------------------------- FUTURE ENHANCEMENTS ----------------------------------------------------------- - CNN-based sign recognition - Camera-based gesture detection - MQTT instead of HTTP - Edge AI on ESP32-S3 - Mobile app dashboard ----------------------------------------------------------- END OF PROJECT FILE ----------------------------------------------------------- */ ?> If you want, I can also convert this into: 🌐 Fully working PHP website dashboard (live IoT panel) 📊 Real-time web dashboard with charts (ThingSpeak + JS) 📱 Mobile-friendly UI version ⚡ Complete GitHub project structure Just tell me 👍

AI-Based Smart ATM Security System with Face Recognition

Below is a complete, step-by-step professional documentation for your: 🚀 AI-Based Smart ATM Security System (ESP32 + Face Recognition + IoT + n8n Automation + Telegram Alerts + Google Sheets + ThingSpeak + AI Agentic Workflow)
https://svsembedded.wordpress.com/2026/06/18/ai-based-smart-atm-security-system-with-face-recognition-2/ Below is a complete PHP-based documentation webpage version of your project. You can directly save it as: 👉 atm_security_system.php It will render as a full webpage describing your AI + IoT ATM Security System. ✅ 📄 PHP FILE: atm_security_system.php AI-Based Smart ATM Security System

🚀 AI-Based Smart ATM Security System

ESP32 + Face Recognition + IoT + n8n Automation + Telegram Alerts

📌 Project Overview

This system uses ESP32-CAM with AI-based face recognition to secure ATM access. It integrates IoT cloud platforms, Telegram alerts, Google Sheets logging, and n8n automation workflows.

🧰 Components List

  • ESP32-CAM module
  • FTDI Programmer
  • PIR Motion Sensor
  • Buzzer
  • Relay Module
  • Power Supply

🔌 Circuit Connections

PIR Sensor → GPIO 13
Buzzer     → GPIO 12
Relay      → GPIO 14
FTDI TX    → U0R
FTDI RX    → U0T
VCC        → 5V
GND        → GND
    

🔄 System Flow

Motion Detected → Capture Face → AI Verification
        ↓
Authorized → Grant Access
Unauthorized → Trigger Alarm + Send Alerts
        ↓
Log to Google Sheets + ThingSpeak
        ↓
n8n Automation → Telegram Notification
    

💻 ESP32 Sample Code

#include "esp_camera.h"
#include 

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

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
}

void loop() {
  Serial.println("Monitoring ATM...");
  delay(2000);
}
    

⚙️ n8n Automation Flow

Webhook Trigger → Telegram Alert → Google Sheets → ThingSpeak Update
    

📲 Telegram Bot Setup

Create Bot via BotFather:
/newbot

API Format:
https://api.telegram.org/bot/sendMessage
    

☁️ ThingSpeak Setup

https://api.thingspeak.com/update?api_key=API_KEY&field1=1
    

🧠 AI Power Prediction

if motion_events > 50:
    power = "HIGH"
elif motion_events > 20:
    power = "MEDIUM"
else:
    power = "LOW"
    

🚀 Future Enhancements

  • DeepFace AI recognition
  • Anti-spoofing detection
  • Mobile app dashboard
  • Blockchain security logs

© 2026 Smart ATM Security System | IoT + AI Project

🚀 How to Run Save file as: atm_security_system.php Place in: htdocs (XAMPP) / www (WAMP) Start Apache server Open in browser: http://localhost/atm_security_system.php 💡 If you want next upgrades, I can also build: ✔ Admin login panel (PHP + MySQL) ✔ Real-time ESP32 data dashboard ✔ Face recognition API backend (Python + Flask + PHP bridge) ✔ Live Telegram control panel ✔ AI fraud detection web app Just tell me 👍

AI-Based Smart Battery Management System for EV Applications

Below is a complete, structured engineering documentation for your project: 🚀 AI-Based Smart Battery Management System for EV Applications (ESP32 + IoT + n8n + AI Agent + Telegram Voice Alerts + Google Sheets + ThingSpeak)
Below is your complete project documentation converted into a single PHP webpage file format. You can directly save it as: index.php and run it on XAMPP / WAMP / any PHP server. ✅ 📄 FULL PHP WEBPAGE (IoT + AI BMS Documentation) AI-Based Smart Battery Management System (EV)

🚀 AI-Based Smart Battery Management System for EV Applications

📌 Project Overview

This project is an AI-powered Smart Battery Management System using ESP32, IoT cloud platforms, n8n automation, Telegram alerts, Google Sheets logging, and ThingSpeak dashboard for EV applications.

⚡ System Architecture

ESP32 Sensors → WiFi → ThingSpeak / n8n Webhook → AI Processing →
Decision Engine → Telegram Alerts → Google Sheets Logging

🔋 Components List

  • ESP32 Microcontroller
  • Voltage Sensor Module
  • Current Sensor (INA219 / ACS712)
  • Temperature Sensor
  • Relay Module
  • OLED Display (optional)
  • Battery Pack

🔌 Circuit Diagram (Text)

Battery → Voltage Sensor → ESP32 GPIO34
Current Sensor → I2C (SDA/SCL)
Temperature Sensor → GPIO 4
Relay → GPIO 26
Buzzer → GPIO 27

💻 ESP32 Code

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

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

String server = "http://api.thingspeak.com/update?api_key=YOUR_KEY";

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
}

void loop() {
  float voltage = analogRead(34);
  float current = analogRead(35);
  float temp = analogRead(32);

  if(WiFi.status() == WL_CONNECTED){
    HTTPClient http;
    String url = server +
    "&field1=" + String(voltage) +
    "&field2=" + String(current) +
    "&field3=" + String(temp);

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

  delay(5000);
}

⚙️ n8n Automation Flow

Webhook → IF Condition (Battery Check) →
Telegram Alert → Google Sheets Log

📲 Telegram Bot Setup

  1. Create bot using BotFather
  2. Get API Token
  3. Use token in n8n Telegram node
  4. Get Chat ID from getUpdates API

📊 Google Sheets Integration

Store real-time battery data such as voltage, current, temperature, SOC, and alerts.

☁️ ThingSpeak Dashboard

Used for real-time IoT visualization of EV battery parameters using channels and API keys.

🤖 AI Logic

Power = Voltage × Current

If Temp > 45°C → Warning
If Voltage < 11V → Critical Alert
SOC = (Current / Capacity) × 100

🔊 Voice Alert System

Telegram + AI Text-to-Speech system sends voice alerts when battery is critical.

🚀 Future Enhancements

  • Machine Learning Battery Prediction
  • Mobile App Dashboard
  • GPS Tracking System
  • Edge AI on ESP32

📦 Deployment Steps

  1. Upload ESP32 code
  2. Configure WiFi
  3. Setup n8n workflow
  4. Connect Telegram Bot
  5. Enable ThingSpeak channel
  6. Connect Google Sheets

⚡ Smart EV Battery Management System | AI + IoT + Automation

🚀 What you get with this PHP file ✔ Full project documentation website ✔ Clean UI dashboard style ✔ Ready to host on XAMPP/WAMP ✔ Beginner-friendly IoT explanation page ✔ Works as project submission website 🔥 If you want next upgrade, I can also create: 🌐 Full multi-page PHP website (login + dashboard + charts) 📊 Live real-time ESP32 data dashboard in PHP + MySQL 📈 Chart.js battery analytics dashboard 🤖 AI prediction integrated PHP backend 📱 Mobile responsive IoT web app UI Just tell 👍

AI-Based Smart Bus Tracking and Passenger Monitoring System

AI-Based Smart Bus Tracking & Passenger Monitoring System Using ESP32 + AI Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak
AI Smart Bus Tracking System

🚍 AI-Based Smart Bus Tracking System

ESP32 + IoT + AI + n8n + Telegram + Google Sheets + ThingSpeak

Last Updated:

📌 Project Overview

This system uses ESP32 to track bus location, monitor passengers, predict power usage using AI logic and send alerts via Telegram.

🧠 Key Features

  • Live GPS Tracking
  • Passenger Counting System
  • AI Power Prediction
  • Cloud Dashboard (ThingSpeak)
  • Google Sheets Logging
  • Telegram Voice Alerts via n8n

🔧 Components Used

  • ESP32 Board
  • NEO-6M GPS Module
  • IR Sensors (2)
  • ACS712 Current Sensor
  • DHT11 Sensor
  • Buzzer

📡 System Architecture

Sensors → ESP32 → Cloud (ThingSpeak / Google Sheets)
                 ↓
              n8n Automation
                 ↓
        Telegram Voice Alerts + Dashboard
        

📊 AI Prediction Formula

Power Prediction:

P = (0.5 × Temperature) + (0.8 × Passenger Count) + (0.3 × Current)
        

🚨 Alert System Logic

if (passengerCount > 40) {
    sendTelegramAlert("Overcrowding detected!");
}
        

📥 ESP32 Data Flow

GPS → Latitude, Longitude
IR Sensors → Passenger Count
DHT11 → Temperature
ACS712 → Power Usage

All data → ThingSpeak + Google Sheets
        

🤖 n8n Automation Flow

Webhook Trigger
   ↓
Check Passenger Limit
   ↓
Generate Alert Message
   ↓
Send Telegram Voice Notification
   ↓
Store Data in Google Sheets
        

📲 Telegram Integration

BotFather → Create Bot
Get Token
Send API Request:

https://api.telegram.org/bot/sendMessage
        

☁️ ThingSpeak Setup

Channel Fields:
Field1 → Latitude
Field2 → Longitude
Field3 → Passenger Count
Field4 → Temperature
Field5 → Power Prediction
        

📈 Future Enhancements

  • AI Camera Passenger Detection
  • Mobile App Integration
  • Face Recognition for Driver
  • Smart Ticketing System
  • Edge AI (TinyML on ESP32)

🏁 Conclusion

This project is a complete AI-powered IoT transportation system combining ESP32, cloud computing, automation, and real-time analytics for smart city applications.

✅ OPTIONAL (API FILE FOR ESP32 → PHP SERVER) If you want ESP32 to send data to PHP instead of ThingSpeak: create file: api.php ✅ ESP32 CALL EXAMPLE String url = "http://yourserver.com/api.php?lat=" + String(latitude,6) + "&lon=" + String(longitude,6) + "&pass=" + String(passengerCount) + "&temp=" + String(temp); If you want next upgrade 🚀 I can also convert this into: 🔥 Full React Dashboard UI 📊 Live Map tracking (Leaflet / Google Maps) 🤖 AI ML model integration (Python backend) 📱 Mobile App (Flutter) ☁️ AWS / Firebase version 📡 Real-time WebSocket dashboard Just tell 👍

AI-Based Smart Flood Detection and Early Warning System

AI-Based Smart Healthcare Assistant Chatbot with IoT Sensors https://svsembedded.wordpress.com/2026/06/18/ai-based-smart-flood-detection-and-early-warning-system/ ESP32 + AI Agent + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
"; echo ""; echo "AI Smart Healthcare Assistant Project"; echo " "; echo ""; echo ""; echo "

AI-Based Smart Healthcare Assistant Chatbot with IoT Sensors

"; /* ===================================================== */ echo "
"; echo "

1. Project Overview

"; echo "

This project is an AI-powered Smart Healthcare Monitoring System using:

  • ESP32 Microcontroller
  • MAX30102 Heart Rate & SpO2 Sensor
  • DHT22 Temperature & Humidity Sensor
  • ThingSpeak Cloud Dashboard
  • n8n Automation
  • Telegram Bot Alerts
  • Google Sheets Logging
  • Voice Notification System
"; echo "
"; /* ===================================================== */ echo "
"; echo "

2. Components List

"; echo "
Component Quantity Purpose
ESP32 Dev Board 1 Main Controller
MAX30102 Sensor 1 Heart Rate & SpO2 Monitoring
DHT22 Sensor 1 Temperature & Humidity
OLED Display 1 Display Sensor Data
Buzzer 1 Emergency Alert
LEDs 2 Status Indicators
Breadboard 1 Circuit Prototyping
Jumper Wires Several Connections
"; echo "
"; /* ===================================================== */ echo "
"; echo "

3. Circuit Connections

"; echo "
Sensor ESP32 Pin
DHT22 DATA GPIO4
MAX30102 SDA GPIO21
MAX30102 SCL GPIO22
Buzzer GPIO18
OLED SDA GPIO21
OLED SCL GPIO22
"; echo "
"; /* ===================================================== */ echo "
"; echo "

4. System Flowchart

"; echo "
START

Initialize ESP32

Connect WiFi

Read Sensor Data

Analyze Health Conditions

Upload to ThingSpeak

Send Data to n8n

Store in Google Sheets

Check Alert Conditions

Send Telegram Voice Alert

Repeat Loop
"; echo "
"; /* ===================================================== */ echo "
"; echo "

5. ESP32 Arduino Source Code

"; echo "
#include <WiFi.h>
#include <HTTPClient.h>
#include "ThingSpeak.h"
#include "DHT.h"

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

WiFiClient client;

unsigned long channelID = YOUR_CHANNEL_ID;
const char* writeAPIKey = "YOUR_API_KEY";

#define DHTPIN 4
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

float temperature;
float humidity;
int heartRate = 78;
int spo2 = 97;

void setup(){
Serial.begin(115200);
WiFi.begin(ssid, password);

while(WiFi.status() != WL_CONNECTED){
delay(1000);
Serial.println("Connecting...");
}

ThingSpeak.begin(client);
dht.begin();
}

void loop(){
temperature = dht.readTemperature();
humidity = dht.readHumidity();

ThingSpeak.setField(1, temperature);
ThingSpeak.setField(2, humidity);
ThingSpeak.setField(3, heartRate);
ThingSpeak.setField(4, spo2);

ThingSpeak.writeFields(channelID, writeAPIKey);

delay(15000);
}
"; echo "
"; /* ===================================================== */ echo "
"; echo "

6. ThingSpeak Setup

"; echo "
  1. Create ThingSpeak Account
  2. Create New Channel
  3. Add 4 Fields
  4. Copy Channel ID
  5. Copy Write API Key
  6. Paste into ESP32 Code
"; echo "
"; /* ===================================================== */ echo "
"; echo "

7. Telegram Bot Setup

"; echo "
  1. Open Telegram
  2. Search BotFather
  3. Type /newbot
  4. Enter Bot Name
  5. Enter Username
  6. Copy Bot Token
"; echo "
https://api.telegram.org/botYOUR_TOKEN/getUpdates
"; echo "
"; /* ===================================================== */ echo "
"; echo "

8. n8n Workflow

"; echo "

Workflow Process:

Webhook Trigger

Receive Sensor Data

Save to Google Sheets

Analyze Data

IF abnormal condition

Send Telegram Alert

Generate Voice Notification
"; echo "
"; /* ===================================================== */ echo "
"; echo "

9. Google Sheets Integration

"; echo "
Column Description
Timestamp Date and Time
Temperature Body Temperature
Humidity Humidity Value
Heart Rate BPM Value
SpO2 Oxygen Level
"; echo "
"; /* ===================================================== */ echo "
"; echo "

10. AI Power Prediction Logic

"; echo "
Power = Voltage × Current

AI adjusts upload frequency based on battery percentage.

Battery Level Action
> 70% Upload every 15 seconds
40% - 70% Upload every 1 minute
< 40% Deep Sleep Mode
"; echo "
"; /* ===================================================== */ echo "
"; echo "

11. Voice Notification Automation

"; echo "

Voice alerts are generated using:

  • Google Text-to-Speech API
  • Telegram Audio Messages
  • n8n Automation
Emergency Warning.
Patient oxygen level is critically low.
Please seek medical assistance.
"; echo "
"; /* ===================================================== */ echo "
"; echo "

12. Future Enhancements

"; echo "
  • Machine Learning Health Prediction
  • Firebase Integration
  • Mobile App Dashboard
  • GPS Tracking
  • ECG Monitoring
  • Cloud AI Analytics
"; echo "
"; /* ===================================================== */ echo "
"; echo "

13. Deployment Applications

"; echo "
Application Use Case
Hospitals Patient Monitoring
Elderly Care Remote Health Tracking
Fitness Monitoring Health Analytics
Rural Healthcare Remote Diagnostics
"; echo "
"; /* ===================================================== */ echo "
"; echo "

14. Conclusion

"; echo "

This AI-Based Smart Healthcare Assistant combines:

  • IoT
  • AI
  • Cloud Computing
  • Automation
  • Healthcare Analytics

The system provides real-time monitoring, AI predictions, Telegram alerts, cloud dashboards, and automated healthcare assistance.

"; echo "
"; /* ===================================================== */ echo "
"; echo "

15. Official Resources

"; echo " "; echo "
"; echo ""; echo ""; ?>