Saturday, 30 May 2026

AI Smart Electric Vehicle Charging Station Management System

AI Smart Electric Vehicle Charging Station Management System AI-Powered ESP32 + Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
AI Smart Electric Vehicle Charging Station Management System AI-Powered ESP32 + Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard 1. Project Overview Project Title AI Smart Electric Vehicle Charging Station Management System using ESP32, Agentic IoT, n8n Automation, Telegram Voice Alerts, Google Sheets, and ThingSpeak Objective Develop an intelligent EV charging station monitoring and management system that: Monitors charging voltage, current, power, and energy consumption. Predicts future power demand using AI. Sends real-time alerts through Telegram. Generates voice notifications automatically. Stores charging logs in Google Sheets. Visualizes data on ThingSpeak cloud dashboards. Uses n8n as an automation and AI orchestration platform. Supports future expansion into multiple charging stations. 2. System Architecture EV Charger │ ▼ Current & Voltage Sensors │ ▼ ESP32 Controller │ ├────────► ThingSpeak Dashboard │ ├────────► n8n Webhook │ │ │ ▼ │ AI Agent Logic │ │ │ ┌─────────┴─────────┐ │ ▼ ▼ │ Google Sheets Telegram Bot │ │ │ ▼ │ Voice Notification │ ▼ Cloud Monitoring 3. Features Real-Time Monitoring Voltage Monitoring Current Monitoring Power Calculation Energy Consumption Tracking AI Agent Features Charging load prediction Peak demand forecasting Anomaly detection Usage pattern analysis Automation Data logging Alert generation Voice message generation Cloud dashboard updates 4. Components List Component Quantity ESP32 Dev Board 1 ACS712 Current Sensor 1 ZMPT101B Voltage Sensor 1 Relay Module 1 OLED Display 0.96" 1 EV Charging Socket 1 5V Power Supply 1 Jumper Wires Several Breadboard/PCB 1 WiFi Router 1 5. Circuit Connections ACS712 Current Sensor ACS712 ESP32 VCC 5V GND GND OUT GPIO34 ZMPT101B Voltage Sensor ZMPT101B ESP32 VCC 5V GND GND OUT GPIO35 Relay Module Relay ESP32 IN GPIO26 VCC 5V GND GND OLED Display (I2C) OLED ESP32 SDA GPIO21 SCL GPIO22 VCC 3.3V GND GND 6. Circuit Schematic Diagram +----------------+ | ESP32 | | | Voltage Sensor--| GPIO35 | Current Sensor--| GPIO34 | Relay ----------| GPIO26 | OLED SDA -------| GPIO21 | OLED SCL -------| GPIO22 | +----------------+ | WiFi | +-------------+-------------+ | | ThingSpeak n8n Server | +----------------+----------------+ | | | Telegram Bot Google Sheets AI Agent 7. Flowchart Start │ ▼ Initialize ESP32 │ Connect WiFi │ Read Sensors │ Calculate Power │ Upload ThingSpeak │ Send Data to n8n │ AI Analysis │ Store in Sheets │ Alert Required? │ ┌──Yes───┐ ▼ ▼ Telegram Continue Voice Alert │ ▼ Loop 8. Working Principle Step 1 ESP32 reads: Voltage from ZMPT101B Current from ACS712 Step 2 Calculate power: P=V×I Example: Voltage = 230V Current = 10A Power = 230 × 10 = 2300 W Step 3 Calculate Energy E=P×t Example: 2300W × 2h = 4.6 kWh Step 4 ESP32 sends data to: ThingSpeak n8n Webhook Step 5 n8n processes data Save logs Trigger AI analysis Send notifications 9. ESP32 Source Code #include #include const char* ssid = "YOUR_WIFI"; const char* password = "YOUR_PASSWORD"; String webhookURL = "https://your-n8n-server/webhook/evstation"; int voltagePin = 35; int currentPin = 34; void setup() { Serial.begin(115200); WiFi.begin(ssid,password); while(WiFi.status()!=WL_CONNECTED) { delay(500); Serial.print("."); } } void loop() { float voltage = analogRead(voltagePin)*(3.3/4095.0)*100; float current = analogRead(currentPin)*(3.3/4095.0)*30; float power = voltage*current; if(WiFi.status()==WL_CONNECTED) { HTTPClient http; http.begin(webhookURL); http.addHeader("Content-Type", "application/json"); String payload="{"; payload+="\"voltage\":"+String(voltage)+","; payload+="\"current\":"+String(current)+","; payload+="\"power\":"+String(power); payload+="}"; http.POST(payload); http.end(); } delay(15000); } 10. ThingSpeak Setup Create Channel Sign up at ThingSpeak. Create New Channel. Add Fields: Field1 = Voltage Field2 = Current Field3 = Power Field4 = Energy Save Channel. Copy Write API Key. ESP32 Upload URL https://api.thingspeak.com/update Example: field1=230 field2=10 field3=2300 field4=4.5 11. Google Sheets Integration Create columns: Timestamp Voltage Current Power Energy Prediction Example: 2026-05-30 10:15 230 10 2300 4.6 2500 12. Telegram Bot Setup Create Bot Open Telegram. Search for: Telegram Open: BotFather Send: /newbot Enter Bot Name. Copy Token. Example: 123456:ABCDEFxxxx Get Chat ID Send message to your bot. Open: https://api.telegram.org/botTOKEN/getUpdates Copy Chat ID. 13. n8n Workflow Architecture Webhook │ ▼ Code Node │ ▼ AI Agent │ ┌─┴────────────┐ ▼ ▼ Google Sheet Telegram Alert 14. n8n Workflow Detailed Steps Node 1 Webhook Node POST /webhook/evstation Receives: { "voltage":230, "current":10, "power":2300 } Node 2 Function Node const power = $json.power; let status = "Normal"; if(power > 2500) { status = "High Load"; } return [{ json:{ power:power, status:status } }] Node 3 Google Sheets Node Append Row. Map: Timestamp Voltage Current Power Status Node 4 Telegram Node Message: ⚡ EV Charging Alert Power: {{$json.power}} Status: {{$json.status}} 15. n8n Workflow JSON { "name":"EV Station Workflow", "nodes":[ { "name":"Webhook" }, { "name":"AI Analysis" }, { "name":"Google Sheets" }, { "name":"Telegram" } ] } This is a simplified structure. In production, export the workflow directly from n8n after configuration. 16. AI Power Consumption Prediction Logic Dataset Stored in Google Sheets: Date Time Power Energy Temperature Prediction Features Current Power Historical Power Time of Day Charging Duration Simple Prediction Formula Moving Average: Prediction= 5 P 1 ​ +P 2 ​ +P 3 ​ +P 4 ​ +P 5 ​ ​ Example: 2200 2300 2400 2500 2600 Prediction: 2400W Advanced AI Use: Linear Regression Random Forest XGBoost LSTM Neural Networks via Python or AI APIs connected through n8n. 17. Voice Notification Automation Trigger Condition Power > 2500W n8n Flow IF Node │ ▼ Generate Speech │ ▼ Telegram Send Voice Voice Message Warning. Electric vehicle charging load has exceeded the safe limit. Current load is 2600 watts. 18. AI Agent Responsibilities The AI agent can: Monitor Power Voltage Current Energy Decide Overload detection Peak demand prediction Charger fault detection Act Notify user Log event Disable relay if dangerous 19. Automatic Relay Protection If Power > 3000W Relay OFF Send Alert Store Incident Pseudo-code: if(power > 3000) { digitalWrite(RELAY,LOW); } 20. Cloud Dashboard Design Dashboard Widgets Gauge 1 Voltage 0–250V Gauge 2 Current 0–32A Gauge 3 Power 0–7000W Chart Daily Consumption Chart Weekly Consumption 21. Database Structure ChargingLogs ------------ id timestamp voltage current power energy status prediction 22. Future Enhancements AI Features Dynamic charging optimization Peak tariff avoidance Smart load balancing Vehicle identification Battery health estimation IoT Features RFID authentication QR-code charging access Solar integration OCPP protocol support Multi-station management Mobile App Flutter dashboard Real-time monitoring Push notifications Usage analytics 23. Deployment Guide Local Deployment ESP32 connected to Wi-Fi n8n running on PC or Raspberry Pi Google Sheets cloud logging ThingSpeak dashboard active Cloud Deployment Deploy n8n on: n8n Cloud AWS Google Cloud Microsoft Azure 24. Expected Output Voltage : 228V Current : 11A Power : 2508W Energy : 5.2kWh AI Prediction: 2700W in next 30 minutes Status: High Load Action: Telegram Voice Alert Sent Google Sheet Updated ThingSpeak Updated 25. Project Outcome This project demonstrates a complete Industry 4.0 and Smart EV Infrastructure solution combining: ESP32 Edge Computing IoT Cloud Monitoring AI Agent Decision-Making n8n Workflow Automation Telegram Voice Notifications Google Sheets Analytics ThingSpeak Visualization Predictive Energy Management The architecture is scalable from a single charging point to a city-wide EV charging network with centralized AI monitoring and automated control.

No comments:

Post a Comment

AI Smart Road Pothole Detection and Mapping System

AI Smart Road Pothole Detection and Mapping System AI-Powered ESP32 + Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets +...