Monitoring the load on the National Grid with a PicAxe

tmfkam

Senior Member
I was inspired by an article in the January 2012 issue of Elektor which described how it was possible to measure the load on the Electricity National Grid by reading the Frequency of the Mains supply. The greater the load on the Grid, the slower the generators run and so the frequency slows down. The lighter the load, the faster the generators run and so the frequency increases. The Grid is constantly compensating for the fluctuations in load and attempt to balance the load with the supply by bringing more or less generation capacity on line. The frequency of the Grid should not normally drift by more or less than 0.4% or 0.2Hz.

The meter I have designed measures the frequency and voltage of the supply using a single 14M2 processor by sampling the output of a LOW VOLTAGE (9V AC) transformer and displays it on an LCD, it automatically detects frequencies of 50Hz or 60Hz, has options for displaying the voltage as 240V (UK) 220V (EU) or 120V (US) and will capture events where the nominal supply level has fallen above or below 10% of that nominal level. A facility is provided for battery backed power to maintain operation in short power cuts so that these 'events' are maintained in memory. To compensate for the variations of the oscillators within different PicAxe processors, it is possible to add /subtract compensation by placing a link at power up, this compensation value is stored in Eeprom so needs performing once only. The Voltage and frequency are displayed numerically on the top line of a standard 16x2 LCD display, with the bottom line of the display showing a bargraph representation of the frequency, centred at 50Hz (or 60Hz) with more bars being displayed left of centre as the frequency falls away from the nominal frequency and more bars to the right as frequency increases above the nominal frequency. The resolution of each bargraph element is just 0.025Hz, or 25 milli Hertz (at 50Hz). The frequency is sampled three times for the positive portion of the AC signal, and again for the negative portion of the AC signal with an average being taken of these samples to reduce the possibility of them being corrupted.

The Basic code very nearly fills the 14M2, much of it being taken up with the calculations required to convert the PulsIn values used for the frequency measurement into an accurate value of the frequency. The PDF document goes into the detail of how these calculations were settled on, and the accuracy they offer while staying within the limitations of the integer maths of the PicAxe.

Basic code:
View attachment GridFreq_Monitor_16x2_3_01_1.bas

Circuit diagram:
GFM.png
 
Last edited:

tmfkam

Senior Member
Pictures of the unit in operation.

Boxed version, showing a frequency of slightly below 50Hz.

Boxed.jpg

Unboxed version, showing a frequency of slightly above 50Hz. This (almost) shows the PCB design using the Eagle files in the above post.

Unboxed.jpg
 

tonyv

New Member
Hi,
I have downloaded the update and will reprog the 14m2
I have attached a pic of the gfm (will paint and text the box)
Above is my led monitor, rotate cw low freq rotate ccw high freq
Regards
Tony
ZR6ALGgrid mon pic.jpg
 

Janne

Senior Member
Wonder if the UK grid aims to keep the time deviation of the grid (ec. a clock running off the mains frequency) close to real time in the long run as here on the nordic coutries? If so, it might be interesting to try and calibrate the picaxe's internal oscillator based on the long - long time average of the mains frequency, based on the assumption that over long periods of time it would average to 50Hz..
 

hippy

Technical Support
Staff member
Wonder if the UK grid aims to keep the time deviation of the grid (ec. a clock running off the mains frequency) close to real time in the long run as here on the nordic coutries?
It does, though it's not clear what period would have a guaranteed zero-deviation.

There is a conspiracy theory that the grid runs slow during normal working hours and fast outside so most of us actually work more hours than we get paid for :)

If so, it might be interesting to try and calibrate the picaxe's internal oscillator based on the long - long time average of the mains frequency, based on the assumption that over long periods of time it would average to 50Hz
That would seem possible. The main difficulty would be in dealing with some quite large numbers, but not insurmountable. One could simply output those big numbers via serial and let a PC process them to see if it is worth processing them in the PICAXE.
 
Top