The grid frequency is monitored using a Raspberry Pi Pico, a microcontroller programmable in Python (MicroPython) or C++. A GPIO pin, connected via a current transformer and voltage divider, measures the alternating voltage of the electrical grid (nominally 50 Hz in Europe).
The Pico calculates frequency by measuring the period of the sinusoidal voltage, averaging readings over 5-second intervals. Results are sent to an InfluxDB database, where each value is timestamped and stored for analysis.
Data is visualized in Grafana, providing real-time graphs of grid stability. Small fluctuations—typically a few hundredths of a hertz—reflect supply-demand balance: frequency drops when demand exceeds supply and rises when there is a surplus.
On a larger scale, grid operators adjust or shut down production units to maintain stability. Frequency serves as a direct indicator of grid health, and significant deviations (e.g., below 49 Hz or above 51 Hz) can trigger automatic safeguards to prevent widespread outages.