For reasons I won't bore you with, I'm interested in building a cheap, simple data logger to monitor mains voltage, ideally two channels (live to earth and neutral to earth). In the dim and distant past I have designed and built such things more or less from scratch, but surely someone has already done this.
I havn't used either Arduino or Pi before, but I assume one or other would be the obvious starting point.
However ATM google isn't giving me a strong lead. Thoughts?
Didn't find your answer? Ask the community — no account required.
T
The Nomad
A quick google came up with:
Avpx
T
Theo
What do you want to do with the data when you've measured it?
Theo
N
newshound
Thanks, that second one looks like a good basis.
M
Martin Brown
Unless you are wedded to doing it with an RPi it might be easier to use something that comes with ADCs as standard. ARM evaluation board maybe.
Learning curve for getting anything to work is a bit steeper. eg.
formatting link
I have one of the STM ones which ISTR are about £20.
N
newshound
I'm trying to see if there are overvoltage transients on a farm site, and/or what the neutral is doing. Slow, rather than fast transients. I recognise that the arduino analogue inputs are multiplexed.
So, I want to collect data for a week or so, then pop it into Excel to see if anything is going on.
Would you go for Arduino rather than adding an ADC to a Pi?
B
Brian Gaff
I was just wondering in what way you want to log it, RMS peak or cycle differences, leakage or impedance of earth/Neutral etc. Brian
B
Brian Gaff
I was just thinking, if I were trying to do this, I'd be needing to measure live to neutral on a small load, and the resistance of the earth to neutral or maybe anything that is being generated between them. anything else will be seen by the other measurement. However its important to run a load realistically during the times of monitoring and also switching any loads that could be connected to see how it responds. I've measured lots of spikes on mains when very little is actually running, but when things are running particularly resistive loads like heaters or cookers, the spikes are fewer, making me think much of it is just generated by some other reactive loads switching. Not able to do this now of course, but look on a scope at unfiltered and unloaded mains and its a wonder that it works!
Brian
T
Theo
OK, so how do you intend to get the data from the widget into Excel? Plug into a USB port? Write to an SD card? Wifi? Email? Internet?
How reliable does it need to be? Can you cope if it reboots occasionally?
How slow is a slow transient?
It depends what you want to do.
Theo
A
Andrew Gabriel
Funny, I've just built some hardware to do this on a Pi for a presentation and demo I'm doing later this month. However, the object was to demonstrate using an ADC on a Pi rather than specifically to measure the mains voltage, although I thought it might be fun to record mains voltage.
As has been said, the Pi doesn't have native ADC built-in, so you would need to add on ADC's. However, another significant factors would be which of these platforms you have familiarity with, and if having a linux OS there would be useful for the project, or not.
J
John Rumm
Thinking outside the box a bit, many line interactive UPSs come with voltage logging and can be connected via USB.
M
Michael Chare
I have an openenergy Arduino. It sends data to a Raspberry Pi running Openenergy software. For a while I was using a public Openenergy server. Readings are recorded every second. I record live to neutral voltage. To record other voltages I would need an irregular 13 amp socket.
If I am away from home in the winter I can see whether my boiler has been running.
T
tony sayer
More or less any old APC UPS wll tell you what the voltage is over time least the few i have do that show you over and under volts...
H
Halmyre
Won't the capacitor smooth out any transients you might want to observe?
N
newshound
I am looking for transients longer than maybe a second or so. Obviously, might need to experiment with capacitors a bit.
N
newshound
Others have made that point. I don't have one and don't really think I need one. I think I should be able to "DIY" a solution which would also serve as an introduction to this new kit: I've been thinking for a while that it would be nice to have a portable data logger that I could use to monitor the heating system, etc.
I have an old PicoLog system somewhere that came in handy when diagnosing a combi boiler problem, but of course that had to be hooked up to a rumning netbook so it was all a bit cumbersome.
N
newshound
I've not touched either platform before, one of my reasons I'm interested in the views of those who have.
I converted an old desktop into a Ubuntu box so that I could have a play, and I've also got a Mint stick that I have used occasionally. I'm not particularly bothered about getting into Linux, but I'd do it if I had a project that needed it. I havn't done any serious coding for more than 30 years, but I imagine I could pick it up without too much difficulty (especially now that it's easy to find examples on the net).
J
John Rumm
Fair enough - just thought I would mention it in case you had one knocking about and had not thought about it.
A roll your own solution will obviously be more versatile (and probably fun!)
T
The Natural Philosopher
Hmm. My instinct would be to sample MUCH more frequently than that and sample AC as well so that you get a really good set of smaples, and then do any filtering in 'software'
I dunno how long an arduino trakes to do a sample but it cant be that long
Oh. It seems you can sample at up to 9.6Khz...that should do nicley - and take an RMS value of the waverorm and moving average it out over the last say one second...and use that to store.
Or uses a shirfter period for more sensitivity to transients
Basically you need a small mains transformer to step down to about 5VAC or so, then a voltage diveider to set the mean voltage in the middle of the arduino range, and a pot to scale the output to - say 0-5V representing up to say 500V peak...
If say you are taking 5khz samples you will need a nmemoiryy buffer of
5000 16 bits (10k of RAM) to store the samples and a further location to do the running average in.
Well within an arduino I'd say.
W
whisky-dave
The problem I'd see with an Arduino would be Time in that it;s not very good as a clock but this would only be important if you wanted to know what time an event happend rather than it just happening and being recorded.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.