Monday, 20 July 2026

AI-Based Smart Library Management and Book Recommendation System

<?php echo $title; ?>

ESP32 + RFID + AI + PHP + MySQL + n8n + Telegram + Google Sheets + ThingSpeak

1. Full Project Description

The AI-Based Smart Library Management and Book Recommendation System is an advanced IoT and Artificial Intelligence project designed to automate library operations.

The system uses ESP32 as the main IoT controller. RFID technology is used to identify library users and books. When a student scans an RFID card and a book RFID tag, the ESP32 reads the unique identification numbers and sends the data to a PHP-based web server using Wi-Fi.

The PHP backend processes the received data and communicates with a MySQL database. The database stores user details, book information, issue transactions, return transactions, recommendation history, and power consumption information.

The Artificial Intelligence recommendation module analyzes a user's previous borrowing history, preferred categories, authors, and reading behavior. Based on this information, the system generates personalized book recommendations.

The n8n automation platform works as an automation engine and AI agent layer. It receives events from the PHP server, analyzes them, updates Google Sheets, sends data to ThingSpeak, and sends real-time Telegram notifications.

The system can also generate Telegram voice notifications for important events such as book issue, book return, unknown RFID detection, overdue book alerts, and abnormal power consumption.

Main Objective: To create an intelligent, automated, cloud-connected library management system that reduces manual work and provides personalized book recommendations.

2. Project Objectives

  • Automate library book issue operations.
  • Automate library book return operations.
  • Identify students using RFID cards.
  • Identify books using RFID tags.
  • Store all transactions in a MySQL database.
  • Provide a PHP IoT web dashboard.
  • Generate AI-based book recommendations.
  • Monitor device power consumption.
  • Predict future power consumption.
  • Send Telegram text notifications.
  • Send Telegram voice alerts.
  • Store records in Google Sheets.
  • Visualize IoT data using ThingSpeak.
  • Automate workflows using n8n.

3. Hardware Components

Component Purpose
ESP32 Development Board Main IoT controller with Wi-Fi connectivity.
MFRC522 RFID Reader Reads RFID cards and RFID book tags.
RFID Student Card Identifies the library user.
RFID Book Tag Identifies the selected book.
OLED Display Displays system status and messages.
Buzzer Provides audio confirmation.
LED Indicates successful or failed operations.
Current Sensor Measures electrical current.
Voltage Sensor Measures supply voltage.
Power Supply Provides electrical power.

4. Software Components

ESP32 Firmware

Arduino C/C++ firmware reads RFID cards, controls the display, activates the buzzer, measures sensors, and sends JSON data to the PHP server.

PHP Backend

PHP receives ESP32 data, processes library transactions, communicates with MySQL, and provides REST API services.

MySQL Database

Stores users, books, transactions, recommendations, and power data.

AI Engine

Analyzes borrowing history and generates personalized recommendations.

n8n Automation

Connects the PHP server with Telegram, Google Sheets, ThingSpeak, and AI services.

5. System Architecture Diagram

+-------------------------------------------------------------+ | SMART LIBRARY SYSTEM | +-------------------------------------------------------------+ +----------------------+ | RFID STUDENT CARD | +----------+-----------+ | v +----------------------+ | RFID BOOK TAG | +----------+-----------+ | v +----------------------+ | ESP32 | | | | RFID Reader | | OLED Display | | Buzzer | | Power Sensors | | Wi-Fi | +----------+-----------+ | | HTTP JSON v +----------------------+ | PHP API | | esp32_event.php | +----------+-----------+ | v +----------------------+ | MySQL | | | | Users | | Books | | Transactions | | Power Data | +----------+-----------+ | +-------+-------+ | | v v +----------------+ +----------------+ | AI ENGINE | | n8n AUTOMATION | | | | | | Recommendations| | AI Agent | | Power Prediction| | Workflow | +--------+-------+ +--------+-------+ | | +---------+----------+ | +-----------+------------+ | | | v v v +-------------+ +----------+ +------------+ | Telegram | | Google | | ThingSpeak | | Text/Voice | | Sheets | | Dashboard | +-------------+ +----------+ +------------+

6. Complete System Flowchart

START | v Power ON ESP32 | v Connect to Wi-Fi | v Is Wi-Fi Connected? | +------ NO ------+ | | | v | Retry Connection | | +----------------+ | YES | v Initialize RFID Reader | v Wait for Student RFID | v Student Card Detected | v Read Student UID | v Validate Student | +------ INVALID ------> Send Alert | VALID | v Wait for Book RFID | v Book Tag Detected | v Read Book UID | v Send Data to PHP API | v PHP Searches MySQL | v Is Book Available? | +------ YES ------> ISSUE BOOK | +------ NO -------> RETURN BOOK | v Save Transaction | v Run AI Recommendation | v Trigger n8n Webhook | +----------+------------+ | | | v v v Telegram Google ThingSpeak Alert Sheets Dashboard | v Voice Notification | v END

7. Circuit Schematic Diagram

+----------------------+ | ESP32 | | | | GPIO 5 <---------- SDA | GPIO 18 <---------- SCK | GPIO 23 <---------- MOSI | GPIO 19 ----------> MISO | GPIO 4 ----------> RST | | | GPIO 21 ----------> SDA OLED | GPIO 22 ----------> SCL OLED | | | GPIO 25 ----------> BUZZER | GPIO 26 ----------> GREEN LED | GPIO 27 ----------> RED LED | | | GPIO 34 <---------- CURRENT SENSOR | GPIO 35 <---------- VOLTAGE SENSOR +----------+-----------+ | | v +---------------+ | MFRC522 | | | | SDA | | SCK | | MOSI | | MISO | | RST | | 3.3V | | GND | +---------------+ +---------------+ | OLED DISPLAY | | | | VCC | | GND | | SDA | | SCL | +---------------+ +---------------+ | POWER SENSOR | | | | VOLTAGE | | CURRENT | +---------------+
Important: The MFRC522 RFID module must normally be powered using 3.3V logic. Always verify the specific hardware module specifications before connecting it to the ESP32.

8. Database Design

Table Purpose
users Stores student and library user information.
books Stores book details and availability.
transactions Stores issue and return operations.
recommendations Stores AI recommendation results.
power_data Stores voltage, current, power, and energy data.
CREATE DATABASE smart_library; USE smart_library; CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, user_id VARCHAR(50) UNIQUE NOT NULL, rfid_uid VARCHAR(100) UNIQUE NOT NULL, name VARCHAR(100) NOT NULL, department VARCHAR(100), email VARCHAR(150), status VARCHAR(20) DEFAULT 'ACTIVE', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE books ( id INT AUTO_INCREMENT PRIMARY KEY, book_id VARCHAR(50) UNIQUE NOT NULL, rfid_uid VARCHAR(100) UNIQUE NOT NULL, title VARCHAR(200) NOT NULL, author VARCHAR(150), category VARCHAR(100), availability VARCHAR(20) DEFAULT 'AVAILABLE', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE transactions ( id INT AUTO_INCREMENT PRIMARY KEY, user_id VARCHAR(50), book_id VARCHAR(50), action VARCHAR(20), timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE power_data ( id INT AUTO_INCREMENT PRIMARY KEY, voltage FLOAT, current FLOAT, power FLOAT, energy FLOAT, timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP );

9. PHP Backend Software

The PHP backend is the central server-side layer. It receives data from the ESP32 using HTTP POST requests.

JSON Data Received from ESP32

{ "device_id": "ESP32_LIBRARY_01", "card_uid": "A3B79122", "book_uid": "BOOK_RFID_001", "event_type": "LIBRARY_TRANSACTION", "voltage": 5.0, "current": 0.25, "power": 1.25 }

PHP API Code

"error", "message" => "Invalid JSON" ] ); exit; } $cardUid = $data["card_uid"] ?? ""; $bookUid = $data["book_uid"] ?? ""; $voltage = $data["voltage"] ?? 0; $current = $data["current"] ?? 0; $power = $data["power"] ?? 0; $userQuery = $pdo->prepare( "SELECT * FROM users WHERE rfid_uid = ?" ); $userQuery->execute( [ $cardUid ] ); $user = $userQuery->fetch( PDO::FETCH_ASSOC ); if ( !$user ) { echo json_encode( [ "status" => "error", "message" => "Unknown RFID User" ] ); exit; } $bookQuery = $pdo->prepare( "SELECT * FROM books WHERE rfid_uid = ?" ); $bookQuery->execute( [ $bookUid ] ); $book = $bookQuery->fetch( PDO::FETCH_ASSOC ); if ( !$book ) { echo json_encode( [ "status" => "error", "message" => "Book Not Found" ] ); exit; } if ( $book["availability"] == "AVAILABLE" ) { $action = "ISSUE"; $status = "ISSUED"; } else { $action = "RETURN"; $status = "AVAILABLE"; } $update = $pdo->prepare( "UPDATE books SET availability = ? WHERE book_id = ?" ); $update->execute( [ $status, $book["book_id"] ] ); $transaction = $pdo->prepare( "INSERT INTO transactions ( user_id, book_id, action ) VALUES ( ?, ?, ? )" ); $transaction->execute( [ $user["user_id"], $book["book_id"], $action ] ); $powerInsert = $pdo->prepare( "INSERT INTO power_data ( voltage, current, power ) VALUES ( ?, ?, ? )" ); $powerInsert->execute( [ $voltage, $current, $power ] ); echo json_encode( [ "status" => "success", "user" => $user["name"], "book" => $book["title"], "action" => $action ] ); ?>

10. AI Book Recommendation System

The AI recommendation engine studies the user's previous borrowing history.

The system can use the following factors:

  • Previously borrowed book categories.
  • Previously borrowed authors.
  • Popular books.
  • Recently added books.
  • User department.
  • Reading frequency.

Recommendation Score

IF category matches previous category THEN score = score + 5 IF author matches previous author THEN score = score + 3 IF book is popular THEN score = score + 2 IF book is available THEN score = score + 1 SORT books by score DISPLAY TOP 5 BOOKS

PHP AI Recommendation Logic

prepare( "SELECT books.category, books.author FROM transactions INNER JOIN books ON transactions.book_id = books.book_id WHERE transactions.user_id = ?" ); $historyQuery->execute( [ $userId ] ); $history = $historyQuery ->fetchAll( PDO::FETCH_ASSOC ); $categories = []; $authors = []; foreach ( $history as $item ) { $categories[] = $item["category"]; $authors[] = $item["author"]; } $books = $pdo->query( "SELECT * FROM books WHERE availability = 'AVAILABLE'" ); $recommendations = []; foreach ( $books as $book ) { $score = 0; if ( in_array( $book["category"], $categories ) ) { $score += 5; } if ( in_array( $book["author"], $authors ) ) { $score += 3; } $recommendations[] = [ "title" => $book["title"], "author" => $book["author"], "category" => $book["category"], "score" => $score ]; } usort( $recommendations, function( $a, $b ) { return $b["score"] <=> $a["score"]; } ); return array_slice( $recommendations, 0, 5 ); } ?>

11. AI Power Consumption Prediction

The system calculates electrical power using:

POWER = VOLTAGE × CURRENT P = V × I

The system can estimate future power consumption using previous readings.

Previous Power Data | v Calculate Average | v Analyze Trend | v Estimate Future Power | v Generate Alert if Limit Exceeded
10 ) { return $power * 1.10; } return $power * 1.05; } ?>

12. n8n Automation Workflow

PHP WEBHOOK | v n8n WEBHOOK NODE | v READ JSON DATA | v VALIDATE DATA | +----------------+ | | v v TRANSACTION POWER DATA | | v v Google Sheets ThingSpeak | v AI Recommendation | v Telegram Message | v Voice Notification

n8n Workflow Nodes

Node Function
Webhook Receives data from PHP.
Set Organizes incoming data.
IF Checks issue, return, or error.
Google Sheets Stores transaction data.
HTTP Request Sends data to ThingSpeak.
Telegram Sends notification.
AI Agent Generates intelligent responses.

13. Telegram Bot Setup

  1. Open Telegram.
  2. Search for BotFather.
  3. Create a new bot.
  4. Copy the bot token.
  5. Find the Telegram chat ID.
  6. Add the values to config.php.

Example Alert

SMART LIBRARY ALERT Student: John Book: Artificial Intelligence Action: BOOK ISSUED Time: 10:30 AM Recommendation: Machine Learning Fundamentals

14. Google Sheets Integration

Google Sheets can be used as a cloud-based transaction backup system.

Timestamp User ID Student Name Book Action
2026-07-21 STU001 Student AI Book ISSUE

n8n receives the transaction from the PHP server and automatically appends the data to Google Sheets.

15. ThingSpeak Cloud Dashboard

ThingSpeak can be used to monitor IoT sensor data remotely.

Field Data
Field 1 Voltage
Field 2 Current
Field 3 Power
Field 4 Energy
ESP32 | v PHP API | v n8n | v ThingSpeak | v Cloud Graphs

16. Telegram Voice Notification Automation

LIBRARY EVENT | v PHP SERVER | v n8n WEBHOOK | v CREATE MESSAGE | v TEXT-TO-SPEECH | v AUDIO FILE | v TELEGRAM VOICE MESSAGE

Example voice message:

"Library notification. Student John has successfully issued the book Artificial Intelligence."

17. Complete Project Folder Structure

smart-library/ │ ├── index.php ├── config.php ├── database.php │ ├── database/ │ └── smart_library.sql │ ├── api/ │ ├── esp32_event.php │ ├── recommendations.php │ ├── power_prediction.php │ ├── send_to_n8n.php │ └── dashboard_data.php │ ├── ai/ │ ├── recommendation_engine.php │ └── power_prediction_engine.php │ ├── admin/ │ ├── dashboard.php │ ├── books.php │ ├── users.php │ └── transactions.php │ ├── integrations/ │ ├── telegram.php │ ├── telegram_voice.php │ ├── google_sheets.php │ └── thingspeak.php │ ├── n8n/ │ └── library_workflow.json │ └── esp32/ └── esp32_library.ino

18. Complete Installation Steps

  1. Install XAMPP or another PHP server.
  2. Start Apache.
  3. Start MySQL.
  4. Create a database named smart_library.
  5. Import the SQL database file.
  6. Copy the project folder into the web server directory.
  7. Configure database credentials.
  8. Configure Telegram Bot Token.
  9. Configure Telegram Chat ID.
  10. Configure ThingSpeak API Key.
  11. Configure Google Sheets credentials.
  12. Create the n8n workflow.
  13. Copy the n8n webhook URL into config.php.
  14. Upload the ESP32 firmware.
  15. Connect the ESP32 to Wi-Fi.
  16. Test RFID student scanning.
  17. Test RFID book scanning.
  18. Verify the MySQL transaction.
  19. Verify the Telegram notification.
  20. Verify Google Sheets data.
  21. Verify ThingSpeak data.

19. Deployment Guide

LOCAL DEVELOPMENT ESP32 | v XAMPP | v PHP + MySQL PRODUCTION DEPLOYMENT ESP32 | v Internet | v Cloud PHP Hosting | v Cloud MySQL | +------------+ | | v v n8n Cloud ThingSpeak | v Telegram

Production Requirements

  • Use HTTPS.
  • Use strong database passwords.
  • Protect API endpoints.
  • Use API authentication.
  • Validate all ESP32 data.
  • Use prepared SQL statements.
  • Do not expose private API keys.
  • Use secure environment variables.
  • Create regular database backups.

20. Future Enhancements

  • Face recognition for student authentication.
  • Mobile application.
  • Voice-controlled library search.
  • AI chatbot for book queries.
  • Advanced machine learning recommendation algorithms.
  • Automatic overdue prediction.
  • Book demand forecasting.
  • Smart shelf monitoring.
  • Computer vision for book recognition.
  • Cloud-based user authentication.
  • Multi-library support.
  • AI-based reading behavior analysis.

21. Final Project Summary

The AI-Based Smart Library Management and Book Recommendation System combines embedded systems, Internet of Things technology, Artificial Intelligence, cloud services, automation, and web development.

The ESP32 provides the hardware intelligence. RFID provides automatic identification. PHP provides the server-side processing. MySQL stores the library database. AI provides personalized book recommendations and power prediction. n8n connects different cloud services. Telegram provides instant notifications and voice alerts. Google Sheets provides cloud-based data storage and ThingSpeak provides IoT visualization.

Final Architecture: ESP32 + RFID → PHP API → MySQL → AI Engine → n8n Automation → Telegram → Google Sheets → ThingSpeak → Web Dashboard

AI-Based Smart Library Management and Book Recommendation System

ESP32 | PHP | MySQL | AI | n8n | Telegram | Google Sheets | ThingSpeak

Recommended actual project files The documentation above is one PHP file, but the working system should be separated into individual files: smart-library/ │ ├── smart_library_documentation.php │ ├── index.php ├── config.php ├── database.php │ ├── database/ │ └── smart_library.sql │ ├── api/ │ ├── esp32_event.php │ ├── recommendations.php │ ├── power_prediction.php │ ├── send_to_n8n.php │ └── dashboard_data.php │ ├── ai/ │ ├── recommendation_engine.php │ └── power_prediction_engine.php │ ├── admin/ │ ├── dashboard.php │ ├── books.php │ ├── users.php │ └── transactions.php │ ├── integrations/ │ ├── telegram.php │ ├── telegram_voice.php │ ├── google_sheets.php │ └── thingspeak.php │ ├── n8n/ │ └── library_workflow.json │ └── esp32/ └── esp32_library.ino This format provides the full project description, detailed documentation, flow diagrams, architecture diagram, circuit schematic representation, AI logic, PHP backend code, database design, automation flow, Telegram integration, Google Sheets integration, ThingSpeak integration, deployment guide, and future enhancements in PHP-based documentation format.

Sunday, 19 July 2026

AI-Based Smart Factory Automation with Predictive Maintenance

AI-Based Smart Factory Automation with Predictive Maintenance

AI-Based Smart Factory Automation with Predictive Maintenance

ESP32 + AI Agent + Agentic IoT + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard

1. Full Project Description

The AI-Based Smart Factory Automation with Predictive Maintenance system is an intelligent Industrial IoT solution designed to continuously monitor factory machines and predict possible equipment failures before they occur.

The system uses an ESP32 microcontroller as the primary IoT controller. Multiple sensors are connected to the ESP32 to monitor temperature, vibration, voltage, current, power consumption, machine runtime and operational conditions.

The ESP32 collects real-time sensor data and transmits the data through Wi-Fi to an IoT webpage and an n8n automation workflow.

The n8n workflow acts as an automation engine. It receives the machine data, stores the data in Google Sheets, updates ThingSpeak cloud dashboards, sends the sensor information to an AI Agent and automatically generates predictive maintenance decisions.

The AI Agent analyzes machine health parameters and predicts whether the machine is operating normally, showing warning symptoms or approaching a possible failure condition.

When a dangerous condition is detected, n8n automatically sends Telegram text alerts and voice notifications to the maintenance team.

The complete system represents an Agentic IoT architecture because the AI Agent can analyze data, make decisions, generate recommendations and trigger automated actions.

2. Project Objectives

  • Monitor industrial machines in real time.
  • Measure machine temperature.
  • Measure vibration levels.
  • Monitor voltage and current.
  • Calculate power consumption.
  • Predict possible machine failures.
  • Detect abnormal energy consumption.
  • Store historical machine data.
  • Generate AI maintenance recommendations.
  • Send Telegram text alerts.
  • Send Telegram voice notifications.
  • Display machine status on an IoT webpage.
  • Store data in Google Sheets.
  • Display cloud analytics using ThingSpeak.
  • Automatically control warning devices.

3. System Architecture


INDUSTRIAL MACHINE

        |

        v

TEMPERATURE SENSOR

VIBRATION SENSOR

CURRENT SENSOR

VOLTAGE SENSOR

        |

        v

ESP32 IoT CONTROLLER

        |

        | Wi-Fi

        v

IOT WEBPAGE / PHP API

        |

        v

n8n AUTOMATION WORKFLOW

        |

        +-------------------------+

        |                         |

        v                         v

AI AGENT              GOOGLE SHEETS

PREDICTIVE             DATA STORAGE

ANALYSIS

        |

        v

THINGSPEAK CLOUD

DASHBOARD

        |

        v

FAILURE DECISION

        |

        +-------------------------+

        |                         |

        v                         v

TELEGRAM TEXT          TELEGRAM VOICE

ALERT                   NOTIFICATION

        |

        v

MAINTENANCE ACTION

4. Hardware Components List

Component Purpose
ESP32 Development Board Main IoT controller
DS18B20 / DHT22 Temperature monitoring
MPU6050 / ADXL345 Vibration monitoring
ACS712 / PZEM Current measurement
ZMPT101B / PZEM Voltage measurement
OLED Display Local machine status display
Relay Module Automatic control
Buzzer Local warning notification
Red LED Critical status indication
Green LED Normal status indication
Wi-Fi Router Internet connectivity
Industrial Motor Machine under monitoring

5. Circuit Schematic Diagram


                    +----------------------+

                    |        ESP32         |

                    |                      |

                    | GPIO 4  <------------ DS18B20 DATA

                    |                      |

                    | GPIO 21 <------------ MPU6050 SDA

                    |                      |

                    | GPIO 22 <------------ MPU6050 SCL

                    |                      |

                    | GPIO 34 <------------ Current Sensor

                    |                      |

                    | GPIO 35 <------------ Voltage Sensor

                    |                      |

                    | GPIO 25 ------------> Relay Module

                    |                      |

                    | GPIO 26 ------------> Buzzer

                    |                      |

                    | GPIO 27 ------------> RED LED

                    |                      |

                    | GPIO 14 ------------> GREEN LED

                    |                      |

                    | 3.3V ---------------> Sensors

                    |                      |

                    | GND ----------------> Common GND

                    +----------------------+

Safety Warning: Industrial AC voltage and motors must be isolated using appropriate fuses, contactors, optocouplers and certified electrical protection. Never connect mains voltage directly to an ESP32 or a breadboard.

6. Detailed Circuit Connections

DS18B20 Temperature Sensor

DS18B20 Pin ESP32 Pin
VCC 3.3V
GND GND
DATA GPIO 4

A 4.7 kΩ pull-up resistor should be connected between DATA and 3.3V.

MPU6050 Vibration Sensor

MPU6050 ESP32
VCC 3.3V
GND GND
SDA GPIO 21
SCL GPIO 22

7. Complete Flowchart


START

  |

  v

INITIALIZE ESP32

  |

  v

CONNECT TO WI-FI

  |

  v

READ TEMPERATURE

  |

  v

READ VIBRATION

  |

  v

READ VOLTAGE

  |

  v

READ CURRENT

  |

  v

CALCULATE POWER

  |

  v

SEND DATA TO SERVER

  |

  v

n8n RECEIVES DATA

  |

  v

AI AGENT ANALYZES DATA

  |

  v

CALCULATE FAILURE RISK

  |

  +---------------------------+

  |                           |

  v                           v

NORMAL                    WARNING / CRITICAL

  |                           |

  v                           v

STORE DATA                SEND TELEGRAM ALERT

  |                           |

  v                           v

UPDATE CLOUD              GENERATE VOICE ALERT

                              |

                              v

                       MAINTENANCE ACTION

                              |

                              v

                       REPEAT MONITORING

8. Predictive Maintenance Logic

The system calculates a machine health score based on multiple parameters.


Temperature Risk       = 25 Percent

Vibration Risk         = 30 Percent

Power Consumption Risk = 25 Percent

Current Risk           = 20 Percent

Total Risk Score

=

Temperature Risk * 0.25

+

Vibration Risk * 0.30

+

Power Risk * 0.25

+

Current Risk * 0.20

Temperature Threshold

Temperature Status
Below 60 °C NORMAL
60 °C to 75 °C WARNING
Above 75 °C CRITICAL

Machine Risk Score


0 to 30     = NORMAL

31 to 60    = WARNING

61 to 100   = CRITICAL

9. AI Power Consumption Prediction Logic

The system records historical power consumption and uses the historical trend to identify abnormal energy usage.


09:00  = 2200 W

09:10  = 2300 W

09:20  = 2500 W

09:30  = 2800 W

The AI Agent detects that power consumption is increasing abnormally.


CURRENT POWER:

2800 W

PREDICTED FUTURE POWER:

3400 W

POSSIBLE CAUSES:

1. Motor overload

2. Bearing friction

3. Mechanical obstruction

4. Voltage instability

10. ESP32 Source Code



#include <WiFi.h>

#include <HTTPClient.h>

#include <Wire.h>

#include <OneWire.h>

#include <DallasTemperature.h>

#include <ArduinoJson.h>

const char* ssid = "YOUR_WIFI_NAME";

const char* password = "YOUR_WIFI_PASSWORD";

const char* serverURL =

"https://your-domain.com/api/receive_data.php";

#define ONE_WIRE_BUS 4

#define RELAY_PIN 25

#define BUZZER_PIN 26

#define RED_LED 27

#define GREEN_LED 14

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

float temperature;

float vibration;

float voltage;

float current;

float power;

void setup()

{

    Serial.begin(115200);

    pinMode(RELAY_PIN, OUTPUT);

    pinMode(BUZZER_PIN, OUTPUT);

    pinMode(RED_LED, OUTPUT);

    pinMode(GREEN_LED, OUTPUT);

    sensors.begin();

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED)

    {

        delay(500);

        Serial.print(".");

    }

    Serial.println("WiFi Connected");

}

void loop()

{

    sensors.requestTemperatures();

    temperature = sensors.getTempCByIndex(0);

    vibration = analogRead(34);

    voltage = analogRead(35) * 0.1;

    current = analogRead(32) * 0.01;

    power = voltage * current;

    String status = "NORMAL";

    if (

        temperature > 75 ||

        vibration > 3000 ||

        power > 3000

    )

    {

        status = "CRITICAL";

        digitalWrite(RED_LED, HIGH);

        digitalWrite(GREEN_LED, LOW);

        digitalWrite(BUZZER_PIN, HIGH);

    }

    else if (

        temperature > 60 ||

        vibration > 2000 ||

        power > 2500

    )

    {

        status = "WARNING";

        digitalWrite(RED_LED, HIGH);

        digitalWrite(GREEN_LED, LOW);

        digitalWrite(BUZZER_PIN, LOW);

    }

    else

    {

        status = "NORMAL";

        digitalWrite(RED_LED, LOW);

        digitalWrite(GREEN_LED, HIGH);

        digitalWrite(BUZZER_PIN, LOW);

    }

    if (WiFi.status() == WL_CONNECTED)

    {

        HTTPClient http;

        http.begin(serverURL);

        http.addHeader(

            "Content-Type",

            "application/json"

        );

        StaticJsonDocument<512> doc;

        doc["machine_id"] = "MACHINE_01";

        doc["temperature"] = temperature;

        doc["vibration"] = vibration;

        doc["voltage"] = voltage;

        doc["current"] = current;

        doc["power"] = power;

        doc["status"] = status;

        String jsonData;

        serializeJson(doc, jsonData);

        int httpResponseCode =

            http.POST(jsonData);

        Serial.println(httpResponseCode);

        http.end();

    }

    delay(10000);

}

11. PHP IoT API File

Save the following file as:


receive_data.php



<?php

header("Content-Type: application/json");

$data = json_decode(

    file_get_contents("php://input"),

    true

);

if (!$data)

{

    echo json_encode(

        [

            "status" => "error",

            "message" => "Invalid JSON data"

        ]

    );

    exit;

}

$machine_id =

    $data["machine_id"] ?? "UNKNOWN";

$temperature =

    $data["temperature"] ?? 0;

$vibration =

    $data["vibration"] ?? 0;

$voltage =

    $data["voltage"] ?? 0;

$current =

    $data["current"] ?? 0;

$power =

    $data["power"] ?? 0;

$status =

    $data["status"] ?? "UNKNOWN";

$file = "machine_data.json";

$old_data = [];

if (file_exists($file))

{

    $old_data =

        json_decode(

            file_get_contents($file),

            true

        );

}

$record =

    [

        "machine_id" => $machine_id,

        "temperature" => $temperature,

        "vibration" => $vibration,

        "voltage" => $voltage,

        "current" => $current,

        "power" => $power,

        "status" => $status,

        "timestamp" => date(

            "Y-m-d H:i:s"

        )

    ];

$old_data[] = $record;

file_put_contents(

    $file,

    json_encode(

        $old_data,

        JSON_PRETTY_PRINT

    )

);

echo json_encode(

    [

        "status" => "success",

        "message" =>

            "Machine data received",

        "data" => $record

    ]

);

?>

12. IoT Web Dashboard

The dashboard displays real-time machine information.


SMART FACTORY MONITORING DASHBOARD

Machine Status: NORMAL

Temperature: 45 °C

Vibration: 1.5 mm/s

Voltage: 230 V

Current: 9.5 A

Power: 2200 W

Health Score: 92 Percent

13. n8n Automation Workflow


ESP32

  |

  v

WEBHOOK

  |

  v

JSON DATA PROCESSING

  |

  v

DATA VALIDATION

  |

  v

AI PREDICTIVE MAINTENANCE AGENT

  |

  v

FAILURE RISK ANALYSIS

  |

  +--------------------------+

  |                          |

  v                          v

NORMAL                    HIGH RISK

  |                          |

  v                          v

GOOGLE SHEETS             TELEGRAM ALERT

  |                          |

  v                          v

THINGSPEAK CLOUD          VOICE ALERT

                              |

                              v

                       MAINTENANCE ACTION

14. AI Agent Prompt


You are an industrial predictive maintenance AI Agent.

Analyze the following machine data.

Machine ID:

Temperature:

Vibration:

Voltage:

Current:

Power:

Determine:

1. Machine health status.

2. Failure risk.

3. Failure probability.

4. Possible failure cause.

5. Recommended maintenance action.

6. Whether Telegram alert is required.

Return the result in JSON format.

15. Example AI Prediction


{

    "health_status": "WARNING",

    "failure_risk": "HIGH",

    "failure_probability": 78,

    "possible_cause":

        "Motor bearing overheating",

    "recommendation":

        "Inspect bearing lubrication",

    "alert_required": true

}

16. Telegram Bot Setup

Create a Telegram bot using BotFather.


Step 1:

Open Telegram.

Step 2:

Search for BotFather.

Step 3:

Send:

/newbot

Step 4:

Enter:

Smart Factory Alert Bot

Step 5:

Copy the generated BOT TOKEN.

Step 6:

Configure the token inside the n8n Telegram node.

17. Telegram Alert Message


SMART FACTORY ALERT

Machine ID: MACHINE_01

Temperature: 78 °C

Vibration: HIGH

Power Consumption: 3400 W

AI Failure Risk: 85 Percent

Predicted Problem:

Motor bearing failure.

Recommended Action:

Inspect motor bearing and lubrication immediately.

18. Voice Notification Automation


AI PREDICTION

        |

        v

GENERATE ALERT TEXT

        |

        v

TEXT-TO-SPEECH

        |

        v

GENERATE AUDIO FILE

        |

        v

SEND AUDIO THROUGH TELEGRAM

Example voice message:


Warning.

Machine number one is showing a high failure risk.

The motor temperature is 78 degrees Celsius.

Vibration is above the safe operating limit.

Immediate maintenance inspection is recommended.

19. Google Sheets Integration

Column Data
Timestamp Machine timestamp
Machine ID Machine identification number
Temperature Temperature value
Vibration Vibration value
Voltage Voltage value
Current Current value
Power Power consumption
Health Status Normal, Warning or Critical
Failure Risk AI predicted risk
Recommendation AI maintenance recommendation

20. ThingSpeak Cloud Dashboard


FIELD 1:

Temperature

FIELD 2:

Vibration

FIELD 3:

Voltage

FIELD 4:

Current

FIELD 5:

Power

FIELD 6:

Health Score

The ThingSpeak dashboard can display real-time and historical machine sensor data using charts and graphs.

21. Agentic IoT Architecture


SENSOR

  |

  v

ESP32

  |

  v

AI AGENT

  |

  v

ANALYZE

  |

  v

DECIDE

  |

  v

TAKE ACTION

  |

  +----------------------------+

  |                            |

  v                            v

SEND TELEGRAM ALERT       LOG DATA

  |                            |

  v                            v

VOICE NOTIFICATION        GOOGLE SHEETS

  |

  v

CONTROL RELAY

  |

  v

MAINTENANCE RECOMMENDATION

22. Project Software Requirements

  • Arduino IDE
  • ESP32 Board Package
  • Wi-Fi Library
  • HTTP Client Library
  • ArduinoJson Library
  • OneWire Library
  • DallasTemperature Library
  • PHP Server
  • n8n Automation
  • Telegram Bot
  • Google Sheets
  • ThingSpeak Cloud
  • AI API
  • Text-to-Speech Service

23. Project Folder Structure


smart-factory-project/

|

|-- esp32/

|   |

|   |-- smart_factory.ino

|

|-- web/

|   |

|   |-- index.php

|   |

|   |-- receive_data.php

|   |

|   |-- machine_data.json

|

|-- n8n/

|   |

|   |-- smart_factory_workflow.json

|

|-- docs/

|   |

|   |-- circuit_diagram

|   |

|   |-- flowchart

|   |

|   |-- project_report

|

|-- README.md

24. Complete Project Operation


MACHINE STARTS

        |

        v

ESP32 STARTS

        |

        v

WI-FI CONNECTION

        |

        v

SENSOR READING

        |

        v

TEMPERATURE MONITORING

        |

        v

VIBRATION MONITORING

        |

        v

CURRENT MONITORING

        |

        v

VOLTAGE MONITORING

        |

        v

POWER CALCULATION

        |

        v

DATA SENT TO n8n

        |

        v

AI AGENT ANALYSIS

        |

        v

FAILURE PREDICTION

        |

        +---------------------------+

        |                           |

        v                           v

NORMAL                    WARNING / CRITICAL

        |                           |

        v                           v

STORE DATA                TELEGRAM ALERT

        |                           |

        v                           v

CLOUD UPDATE              VOICE NOTIFICATION

                                    |

                                    v

                            MAINTENANCE ACTION

25. Advantages

  • Real-time machine monitoring.
  • Early failure detection.
  • Reduced machine downtime.
  • Reduced maintenance cost.
  • AI-based predictive analysis.
  • Energy consumption monitoring.
  • Telegram notifications.
  • Voice notification support.
  • Cloud data storage.
  • Historical machine analysis.
  • Remote monitoring.
  • Scalable architecture.
  • Agentic IoT automation.

26. Future Enhancements

  • Digital Twin of the factory.
  • Advanced machine learning models.
  • LSTM-based failure prediction.
  • Random Forest prediction.
  • XGBoost predictive analytics.
  • Computer vision for machine inspection.
  • Oil leakage detection.
  • Smoke detection.
  • Multi-machine monitoring.
  • Mobile application.
  • Advanced energy analytics.
  • Automatic maintenance scheduling.
  • Voice-controlled factory automation.
  • AI-based spare parts prediction.

27. Deployment Guide

  1. Assemble the ESP32 and industrial sensors.
  2. Connect the sensors according to the circuit diagram.
  3. Upload the ESP32 firmware.
  4. Configure Wi-Fi credentials.
  5. Deploy the PHP IoT webpage.
  6. Create the n8n workflow.
  7. Configure the AI Agent.
  8. Configure Google Sheets authentication.
  9. Create the ThingSpeak channel.
  10. Create and configure the Telegram Bot.
  11. Configure the voice notification system.
  12. Test normal machine conditions.
  13. Test warning conditions.
  14. Test critical conditions.
  15. Verify Telegram notifications.
  16. Verify Google Sheets data logging.
  17. Verify ThingSpeak cloud charts.

28. Final Project Summary

The AI-Based Smart Factory Automation with Predictive Maintenance system integrates ESP32, industrial sensors, AI Agent technology, n8n automation, Telegram notifications, voice alerts, Google Sheets and ThingSpeak cloud monitoring into one intelligent industrial automation platform.

The system collects real-time machine data, analyzes machine health, detects abnormal conditions, predicts possible failures, estimates future power consumption and automatically sends alerts to the maintenance team.

This project demonstrates the complete concept of Agentic IoT, where sensors collect data, the ESP32 transmits the data, AI analyzes the information, n8n automates the workflow and the system automatically performs appropriate actions.

AI-Based Smart Exam Proctoring System Using Face Tracking

AI-Based Smart Exam Proctoring System Using Face Tracking

AI-Based Smart Exam Proctoring System Using Face Tracking

ESP32 + AI Agent + IoT Webpage + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard

1. Complete Project Title

AI-Based Smart Exam Proctoring System Using Face Tracking with ESP32, AI Agent, n8n Automation, Telegram Voice Alerts, Google Sheets and ThingSpeak Cloud Dashboard.

2. Full Project Description

The AI-Based Smart Exam Proctoring System Using Face Tracking is an intelligent examination monitoring system that combines Artificial Intelligence, Computer Vision, IoT, ESP32, cloud computing, workflow automation and real-time notification services.

The main purpose of this project is to monitor examination environments using face detection and face tracking technology. The system analyzes the candidate's presence, face position, head direction and number of detected faces.

When the system detects unusual or suspicious events such as multiple faces, absence of the candidate or repeated looking away from the examination screen, an event is generated.

The event is transmitted through an IoT communication system to an ESP32 and cloud-based automation platform.

The n8n automation workflow receives the event and automatically performs multiple actions.

  • Stores the event in Google Sheets.
  • Updates the ThingSpeak cloud dashboard.
  • Sends a Telegram text alert.
  • Generates a Telegram voice notification.
  • Allows an AI agent to analyze the examination event.
  • Generates a risk score and examination summary.

The ESP32 functions as the IoT controller and can monitor system status, environmental parameters and power consumption.

The project provides a complete Agentic IoT architecture combining AI, ESP32, n8n automation, Telegram alerts, cloud dashboards and intelligent data analysis.

3. Main Project Objectives

  • Monitor examination candidates using AI-based face tracking.
  • Detect whether the candidate is present.
  • Detect multiple faces in the examination area.
  • Monitor head direction and repeated looking away.
  • Generate automatic suspicious activity alerts.
  • Use ESP32 for IoT communication and sensor monitoring.
  • Use n8n for workflow automation.
  • Send Telegram text and voice alerts.
  • Store examination events in Google Sheets.
  • Display cloud data using ThingSpeak.
  • Use AI agents for event analysis.
  • Predict future power consumption.

4. System Architecture

+-----------------------------+ | EXAM CANDIDATE | | STUDENT | +-------------+---------------+ | v +-----------------------------+ | AI CAMERA SYSTEM | | Face Detection and Tracking | | Head Pose Analysis | | Multiple Face Detection | +-------------+---------------+ | v +-----------------------------+ | ESP32 | | Wi-Fi Controller | | Sensors | | OLED Display | | Buzzer | | LED Indicators | +-------------+---------------+ | v +-----------------------------+ | IoT WEBPAGE | | Live Monitoring Dashboard | +-------------+---------------+ | v +-----------------------------+ | n8n | | Workflow Automation | | AI Agent Processing | +-------------+---------------+ | +-------------------+-------------------+ | | | v v v +-------------+ +-------------+ +-------------+ | Telegram | | Google | | ThingSpeak | | Alerts | | Sheets | | Cloud | +------+------+ +-------------+ +-------------+ | v +-------------+ | Voice Alert | +-------------+

5. Hardware Components List

Component Purpose
ESP32 Development Board Main IoT controller
USB Camera Face tracking and monitoring
ESP32-CAM Optional camera-based alternative
OLED Display Displays system status
Buzzer Local warning alert
Red LED Suspicious activity indicator
Green LED Normal system status indicator
DHT11 or DHT22 Temperature and humidity monitoring
PIR Sensor Optional movement detection
LDR Sensor Light monitoring
MicroSD Module Local event storage
5V Power Supply System power

6. Hardware Circuit Schematic

ESP32 +--------------------------+ | | | GPIO 21 -------- SDA |------ OLED | GPIO 22 -------- SCL |------ OLED | | | GPIO 4 --------- DATA |------ DHT11 | | | GPIO 25 -------- BUZZER |------ Buzzer | | | GPIO 26 -------- RED LED |------ Red LED | | | GPIO 27 -------- GREEN |------ Green LED | | | 3.3V ------------ VCC | | GND ------------- GND | +-------------+------------+ | v Wi-Fi Network | v Cloud Server

OLED Connection

OLED Pin ESP32 Pin
VCC 3.3V
GND GND
SDA GPIO 21
SCL GPIO 22

DHT11 Connection

DHT11 Pin ESP32 Pin
VCC 3.3V
DATA GPIO 4
GND GND

7. Software Flowchart

+----------------+ | START | +--------+-------+ | v +----------------+ | Initialize ESP32| | Wi-Fi and Sensors| +--------+-------+ | v +----------------+ | Start Exam | +--------+-------+ | v +----------------+ | Capture Camera | | Frame | +--------+-------+ | v +----------------+ | Detect Face | +----+-------+----+ | | YES NO | | v v +------------+ +---------------+ | Track Face | | Start Timer | +------+-----+ +-------+-------+ | | | v | +---------------+ | | Timeout? | | +-------+-------+ | | | v | +---------------+ | | Absence Alert | | +---------------+ | v +----------------+ | Analyze Head | | Direction | +--------+--------+ | v +----------------+ | Generate Event | +--------+--------+ | v +----------------+ | Send to n8n | +--------+--------+ | v +----------------+ | Telegram Alert | | Google Sheets | | ThingSpeak | +----------------+

8. AI Face Tracking Logic

The AI camera captures the candidate's video stream and analyzes each frame.

  1. Capture video frame.
  2. Detect all faces.
  3. Count the number of detected faces.
  4. Extract face landmarks.
  5. Estimate head direction.
  6. Measure the duration of unusual behavior.
  7. Apply a time threshold.
  8. Generate an examination event.
  9. Send the event to the server and automation workflow.

Possible Event Types

  • NORMAL
  • FACE_NOT_DETECTED
  • MULTIPLE_FACES
  • LOOKING_LEFT
  • LOOKING_RIGHT
  • LOOKING_DOWN
  • LOOKING_AWAY
  • EXAM_STARTED
  • EXAM_FINISHED
  • SYSTEM_ERROR

9. Face Detection Decision Logic

CAMERA FRAME | v FACE DETECTION | +----------+----------+ | | | v v v 0 FACES 1 FACE 2+ FACES | | | v v v ABSENT NORMAL MULTIPLE FACE ALERT

10. AI Event JSON Format


{
    "student_id": "STUDENT_001",
    "exam_id": "EXAM_2026_001",
    "event_type": "MULTIPLE_FACES",
    "face_count": 2,
    "confidence": 0.94,
    "timestamp": "2026-07-20T10:30:00",
    "device_id": "ESP32_PROCTOR_01",
    "temperature": 28.5,
    "humidity": 62
}

11. ESP32 Source Code


#include <WiFi.h>

#include <HTTPClient.h>

#include <Wire.h>

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

#include <DHT.h>

#define SCREEN_WIDTH 128

#define SCREEN_HEIGHT 64

#define OLED_RESET -1

#define OLED_ADDRESS 0x3C

Adafruit_SSD1306 display(

    SCREEN_WIDTH,

    SCREEN_HEIGHT,

    &Wire,

    OLED_RESET

);

#define DHTPIN 4

#define DHTTYPE DHT11

DHT dht(

    DHTPIN,

    DHTTYPE

);

#define BUZZER_PIN 25

#define RED_LED 26

#define GREEN_LED 27

const char* WIFI_SSID =

    "YOUR_WIFI_NAME";

const char* WIFI_PASSWORD =

    "YOUR_WIFI_PASSWORD";

String serverURL =

    "http://YOUR_SERVER_IP/proctoring_event.php";

String thingSpeakURL =

    "https://api.thingspeak.com/update";

String thingSpeakAPIKey =

    "YOUR_THINGSPEAK_WRITE_API_KEY";

String deviceID =

    "ESP32_PROCTOR_01";

void setup()

{

    Serial.begin(115200);

    pinMode(

        BUZZER_PIN,

        OUTPUT

    );

    pinMode(

        RED_LED,

        OUTPUT

    );

    pinMode(

        GREEN_LED,

        OUTPUT

    );

    digitalWrite(

        BUZZER_PIN,

        LOW

    );

    digitalWrite(

        RED_LED,

        LOW

    );

    digitalWrite(

        GREEN_LED,

        HIGH

    );

    dht.begin();

    display.begin(

        SSD1306_SWITCHCAPVCC,

        OLED_ADDRESS

    );

    display.clearDisplay();

    display.setTextSize(1);

    display.setTextColor(

        SSD1306_WHITE

    );

    display.setCursor(0, 0);

    display.println(

        "AI PROCTORING"

    );

    display.println(

        "SYSTEM STARTING"

    );

    display.display();

    WiFi.begin(

        WIFI_SSID,

        WIFI_PASSWORD

    );

    while (

        WiFi.status()

        != WL_CONNECTED

    )

    {

        delay(500);

        Serial.print(".");

    }

    Serial.println();

    Serial.println(

        "WiFi Connected"

    );

    display.clearDisplay();

    display.setCursor(0, 0);

    display.println(

        "WiFi Connected"

    );

    display.println(

        WiFi.localIP()

    );

    display.display();

    delay(2000);

}

void loop()

{

    float temperature =

        dht.readTemperature();

    float humidity =

        dht.readHumidity();

    if (isnan(temperature))

    {

        temperature = 0;

    }

    if (isnan(humidity))

    {

        humidity = 0;

    }

    display.clearDisplay();

    display.setCursor(0, 0);

    display.println(

        "AI PROCTORING"

    );

    display.setCursor(0, 15);

    display.println(

        "STATUS: MONITORING"

    );

    display.setCursor(0, 30);

    display.print(

        "TEMP: "

    );

    display.print(

        temperature

    );

    display.println(

        " C"

    );

    display.setCursor(0, 45);

    display.print(

        "HUM: "

    );

    display.print(

        humidity

    );

    display.println(

        " %"

    );

    display.display();

    sendThingSpeakData(

        temperature,

        humidity,

        1

    );

    delay(15000);

}

12. ESP32 Suspicious Activity Alert Function


void activateSuspiciousAlert()

{

    digitalWrite(

        RED_LED,

        HIGH

    );

    digitalWrite(

        GREEN_LED,

        LOW

    );

    digitalWrite(

        BUZZER_PIN,

        HIGH

    );

    delay(1000);

    digitalWrite(

        BUZZER_PIN,

        LOW

    );

    delay(1000);

    digitalWrite(

        RED_LED,

        LOW

    );

    digitalWrite(

        GREEN_LED,

        HIGH

    );

}

13. ESP32 HTTP Event Function


void sendProctoringEvent(

    String eventType,

    int faceCount,

    float confidence

)

{

    if (

        WiFi.status()

        == WL_CONNECTED

    )

    {

        HTTPClient http;

        http.begin(

            serverURL

        );

        http.addHeader(

            "Content-Type",

            "application/json"

        );

        float temperature =

            dht.readTemperature();

        float humidity =

            dht.readHumidity();

        String jsonData = "{";

        jsonData +=

            "\"device_id\":\"";

        jsonData +=

            deviceID;

        jsonData +=

            "\",";

        jsonData +=

            "\"event_type\":\"";

        jsonData +=

            eventType;

        jsonData +=

            "\",";

        jsonData +=

            "\"face_count\":";

        jsonData +=

            faceCount;

        jsonData +=

            ",";

        jsonData +=

            "\"confidence\":";

        jsonData +=

            confidence;

        jsonData +=

            ",";

        jsonData +=

            "\"temperature\":";

        jsonData +=

            temperature;

        jsonData +=

            ",";

        jsonData +=

            "\"humidity\":";

        jsonData +=

            humidity;

        jsonData +=

            "}";

        int responseCode =

            http.POST(

                jsonData

            );

        Serial.print(

            "Server Response: "

        );

        Serial.println(

            responseCode

        );

        http.end();

    }

}

14. ThingSpeak Cloud Update Code


void sendThingSpeakData(

    float temperature,

    float humidity,

    int systemStatus

)

{

    if (

        WiFi.status()

        == WL_CONNECTED

    )

    {

        HTTPClient http;

        String url =

            thingSpeakURL +

            "?api_key=" +

            thingSpeakAPIKey +

            "&field1=" +

            String(

                temperature

            ) +

            "&field2=" +

            String(

                humidity

            ) +

            "&field3=" +

            String(

                systemStatus

            );

        http.begin(

            url

        );

        int responseCode =

            http.GET();

        Serial.print(

            "ThingSpeak Response: "

        );

        Serial.println(

            responseCode

        );

        http.end();

    }

}

15. PHP Backend API

Create a file named:

proctoring_event.php

<?php

header(

    "Content-Type: application/json"

);

$data = json_decode(

    file_get_contents(

        "php://input"

    ),

    true

);

if (!$data)

{

    echo json_encode(

        [

            "status" => "error",

            "message" =>

            "Invalid JSON data"

        ]

    );

    exit;

}

$device_id =

    $data["device_id"]

    ?? "UNKNOWN";

$event_type =

    $data["event_type"]

    ?? "UNKNOWN";

$face_count =

    $data["face_count"]

    ?? 0;

$confidence =

    $data["confidence"]

    ?? 0;

$temperature =

    $data["temperature"]

    ?? 0;

$humidity =

    $data["humidity"]

    ?? 0;

$timestamp =

    date(

        "Y-m-d H:i:s"

    );

$log =

    [

        "device_id" =>

        $device_id,

        "event_type" =>

        $event_type,

        "face_count" =>

        $face_count,

        "confidence" =>

        $confidence,

        "temperature" =>

        $temperature,

        "humidity" =>

        $humidity,

        "timestamp" =>

        $timestamp

    ];

file_put_contents(

    "proctoring_logs.json",

    json_encode(

        $log

    ) . PHP_EOL,

    FILE_APPEND

);

echo json_encode(

    [

        "status" =>

        "success",

        "message" =>

        "Proctoring event received",

        "data" =>

        $log

    ]

);

?>

16. IoT Monitoring Dashboard

The IoT webpage displays the latest examination monitoring event and event history.

+------------------------------------------------+ | AI SMART EXAM PROCTORING DASHBOARD | +------------------------------------------------+ | Latest Event | Face Count | Confidence | Temp | +------------------------------------------------+ | EVENT HISTORY TABLE | +------------------------------------------------+ | Time | Device | Event | Faces | Confidence | +------------------------------------------------+

17. n8n Automation Workflow

ESP32 / AI SYSTEM | v WEBHOOK TRIGGER | v PARSE JSON DATA | v AI EVENT ANALYSIS | v SUSPICIOUS EVENT? | / \ YES NO | | v v TELEGRAM GOOGLE ALERT SHEETS | v VOICE ALERT | v THINGSPEAK UPDATE

18. n8n Workflow JSON


{

    "name":

    "AI Exam Proctoring Automation",

    "nodes":

    [

        {

            "parameters":

            {

                "httpMethod":

                "POST",

                "path":

                "exam-proctoring"

            },

            "name":

            "Proctoring Webhook",

            "type":

            "n8n-nodes-base.webhook"

        },

        {

            "parameters":

            {

                "conditions":

                {

                    "string":

                    [

                        {

                            "value1":

                            "={{$json.event_type}}",

                            "operation":

                            "notEqual",

                            "value2":

                            "NORMAL"

                        }

                    ]

                }

            },

            "name":

            "Suspicious Event Check",

            "type":

            "n8n-nodes-base.if"

        },

        {

            "parameters":

            {

                "chatId":

                "YOUR_TELEGRAM_CHAT_ID",

                "text":

                "AI EXAM PROCTORING ALERT"

            },

            "name":

            "Telegram Alert",

            "type":

            "n8n-nodes-base.telegram"

        },

        {

            "parameters":

            {

                "operation":

                "append",

                "documentId":

                "YOUR_GOOGLE_SHEET_ID",

                "sheetName":

                "ExamEvents"

            },

            "name":

            "Google Sheets Logger",

            "type":

            "n8n-nodes-base.googleSheets"

        }

    ]

}

19. Telegram Bot Setup

  1. Open Telegram.
  2. Search for BotFather.
  3. Send /start.
  4. Send /newbot.
  5. Enter the bot name.
  6. Copy the generated bot token.
  7. Configure the Telegram credential in n8n.
  8. Find the Telegram chat ID.
  9. Configure the chat ID in the Telegram node.

Example Telegram Alert

AI EXAM PROCTORING ALERT

Event: MULTIPLE_FACES
Detected Faces: 2
AI Confidence: 94%
Device: ESP32_PROCTOR_01
Action: Supervisor review recommended.

20. Telegram Voice Notification Automation

AI EVENT | v n8n WEBHOOK | v AI AGENT ANALYSIS | v GENERATE ALERT TEXT | v TEXT-TO-SPEECH | v AUDIO FILE | v TELEGRAM VOICE MESSAGE

Example voice message:

Attention. Suspicious examination activity has been detected. Multiple faces were identified in the examination area. Supervisor review is recommended.

21. Google Sheets Integration

Timestamp Student ID Device ID Event Type Face Count Confidence Temperature Humidity
2026-07-20 10:30:00 STUDENT_001 ESP32_PROCTOR_01 MULTIPLE_FACES 2 0.94 28.5 62

22. ThingSpeak Cloud Dashboard Setup

Field Data
Field 1 Temperature
Field 2 Humidity
Field 3 Face Count
Field 4 Suspicious Event Code
Field 5 AI Confidence
Field 6 Exam Status
Field 7 Power Consumption
Field 8 Risk Score

23. AI Power Consumption Prediction Logic

The system can monitor voltage, current, environmental parameters and device activity to estimate power consumption.


Power = Voltage x Current

Example:

Voltage = 5V

Current = 0.45A

Power = 5 x 0.45

Power = 2.25 Watts

Historical Power Data | v Temperature Data | v Wi-Fi Activity | v Camera Activity | v AI Regression Model | v Predicted Power Consumption | v Power Optimization

24. AI Risk Score Logic


Multiple Face Detection      = +50 Points

Face Missing                 = +30 Points

Repeated Looking Away        = +20 Points

Repeated Suspicious Events   = Additional Points

Risk Score = Total Event Score

0 - 20      = NORMAL

21 - 50     = LOW RISK

51 - 75     = MEDIUM RISK

76 - 100    = HIGH RISK

25. AI Agent Architecture

PROCTORING DATA | v AI AGENT | +--------------+--------------+ | | | v v v ANALYZE RISK SCORE SUMMARY | | | +--------------+--------------+ | v AUTOMATION WORKFLOW | +---------------+---------------+ | | | v v v TELEGRAM GOOGLE SHEETS THINGSPEAK

26. Complete Project Workflow

STUDENT STARTS EXAM | v CAMERA CAPTURES VIDEO | v AI DETECTS FACE | v FACE TRACKING | v HEAD DIRECTION ANALYSIS | v SUSPICIOUS EVENT DETECTION | v ESP32 IoT DATA COLLECTION | v n8n WEBHOOK | v AI AGENT ANALYSIS | v RISK SCORE CALCULATION | +----------------+ | | v v NORMAL ALERT | | v v GOOGLE SHEETS TELEGRAM | | v v THINGSPEAK VOICE ALERT

27. Recommended Project Folder Structure


AI-Exam-Proctoring/

|

+-- esp32/

|   +-- exam_proctoring.ino

|

+-- ai/

|   +-- face_tracking.py

|   +-- face_detection.py

|   +-- requirements.txt

|

+-- web/

|   +-- index.php

|   +-- proctoring_event.php

|   +-- config.php

|   +-- proctoring_logs.json

|

+-- n8n/

|   +-- exam_proctoring_workflow.json

|

+-- database/

|   +-- exam_events.sql

|

+-- documentation/

    +-- project_report.md

28. Installation Procedure

Step 1: Install Arduino IDE

Install Arduino IDE and configure the ESP32 board package.

Step 2: Install Required Libraries

  • WiFi.h
  • HTTPClient.h
  • Wire.h
  • Adafruit GFX Library
  • Adafruit SSD1306 Library
  • DHT Sensor Library

Step 3: Configure Wi-Fi


const char* WIFI_SSID =

    "YOUR_WIFI_NAME";

const char* WIFI_PASSWORD =

    "YOUR_WIFI_PASSWORD";

Step 4: Upload ESP32 Firmware

  1. Connect ESP32 to computer.
  2. Select ESP32 board.
  3. Select COM port.
  4. Compile the program.
  5. Upload the program.
  6. Open Serial Monitor.

Step 5: Configure PHP Server

Place the PHP files inside the XAMPP htdocs folder.


C:/xampp/htdocs/proctoring/

Step 6: Configure n8n

  1. Create Webhook node.
  2. Add JSON processing node.
  3. Add IF condition.
  4. Add Telegram node.
  5. Add Google Sheets node.
  6. Add HTTP Request node for ThingSpeak.
  7. Add voice notification automation.
  8. Activate the workflow.

29. Security Recommendations

  • Use HTTPS communication.
  • Use API authentication tokens.
  • Protect the PHP API.
  • Use secure passwords.
  • Restrict database access.
  • Use role-based access control.
  • Do not store unnecessary raw video.
  • Protect biometric information.
  • Use encrypted communication.

30. Privacy and Responsible AI Design

Because this project uses face tracking and AI-based monitoring, it should be deployed responsibly.

  • Inform candidates about monitoring.
  • Obtain appropriate consent where required.
  • Avoid unnecessary storage of raw video.
  • Protect sensitive personal data.
  • Use AI alerts as review signals.
  • Do not automatically declare a student guilty based only on AI detection.
  • Provide human review for important examination decisions.
  • Consider false positives caused by poor lighting, camera failure and network problems.

31. Future Enhancements

  • Advanced face recognition.
  • Registered candidate verification.
  • Eye gaze tracking.
  • Advanced head pose estimation.
  • Multi-camera monitoring.
  • AI object detection.
  • Cloud database integration.
  • Mobile application.
  • AI-generated examination reports.
  • Advanced power consumption prediction.
  • Edge AI processing.
  • Offline event storage.
  • Multi-examination center support.

32. Final Project Abstract

The AI-Based Smart Exam Proctoring System Using Face Tracking is an intelligent examination monitoring solution that combines artificial intelligence, computer vision, ESP32-based IoT technology, cloud services and workflow automation.

The system continuously monitors a candidate's face during an examination and identifies events such as face absence, multiple faces and repeated head movement or looking away.

The ESP32 controller collects environmental and device information and communicates with the IoT webpage and cloud platforms.

Through n8n automation, the system processes detected events and automatically logs them into Google Sheets, updates the ThingSpeak cloud dashboard and sends real-time Telegram text and voice notifications to the examination supervisor.

An AI agent can analyze the complete event history, calculate a risk score and generate an examination monitoring summary.

The proposed system reduces the need for continuous manual supervision and provides a scalable, intelligent and automated platform for modern online and computer-based examinations.

33. Complete Technology Stack

Artificial Intelligence
Computer Vision
Face Tracking
ESP32
IoT
PHP Webpage
n8n Automation
AI Agent
Telegram Alerts
Voice Notifications
Google Sheets
ThingSpeak Cloud Dashboard
HTML; ?>

AI-Based Smart E-Voting System with Face Authentication

<?php echo $title; ?>

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

1. Full Project Description

2. Main Project Objectives

3. System Architecture

VOTER ↓ AI FACE AUTHENTICATION ↓ AUTHORIZED VOTER VERIFICATION ↓ WEB VOTING INTERFACE ↓ ESP32 IoT CONTROLLER ↓ n8n AUTOMATION WORKFLOW ↓ AI AGENT ANALYSIS ↓ GOOGLE SHEETS LOGGING ↓ THINGSPEAK CLOUD DASHBOARD ↓ TELEGRAM TEXT ALERT ↓ TELEGRAM VOICE ALERT

4. Hardware Components List

Component Purpose
Used for implementing the AI-powered IoT voting system.

5. Software Requirements

6. Circuit Schematic Diagram


                         +----------------------+
                         |        ESP32         |
                         |                      |
                         | GPIO 25 <------------ Button 1
                         | GPIO 26 <------------ Button 2
                         | GPIO 27 <------------ Button 3
                         | GPIO 14 <------------ Button 4
                         |                      |
                         | GPIO 21 ------------ SDA
                         | GPIO 22 ------------ SCL
                         |                      |
                         | GPIO 18 ------------ Buzzer
                         | GPIO 2  ------------ Auth LED
                         | GPIO 4  ------------ Vote LED
                         | GPIO 5  ------------ Error LED
                         +----------+-----------+
                                    |
              +---------------------+---------------------+
              |                     |                     |
              v                     v                     v
        +-----------+        +-----------+        +-------------+
        | OLED      |        | INA219    |        | ESP32-CAM   |
        | Display   |        | Sensor    |        | Camera      |
        +-----------+        +-----------+        +-------------+

7. Pin Connection Table

Device ESP32 Pin
Candidate Button 1 GPIO 25
Candidate Button 2 GPIO 26
Candidate Button 3 GPIO 27
Candidate Button 4 GPIO 14
OLED SDA GPIO 21
OLED SCL GPIO 22
Buzzer GPIO 18
Authentication LED GPIO 2
Voting LED GPIO 4
Error LED GPIO 5

8. Complete System Flowchart


START

↓

Initialize ESP32

↓

Connect Wi-Fi

↓

Initialize Camera

↓

Initialize Sensors

↓

Wait for Voter

↓

Capture Face

↓

AI Face Authentication

↓

Is Face Authorized?

├── NO
│
├── Display Authentication Failed
│
├── Record Failed Attempt
│
└── Send Telegram Alert

YES

↓

Check Duplicate Voting Status

↓

Already Voted?

├── YES
│
├── Reject Voting Attempt
│
└── Send Security Alert

NO

↓

Display Candidate Options

↓

Voter Selects Candidate

↓

Confirm Voting Selection

↓

Create Voting Event

↓

Send Event to n8n Webhook

↓

AI Agent Analysis

↓

Google Sheets Logging

↓

ThingSpeak Update

↓

Telegram Text Alert

↓

Telegram Voice Alert

↓

Update IoT Dashboard

↓

END

9. Data Flow Diagram

CAMERA ↓ FACE IMAGE ↓ AI FACE RECOGNITION ↓ AUTHENTICATION TOKEN ↓ ESP32 ↓ HTTPS / WEBHOOK ↓ n8n ↓ AI AGENT ↓ ┌───────────────────┬──────────────────┬───────────────────┐ │ │ │ GOOGLE SHEETS THINGSPEAK TELEGRAM │ │ │ VOTING LOG IoT DATA TEXT ALERT │ ↓ VOICE ALERT

10. ESP32 Source Code



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

const char* WIFI_SSID = "YOUR_WIFI_NAME";

const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";

const char* N8N_WEBHOOK_URL =
"https://your-n8n-domain.com/webhook/e-voting";

#define BUTTON_1 25
#define BUTTON_2 26
#define BUTTON_3 27
#define BUTTON_4 14

#define LED_AUTH 2
#define LED_VOTE 4
#define BUZZER 18

bool authenticated = false;

bool voteSubmitted = false;

void setup() {

    Serial.begin(115200);

    pinMode(BUTTON_1, INPUT_PULLUP);

    pinMode(BUTTON_2, INPUT_PULLUP);

    pinMode(BUTTON_3, INPUT_PULLUP);

    pinMode(BUTTON_4, INPUT_PULLUP);

    pinMode(LED_AUTH, OUTPUT);

    pinMode(LED_VOTE, OUTPUT);

    pinMode(BUZZER, OUTPUT);

    WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

    Serial.print("Connecting to WiFi");

    while (WiFi.status() != WL_CONNECTED) {

        delay(500);

        Serial.print(".");

    }

    Serial.println();

    Serial.println("WiFi Connected");

    Serial.println(WiFi.localIP());

}

void loop() {

    if (!authenticated) {

        Serial.println("Waiting for AI Face Authentication");

        delay(3000);

        authenticated = true;

        digitalWrite(LED_AUTH, HIGH);

        tone(BUZZER, 1000, 300);

        Serial.println("Face Authentication Successful");

    }

    if (authenticated && !voteSubmitted) {

        digitalWrite(LED_VOTE, HIGH);

        if (digitalRead(BUTTON_1) == LOW) {

            submitVote("CANDIDATE_1");

        }

        if (digitalRead(BUTTON_2) == LOW) {

            submitVote("CANDIDATE_2");

        }

        if (digitalRead(BUTTON_3) == LOW) {

            submitVote("CANDIDATE_3");

        }

        if (digitalRead(BUTTON_4) == LOW) {

            submitVote("CANDIDATE_4");

        }

    }

}

void submitVote(String candidate) {

    voteSubmitted = true;

    digitalWrite(LED_VOTE, LOW);

    tone(BUZZER, 1500, 500);

    if (WiFi.status() == WL_CONNECTED) {

        HTTPClient http;

        http.begin(N8N_WEBHOOK_URL);

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

        String jsonData = "{";

        jsonData += "\"event\":\"VOTE_SUBMITTED\",";

        jsonData += "\"candidate\":\"" + candidate + "\",";

        jsonData += "\"device\":\"ESP32_STATION_01\",";

        jsonData += "\"authentication\":\"FACE_AUTHENTICATED\"";

        jsonData += "}";

        int responseCode = http.POST(jsonData);

        Serial.print("n8n Response Code: ");

        Serial.println(responseCode);

        http.end();

    }

}

11. n8n Workflow Architecture


ESP32

↓

n8n Webhook Trigger

↓

Validate JSON Data

↓

Check Authentication

↓

Check Event Type

↓

AI Agent Analysis

↓

┌───────────────────────────┐
│                           │
▼                           ▼
Google Sheets          ThingSpeak
Logging                 Cloud Update
│                           │
└──────────────┬────────────┘
               ▼
        Telegram Notification
               │
               ▼
        Text-to-Speech
               │
               ▼
        Telegram Voice Alert

12. n8n Workflow JSON



{
  "name": "AI E-Voting IoT Automation",

  "nodes": [

    {
      "parameters": {
        "httpMethod": "POST",
        "path": "e-voting",
        "responseMode": "onReceived"
      },

      "name": "ESP32 Voting Webhook",

      "type": "n8n-nodes-base.webhook",

      "typeVersion": 2

    },

    {
      "parameters": {
        "jsCode": "const data = $json.body || $json;

return [{
  json: {
    event: data.event,
    candidate: data.candidate,
    device: data.device,
    authentication: data.authentication,
    timestamp: new Date().toISOString()
  }
}];"
      },

      "name": "Validate Voting Data",

      "type": "n8n-nodes-base.code",

      "typeVersion": 2

    },

    {
      "parameters": {
        "operation": "append",
        "documentId": "GOOGLE_SHEET_ID",
        "sheetName": "Votes"
      },

      "name": "Google Sheets Logging",

      "type": "n8n-nodes-base.googleSheets",

      "typeVersion": 4

    },

    {
      "parameters": {
        "method": "POST",
        "url": "https://api.thingspeak.com/update"
      },

      "name": "ThingSpeak Update",

      "type": "n8n-nodes-base.httpRequest",

      "typeVersion": 4

    },

    {
      "parameters": {
        "chatId": "TELEGRAM_CHAT_ID",
        "text": "New authenticated voting event received."
      },

      "name": "Telegram Notification",

      "type": "n8n-nodes-base.telegram",

      "typeVersion": 1

    }

  ]

}

13. Telegram Bot Setup

  1. Open Telegram.
  2. Search for BotFather.
  3. Execute the command /newbot.
  4. Enter a bot name.
  5. Enter a unique bot username.
  6. Copy the generated Bot Token.
  7. Send a message to your bot.
  8. Obtain the Telegram Chat ID.
  9. Add Telegram credentials inside n8n.
  10. Test a notification workflow.

14. Telegram Notification Examples


FACE AUTHENTICATION SUCCESSFUL

Voting Station:
ESP32_STATION_01

Status:
Authorized voter detected.

---------------------------------

VOTE EVENT

Candidate:
CANDIDATE_1

Station:
ESP32_STATION_01

Status:
Vote event recorded successfully.

---------------------------------

SECURITY ALERT

Multiple authentication failures detected.

Device:
ESP32_STATION_01

Action:
System monitoring activated.

15. Telegram Voice Notification Automation

VOTING EVENT ↓ n8n WEBHOOK ↓ AI AGENT ↓ GENERATE TEXT MESSAGE ↓ TEXT-TO-SPEECH SERVICE ↓ AUDIO FILE ↓ TELEGRAM SEND AUDIO

Example voice notification:

Attention. A new authenticated voting event has been recorded at voting station one.

16. Google Sheets Integration

Column Description
Timestamp Date and time of event
Event Type Voting or authentication event
Candidate Selected candidate identifier
Station ID ESP32 station identifier
Authentication Status Success or failure
Voltage Measured voltage
Current Measured current
Power Power consumption
AI Risk Level Low, medium or high

17. ThingSpeak Cloud Dashboard

ThingSpeak Field Data
Field 1 Voting Events
Field 2 Authentication Success
Field 3 Authentication Failures
Field 4 Voltage
Field 5 Current
Field 6 Power
Field 7 Energy
Field 8 AI Power Prediction

18. AI Power Consumption Prediction Logic


Voltage

+

Current

↓

Power Calculation

↓

Historical Power Data

↓

Average Power

↓

Voting Activity Factor

↓

AI Prediction

↓

Future Power Consumption

The basic electrical power relationship is:


Power = Voltage × Current

For example:


Voltage = 5 Volts

Current = 0.25 Amperes

Power = 5 × 0.25

Power = 1.25 Watts

19. AI Anomaly Detection

  • Too many authentication failures.
  • Repeated voting requests.
  • Unusual power consumption.
  • Unexpected ESP32 device activity.
  • Multiple requests from the same device.
  • Invalid API requests.

20. PHP IoT Dashboard



<?php

$esp32_status = "ONLINE";

$authentication_status = "ACTIVE";

$total_votes = 245;

$authentication_failures = 3;

$power_consumption = "1.25 W";

$ai_risk_level = "LOW";

?>

<!DOCTYPE html>

<html>

<head>

<title>AI Smart E-Voting Dashboard</title>

</head>

<body>

<h1>AI-Based Smart E-Voting IoT Dashboard</h1>

<p>ESP32 Status: <?php echo $esp32_status; ?></p>

<p>Face Authentication:
<?php echo $authentication_status; ?>
</p>

<p>Total Voting Events:
<?php echo $total_votes; ?>
</p>

<p>Authentication Failures:
<?php echo $authentication_failures; ?>
</p>

<p>Power Consumption:
<?php echo $power_consumption; ?>
</p>

<p>AI Risk Level:
<?php echo $ai_risk_level; ?>
</p>

</body>

</html>

21. Recommended Database Structure

Voter Table


voter_id

face_template_hash

authentication_status

voted_status

registration_timestamp

Vote Event Table


event_id

anonymous_voter_token

candidate_id

timestamp

station_id

22. Project Folder Structure


AI-E-VOTING-SYSTEM/

│

├── esp32/

│   └── smart_voting_esp32.ino

│

├── face-authentication/

│   ├── face_authentication.py

│   ├── authorized_users/

│   └── model/

│

├── web-dashboard/

│   ├── index.php

│   ├── dashboard.php

│   ├── config.php

│   └── api.php

│

├── n8n/

│   └── ai_e_voting_workflow.json

│

├── database/

│   └── database.sql

│

└── documentation/

    ├── circuit-diagram

    ├── flowchart

    └── project-report

23. Complete Project Operation

  1. Power ON the ESP32.
  2. ESP32 connects to Wi-Fi.
  3. Camera captures the voter face.
  4. AI face authentication verifies the voter.
  5. The system checks duplicate voting status.
  6. The voting interface displays candidates.
  7. The voter selects a candidate.
  8. ESP32 creates a voting event.
  9. ESP32 sends data to the n8n webhook.
  10. n8n validates the data.
  11. AI Agent analyzes the event.
  12. Google Sheets stores the event.
  13. ThingSpeak updates the IoT dashboard.
  14. Telegram sends a notification.
  15. Text-to-Speech generates a voice message.
  16. Telegram sends the voice alert.

24. Security Architecture


CAMERA

↓

AI FACE AUTHENTICATION

↓

AUTHENTICATION TOKEN

↓

ESP32

↓

HTTPS

↓

n8n WEBHOOK

↓

VALIDATION

↓

AI ANALYSIS

↓

CLOUD LOGGING

Recommended security features include HTTPS, API authentication, device authentication, secure Wi-Fi, encrypted credentials, duplicate-event protection, replay protection, timestamps and audit logs.

25. Future Enhancements

26. Final Complete Project Workflow


VOTER

↓

AI FACE AUTHENTICATION

↓

AUTHORIZED VOTER

↓

DUPLICATE VOTE CHECK

↓

VOTING INTERFACE

↓

CANDIDATE SELECTION

↓

ESP32

↓

n8n AUTOMATION

↓

AI AGENT

↓

GOOGLE SHEETS

↓

THINGSPEAK

↓

TELEGRAM TEXT ALERT

↓

TEXT-TO-SPEECH

↓

TELEGRAM VOICE ALERT

↓

AI POWER PREDICTION

↓

IOT CLOUD DASHBOARD

27. Project Summary

This project combines Artificial Intelligence, Face Authentication, ESP32 IoT technology, n8n workflow automation, AI Agents, Telegram notifications, voice alerts, Google Sheets, ThingSpeak cloud monitoring and AI power consumption prediction into a single intelligent e-voting IoT platform. The system provides a complete workflow from voter authentication to voting event processing, cloud data logging, AI analysis, IoT monitoring and real-time notification automation.

AI-Based Smart E-Voting System with Face Authentication

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