AI-Enabled Smart Grid Monitoring System
Abstract
Abstract
A project by:
Mentors: Mohammed Suhail, Namith A P, Reuben Abraham Jacob
Mentees: Abel Geo Tomy, Addle Antony Jais, Gandu Niranjan, Vihaan Sunil, Viren Garg
Google Meet Link :https://meet.google.com/dfq-zpnt-rgt
Github Repo :
- https://github.com/ReubenAbrahamJacob/AI-Enabled-Smart-Grid-Monitoring-System
- https://github.com/namith17ap/Envision-26-D03
Aim:
To build a complete end-to-end Smart grid monitoring system featuring:
- Automatic Power factor correction system
- Real-time smart grid management
- Anomaly detection
- Load forecasting
- Predictive maintenance
- Live web dashboard
Introduction:
Modern electrical grids require continuous monitoring to ensure stability, efficiency, and reliability. Traditional monitoring systems are reactive in nature and only generate alarms after predefined thresholds are crossed. Such systems are unable to predict faults, equipment degradation, or changing load demands in advance.
This project introduces an AI-enabled smart grid monitoring system integrated with an Automatic Power Factor Correction (APFC) mechanism. The system continuously measures electrical parameters such as voltage, current, active power (P), reactive power (Q), frequency, and power factor.
Machine Learning models are used for:
- Real-time Anomaly detection
- Short-term Load forecasting
- Predictive maintenance
Alongside predictive monitoring, the APFC subsystem dynamically calculates reactive power demand and intelligently switches capacitor banks to compensate for inductive lag caused by loads such as motors and transformers.
The complete system is visualized through a live Streamlit-based dashboard featuring gauges, alerts, graphs, and equipment health indicators.
Literature Survey:
Research in smart grids and industrial power systems highlights the increasing need for intelligent monitoring and power optimization systems.
Studies show that:
- Isolation Forest algorithms are highly effective for unsupervised fault detection in electrical systems. Hence, we have used Isolation Forest algorithm for anomaly detection.
- For Load forecasting, we have used three algorithms: XG Boost, ANN and LSTM and benchmarked their results.
- Predictive maintenance reduces downtime and improves equipment lifespan.
- APFC systems significantly reduce transmission losses and improve grid efficiency.
Existing APFC systems primarily use fixed threshold logic. This project improves upon conventional systems by integrating AI-driven forecasting and predictive analytics.
Technologies used:
| Category | Technology used |
| Data handling and pre-processing | NumPy, Pandas |
| Data Visualization | Matplotlib, Plotly |
| ML/DL Libraries used | Sci-kit Learn, Tensorflow/Keras, XGBoost |
| Dashboard | Streamlit |
| Simulation | MATLAB Simulink |
| Hardware interface | Arduino, CT/PT Sensors |
Methodology:

Automatic Power Factor Correction system
Core Working Principle:
- When inductive loads (like motors or transformers) are connected to an AC grid, they draw reactive power (VAR), causing the current to lag the voltage. This results in a poor Power Factor (PF).
- This APFC system continuously measures the grid's voltage and current, calculates the active (P) and reactive (Q) power, and feeds this data into a microcontroller block. The microcontroller calculates the "true" reactive power demand of the load and cycles through a logic algorithm to determine the exact combination of capacitor banks needed to supply that reactive power locally. By switching these capacitors on via breakers, it cancels out the inductive lag and corrects the power factor.
Component Breakdown:
- Current and Potential Transformers: These measurement blocks capture the instantaneous voltage (V) and current (I) from the main line and step them down for the measurement subsystem.
- AC Lagging Loads: The simulation features three distinct, switchable inductive loads ("Series RLC Load" blocks) to simulate real-world factory or grid conditions.

- Q & PF Measurement Subsystem: This block takes the raw voltage and current signals and processes them to determine the system's electrical state. It calculates the instantaneous Power Factor using the standard formula.

- Microcontroller Logic (The Brain): Its logic is highly optimized for Switching capacitors unlike conventional step switching method:
- True Load Reconstruction: It first calculates the true reactive load by adding the reactive power currently supplied by the active capacitors back to the measured grid reactive power
- Combination Testing: Since there are 4 capacitor banks, there are24 = 16 possible switching combinations. The code generates all 16 combinations and calculates the exact VAR compensation for each.
- Cost & Penalty: It calculates how far off each combination is from perfect compensation. It applies a 1.2x penalty if a combination over-compensates (pushing the system into a leading power factor, which is undesirable).
- Hysteresis Band: To prevent the breakers from chattering (switching on and off rapidly due to minor fluctuations), it includes a 100 VAR hysteresis band. It will only change the capacitor state if the new combination improves the compensation by more than 100 VAR compared to the current state.
-
Capacitor Banks (APFC Panel): Based on the binary outputs from the microcontroller, circuit breakers connect or disconnect specific capacitor banks to the grid. The available banks are sized to allow for fine-tuned compensation.
-


-
Data Generation:
To demonstrate our AI-enabled smart grid functionality, we used Synthetic smart grid data simulating 30 days of electrical sensor readings at 15-minute intervals. It includes realistic day/night load patterns, injected fault anomalies (2%), and gradual equipment degradation events

-
Anomaly Detection
We have used Isolation Forest algorithm for Anomaly detection. This model detecting voltage faults and power factor degradation in real time

-
Load Forecasting:
We have used three models: ANN, LSTM, and XGBoost to perfrom short term load forecasting. These three models are benchmarked for short-term reactive and active power forecasting (15 minutes ahead).

-
Predictive Maintenance:
Random Forest Regressor predicting equipment degradation level (0 to 1) from rolling window features.
We have set Health thresholds:
-
0.0 - 0.3: Healthy, no action required
-
0.3 - 0.7: Early degradation, schedule inspection
-
0.7 - 1.0: Critical, immediate maintenance required

-
Live StreamLit Dashboard:
Live web dashboard with three tabs:
- Live Monitor: Real time gauges, anomaly alerts, scrolling graphs
- Load Forecasting: Predicted vs actual graphs, APFC recommendations
- Equipment Health: Degradation gauge, health score, trend graphs
Results:
- Automatic Power factor correction:
- Without Power Factor Correction (Lagging Current at 0.7 pf)

- After Power Factor Correction (in Phase Current at 0.995 pf):

-
Anomaly detection:
| Metric | Score |
| Precision | 0.93 |
| Recall | 0.95 |
| F1 Score | 0.94 |
-
Load Forecasting:
Key finding: XGBoost outperforms ANN and LSTM on tabular smart grid data with explicit feature engineering, consistent with existing literature on structured time series forecasting.
| Model |
R² (Reactive) |
MAE (Reactive) |
R² (Active) |
MAE (Active) |
| XGBoost |
0.997 |
0.191 kVAR | 1.000 | 0.073 kW |
| ANN |
0.987 |
0.706 kVAR | 0.991 | 1.260 kW |
| LSTM |
0.847 |
2.506 kVAR | 0.958 | 2.694 kW |
-
Predictive Maintenance:
Key finding: 4-hour rolling average of power factor accounts for 91% of feature importance.
|
Metric
|
Score
|
| MAE |
0.069 |
| RMSE | 0.113 |
| R² |
0.908 |
Future Scope:
To further evolve this "AI-Enabled Smart Grid," the following areas are proposed for research and development:
- Hardware-in-the-Loop (HIL) Testing: Transition from MATLAB/Simulink simulations to real-time HIL testing using an FPGA or a dedicated RTOS to validate the microcontroller logic under high-frequency physical transients.
- Edge AI Integration: Deploy the Isolation Forest and XGBoost models directly onto edge computing devices (like an NVIDIA Jetson or an ESP32-S3) to reduce the latency currently introduced by sending data to a Streamlit dashboard.
- Multi-Agent Reinforcement Learning (MARL): Replace the current combination-testing logic for capacitor switching with a Reinforcement Learning agent. This would allow the system to "learn" the optimal switching patterns that minimize breaker wear-and-tear over several years.
- Cybersecurity Layer: Integrate anomaly detection specifically for "False Data Injection" (FDI) attacks, ensuring the smart grid remains resilient against malicious sensor tampering.
References:
Report Information
Report Details
Created: May 17, 2026, 11:37 a.m.
Approved by: None
Approval date: None
Report Details
Created: May 17, 2026, 11:37 a.m.
Approved by: None
Approval date: None