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.

Comments