This may not sound like a particularly impressive project compared to some here, though once you understand some of the details of it, it's really quite interesting.
Ever wished you could detect blackouts and brownouts before they actually happen? Well, you can, and all from any standard mains outlet in your house!
So what does it actually do, and why is it useful?
Well, to understand that, you need to think a bit into the infrastructure of your typical power grid. This device is able to monitor frequency down to surprisingly low fluctuations, which you can then log to a computer, or just display on a simple volt/current meter.
At the heart of all power grids are generators, which must spin at a certain speed in order to keep the line frequency constant. The speed of the generators is HIGHLY regulated, in fact, in many countries, even fluctuations as small as +- 0.2Hz are illegal.
Because many mains powered devices rely on the mains frequency being a constant 50 or 60Hz depending on where you live, many things are affected by these frequency changes. For example, AC induction motors will speed up/slow down, AC based clocks may lose or gain time, and well, most electronic devices are designed to only work within a specific frequency range.
With a basic understanding of electronics, you will know that the speed a generator runs at is dependent on the load it's driving. High loads will induce eddy currents in the generator, and cause it to slow down, while light loads will allow it to speed up.
This, in turn, affects the frequency of your mains power.
So how can it detect black/brown outs?
A brownout is usually caused by a load being too high for a given circuit, or short circuits in neighbouring sub-circuits, while blackouts are usually caused by shorts on your own sub-circuit, or in some extreme cases, the entire distribution grid. In many cases, the transformer and protection circuitry for your suburb will detect a brownout condition, and kill the power entirely until it is restored to normal voltage to protect equipment.
When large loads connect and disconnect from the main grid, they will cause the generators to speed up or slow down, varying the frequency of the entire grid. By monitoring the frequency, you can detect entire suburbs blacking out, possible brownouts and thus possible blackouts as well.
The measuring circuit consists of a simple bandpass filter and the library here: Lab3 - Laboratory for Experimental Computer Science
It uses timers 0 and 1 on the Arduino as comparators. It generates a very accurate pulse, which your measured frequency is then compared to. Because of this, all the measurement is done in hardware, and anything you do in your main code loop won't effect the accuracy of the reading.
I have started work on a basic computer GUI for it, that graphs the readings over about 28 seconds, as well as an analog reader that averages out the values for smoother movements.
The screenshot was taken as the meter needle was updating, so you can only see part of it there.
The graph at the bottom extends from 49.9 to 50.1Hz, so as you can see, the movements are really tiny, but can still mean a lot.
For example, you will notice that the frequency reading will typically be below 50hz around 6pm - When everyone is getting home, cooking, turning on their heaters etc, whereas around midday it'll stay above 50Hz most of the time.
In the case of the Australian main power grid, the entire east coast is interconnected, so theoretically you could detect blackouts in suburbs over 3000km away, however it depends largely on local and far generation as to how obvious it is.
I had a friend in Sydney (Roughly 600km away, and a major city) do a comparison on a 6 digit frequency counter, and our results were almost identical:
Note that his frequency counter only sampled twice per second, where mine sampled every 50ms or so, so there is a fair bit of fluctuation in my readings, but the general trend matches.
We coordinated the event over IRC, so you can see that my reading was a few seconds before his.
Just because it looks cool, I decided to attach an analog current meter to my Arduino and let it act as a meter as well. It is connected to pin 3 (Only pins 3 and 11 will work for PWM with this setup, as the others are being used for timing), and has a lowpass filter consisting of a 82K resistor and 10uF capacitor.
It tracks the meter needle on my screen quite nicely, too!
Anyway, just thought I'd share this interesting little project I've been working on
Dan
Ever wished you could detect blackouts and brownouts before they actually happen? Well, you can, and all from any standard mains outlet in your house!
So what does it actually do, and why is it useful?
Well, to understand that, you need to think a bit into the infrastructure of your typical power grid. This device is able to monitor frequency down to surprisingly low fluctuations, which you can then log to a computer, or just display on a simple volt/current meter.
At the heart of all power grids are generators, which must spin at a certain speed in order to keep the line frequency constant. The speed of the generators is HIGHLY regulated, in fact, in many countries, even fluctuations as small as +- 0.2Hz are illegal.
Because many mains powered devices rely on the mains frequency being a constant 50 or 60Hz depending on where you live, many things are affected by these frequency changes. For example, AC induction motors will speed up/slow down, AC based clocks may lose or gain time, and well, most electronic devices are designed to only work within a specific frequency range.
With a basic understanding of electronics, you will know that the speed a generator runs at is dependent on the load it's driving. High loads will induce eddy currents in the generator, and cause it to slow down, while light loads will allow it to speed up.
This, in turn, affects the frequency of your mains power.
So how can it detect black/brown outs?
A brownout is usually caused by a load being too high for a given circuit, or short circuits in neighbouring sub-circuits, while blackouts are usually caused by shorts on your own sub-circuit, or in some extreme cases, the entire distribution grid. In many cases, the transformer and protection circuitry for your suburb will detect a brownout condition, and kill the power entirely until it is restored to normal voltage to protect equipment.
When large loads connect and disconnect from the main grid, they will cause the generators to speed up or slow down, varying the frequency of the entire grid. By monitoring the frequency, you can detect entire suburbs blacking out, possible brownouts and thus possible blackouts as well.
The measuring circuit consists of a simple bandpass filter and the library here: Lab3 - Laboratory for Experimental Computer Science
It uses timers 0 and 1 on the Arduino as comparators. It generates a very accurate pulse, which your measured frequency is then compared to. Because of this, all the measurement is done in hardware, and anything you do in your main code loop won't effect the accuracy of the reading.
I have started work on a basic computer GUI for it, that graphs the readings over about 28 seconds, as well as an analog reader that averages out the values for smoother movements.
The screenshot was taken as the meter needle was updating, so you can only see part of it there.
The graph at the bottom extends from 49.9 to 50.1Hz, so as you can see, the movements are really tiny, but can still mean a lot.
For example, you will notice that the frequency reading will typically be below 50hz around 6pm - When everyone is getting home, cooking, turning on their heaters etc, whereas around midday it'll stay above 50Hz most of the time.
In the case of the Australian main power grid, the entire east coast is interconnected, so theoretically you could detect blackouts in suburbs over 3000km away, however it depends largely on local and far generation as to how obvious it is.
I had a friend in Sydney (Roughly 600km away, and a major city) do a comparison on a 6 digit frequency counter, and our results were almost identical:
Note that his frequency counter only sampled twice per second, where mine sampled every 50ms or so, so there is a fair bit of fluctuation in my readings, but the general trend matches.
We coordinated the event over IRC, so you can see that my reading was a few seconds before his.
Just because it looks cool, I decided to attach an analog current meter to my Arduino and let it act as a meter as well. It is connected to pin 3 (Only pins 3 and 11 will work for PWM with this setup, as the others are being used for timing), and has a lowpass filter consisting of a 82K resistor and 10uF capacitor.
It tracks the meter needle on my screen quite nicely, too!
Anyway, just thought I'd share this interesting little project I've been working on
Dan
Last edited: