AI Smart Voice-Based Attendance and Authentication System

AI Smart Voice-Based Attendance and Authentication System Using ESP32 + AI Agent + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard
AI Smart Voice-Based Attendance and Authentication System Using ESP32 + AI Agent + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak Cloud Dashboard Project Overview The AI Smart Voice-Based Attendance and Authentication System is an advanced IoT and AI-based attendance solution that uses voice authentication instead of traditional RFID cards or fingerprints. Every authorized user registers their voice. During attendance, the ESP32 records a voice sample and sends it to an AI voice verification service (or Edge AI model). If the voice matches the enrolled user, attendance is marked automatically. The system also uploads attendance records to Google Sheets, updates the ThingSpeak cloud dashboard, sends Telegram notifications with voice alerts, and performs AI analytics for attendance trends. Project Objectives Contactless attendance AI-based voice authentication Prevent proxy attendance Cloud attendance logging Live IoT dashboard Telegram notifications Voice announcement Attendance analytics Power-efficient ESP32 operation AI future prediction Applications Schools Colleges Offices Factories Laboratories Smart classrooms Libraries Examination halls Research centers Hardware Components Component Quantity ESP32 Development Board 1 INMP441 I2S Microphone 1 MAX98357A I2S Amplifier 1 8Ω Speaker 1 OLED Display (128x64) 1 Push Button 1 RGB LED 1 Buzzer 1 Relay Module (Optional) 1 WiFi Router 1 USB Cable 1 Breadboard 1 Jumper Wires Several Software Requirements Arduino IDE ESP32 Board Package n8n Google Sheets Telegram Bot ThingSpeak OpenAI/Whisper API (or Voice Recognition API) ArduinoJson Library WiFi Library HTTPClient Library System Architecture User ↓ Speaks Name ↓ ESP32 ↓ Microphone ↓ Voice Recording ↓ AI Voice Recognition ↓ Voice Authentication ↓ Attendance Decision ↓ Google Sheets ↓ ThingSpeak ↓ Telegram Notification ↓ Voice Announcement ↓ OLED Display Working Principle Step 1 Power ON ESP32. ESP32 connects to WiFi. Connecting... WiFi Connected Step 2 OLED shows AI Attendance System Press Button Step 3 User presses the attendance button. ESP32 starts recording voice. Example: My name is Rahul Voice duration 3 Seconds Step 4 ESP32 converts microphone audio into digital samples. Example 16 kHz 16-bit PCM Step 5 Voice sample sent to AI. Possible AI Whisper Google Speech API Azure Speech Custom TensorFlow Model Step 6 Speech converted into text. Example Rahul Step 7 Voice Authentication AI compares Registered Voice vs Current Voice If similarity >95% Authentication Success Else Authentication Failed Step 8 Attendance Record Name Date Time Status Confidence Example Rahul 29/06/2026 09:04 Present 98.3% Step 9 Google Sheets Updated Name Time Date Voice Score Attendance Step 10 ThingSpeak Upload Fields Field1 Attendance Count Field2 Successful Logins Field3 Failed Attempts Field4 Voice Confidence Field5 Temperature (Optional) Field6 Battery Field7 Signal Strength Field8 Power Consumption Step 11 Telegram Notification Attendance Marked Name: Rahul Time: 09:04 Confidence: 98% Step 12 Telegram Voice Message Example Rahul attendance marked successfully. Generated using Text-to-Speech Step 13 OLED Welcome Rahul Attendance Recorded Complete System Flowchart Power ON ↓ Initialize ESP32 ↓ Connect WiFi ↓ Initialize OLED ↓ Initialize Microphone ↓ Button Press? ↓ No ↓ Wait ↓ Yes ↓ Record Voice ↓ Send Voice to AI ↓ Recognize Speech ↓ Authenticate Voice ↓ Match? ↓ No ↓ Failed Message ↓ Telegram Alert ↓ Retry ↓ Yes ↓ Store Attendance ↓ Google Sheets ↓ ThingSpeak ↓ Telegram ↓ Voice Announcement ↓ OLED Success ↓ Sleep Mode ↓ Repeat Circuit Connections INMP441 VCC → 3.3V GND → GND WS → GPIO25 SCK → GPIO26 SD → GPIO33 OLED VCC → 3.3V GND → GND SDA → GPIO21 SCL → GPIO22 Push Button GPIO15 Other Side GND RGB LED Red → GPIO18 Green → GPIO19 Blue → GPIO23 MAX98357A DIN → GPIO27 BCLK → GPIO26 LRC → GPIO25 VIN → 5V GND → GND ESP32 Program Flow Setup() ↓ Connect WiFi ↓ Initialize OLED ↓ Initialize Microphone ↓ Initialize Speaker ↓ Loop() ↓ Button Press? ↓ Record Audio ↓ Upload ↓ Receive AI Result ↓ Attendance ↓ Cloud Update ↓ Telegram ↓ Sleep Google Sheets Structure Name Date Time Status Voice Score Device ID n8n Workflow Webhook ↓ Receive ESP32 Data ↓ Verify JSON ↓ Google Sheets ↓ ThingSpeak ↓ OpenAI Analysis ↓ Generate Insights ↓ Telegram Text ↓ Text to Speech ↓ Telegram Voice ↓ Store Logs Telegram Automation Message AI Attendance Employee Rahul Attendance Marked Confidence 98% Location Lab-1 Time 09:04 Voice Attendance successfully recorded for Rahul. ThingSpeak Dashboard Charts Attendance Count Authentication Success Authentication Failure Voice Confidence WiFi RSSI Battery Voltage ESP32 Temperature Daily Attendance AI Attendance Analytics AI calculates Late arrivals Frequent absentees Average attendance Weekly trends Monthly trends Employee punctuality Student performance AI Power Consumption Prediction Logic The ESP32 operates in active mode only during attendance events and remains in deep sleep the rest of the time to conserve energy. Inputs Number of authentications per day Active recording duration Wi-Fi transmission time Deep sleep duration Battery voltage Average current consumption AI Prediction Process Collect historical power usage from ESP32. Upload power data to ThingSpeak. n8n retrieves historical values daily. AI model predicts the next day's battery consumption. If the predicted battery level is below a threshold, Telegram sends a maintenance alert. Example Calculation Active current: 180 mA Deep sleep current: 0.15 mA Active time per authentication: 8 seconds 100 authentications/day Estimated daily energy: Active: ≈40 mAh Sleep: ≈3.6 mAh Total: ≈43.6 mAh/day Battery life with a 3000 mAh battery: ≈68 days (excluding battery aging and self-discharge) Voice Notification Automation Attendance is successfully authenticated. n8n receives attendance data. Text message is generated. Text-to-Speech converts the message into audio. Audio is sent to Telegram as a voice message. Users receive both text and voice notifications instantly. Example Voice: "Good morning Rahul. Your attendance has been successfully recorded at 09:04 AM." Future Enhancements Face + Voice dual-factor authentication Offline Edge AI voice recognition Anti-spoofing voice detection GPS-based attendance validation QR code backup authentication RFID fallback option Fingerprint + Voice hybrid system MQTT cloud communication Mobile application integration Email notifications SMS alerts AWS IoT integration Azure IoT Hub support Firebase database synchronization Multi-language voice recognition AI attendance anomaly detection Real-time attendance dashboards Automatic attendance reports in PDF Department-wise attendance analytics Employee productivity scoring Integration with payroll or student management systems Deployment Guide Assemble the hardware according to the circuit connections. Install the ESP32 board package and required Arduino libraries. Configure Wi-Fi credentials in the ESP32 source code. Create a Telegram Bot using BotFather and obtain the Bot Token. Create a Google Sheet and deploy an Apps Script Web App to receive attendance data. Create a ThingSpeak channel and note the Channel ID and Write API Key. Import the provided n8n workflow JSON and configure credentials for Google Sheets, Telegram, ThingSpeak, and the AI service. Upload the ESP32 firmware using Arduino IDE. Enroll authorized users by recording and storing their voice profiles. Power on the system and verify Wi-Fi connectivity. Test successful and failed authentication scenarios. Confirm that attendance records appear in Google Sheets, dashboard data updates in ThingSpeak, and Telegram receives both text and voice notifications. Place the device at the attendance location and monitor performance using the cloud dashboard. This architecture provides a complete AI-enabled attendance solution combining ESP32 IoT hardware, AI voice authentication, cloud analytics, n8n workflow automation, Telegram alerts, Google Sheets logging, and ThingSpeak monitoring suitable for engineering final-year projects and real-world deployments.

Comments