Logging mains voltage: Arduino or Raspberry Pi?

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?

Reply to
newshound
Loading thread data ...

A quick google came up with:

Avpx

Reply to
The Nomad

What do you want to do with the data when you've measured it?

Theo

Reply to
Theo

Thanks, that second one looks like a good basis.

Reply to
newshound

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.

Reply to
Martin Brown

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?

Reply to
newshound

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

Reply to
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

Reply to
Brian Gaff

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

Reply to
Theo

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.

Reply to
Andrew Gabriel

Thinking outside the box a bit, many line interactive UPSs come with voltage logging and can be connected via USB.

Reply to
John Rumm

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.

Reply to
Michael Chare

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...

Reply to
tony sayer

Won't the capacitor smooth out any transients you might want to observe?

Reply to
Halmyre

I am looking for transients longer than maybe a second or so. Obviously, might need to experiment with capacitors a bit.

Reply to
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.

Reply to
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).

Reply to
newshound

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!)

Reply to
John Rumm

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.

Reply to
The Natural Philosopher

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.

Reply to
whisky-dave

HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.