⚠ Alarm!
Voltage or frequency anomaly detected
Voltage
--
VNormal
Frequency
--
HzNormal
Alarm Status
All systems normal
Power Quality Analysis
AI-Powered Insights
Click "Generate Insights" to get AI-powered analysis
Real-time Voltage & Frequency Monitoring
The AC Voltage Monitor is a real-time power quality monitoring system that tracks voltage and frequency from your electrical grid. It uses an ESP32 microcontroller with a ZMPT101B voltage sensor to measure AC voltage and calculate frequency, then streams this data to a web dashboard via WebSocket.
The ESP32 microcontroller samples AC voltage at 4kHz using the ZMPT101B sensor. It calculates RMS voltage and frequency using zero-crossing detection algorithms.
Data is sent every 500ms via WebSocket to the FastAPI backend server. This ensures real-time updates without polling overhead.
The FastAPI server stores data in SQLite database and broadcasts updates to all connected web clients. It also calculates power quality metrics and integrates with AI services.
The dashboard displays real-time voltage, frequency, alarms, power quality metrics, and AI-powered insights. Charts update automatically as new data arrives.
Live voltage and frequency tracking with sub-second updates via WebSocket.
Automatic detection of voltage drops and frequency anomalies with visual and audio alerts.
Calculates stability metrics, deviations, power factor, and overall quality score.
Powered by Google Gemini AI to analyze patterns and provide recommendations.
Power Quality Analysis calculates advanced metrics from your voltage and frequency readings to assess the overall health and stability of your electrical supply. These metrics are computed in real-time using statistical analysis of the last 100 sensor readings.
A composite score (0-100) calculated from voltage accuracy, frequency accuracy, and stability metrics. Formula: (Voltage Score × 40%) + (Frequency Score × 30%) + (Stability Score × 30%)
Measures how consistent voltage readings are over time. Calculated as: 100 - (Standard Deviation / Nominal Voltage × 100)
Measures frequency consistency. Calculated similarly to voltage stability: 100 - (Frequency Std Dev / Nominal Frequency × 100)
Estimated power factor based on voltage and frequency stability. Formula: 0.95 + (Stability Average / 2000)
Update Frequency: Calculations refresh every 30 seconds automatically, or manually via the refresh button.
The AI Insights feature uses Google's Gemini AI to analyze your power quality data patterns, detect anomalies, and provide actionable recommendations. It processes the last 50 sensor readings to understand trends and identify potential issues.
The system collects the last 50 sensor readings from the database, including voltage, frequency, alarm modes, and timestamps. It calculates statistical summaries like average values, ranges, and alarm event counts.
The data summary is sent to Google Gemini AI via API with a specialized prompt asking for: insights about power quality, recommendations for improvement, and anomaly detection based on patterns.
The AI's markdown-formatted response is parsed intelligently to extract structured sections: removing markdown syntax, detecting headers, parsing lists, and organizing content into Insights, Recommendations, and Anomalies categories.
The parsed insights are displayed in organized, color-coded sections on the dashboard. Each category (Insights, Recommendations, Anomalies) is shown with appropriate icons and formatting for easy reading.
AI analyzes patterns and provides observations about your power quality trends, stability characteristics, and overall system health.
Actionable suggestions based on detected patterns, such as equipment maintenance, load management, or monitoring improvements.
Detected unusual patterns, potential issues, or deviations from normal operation that may require attention.
Voltage or frequency anomaly detected
--
VNormal
--
HzNormal
All systems normal
Click "Generate Insights" to get AI-powered analysis