Posts: 1
Joined: Mon Apr 15, 2019 5:40 am

Voltage Datalogger (please help out a noob)

Mon Apr 15, 2019 5:55 am

Hi everybody! Just joined, pretty clueless, electrically illiterate, but working on a volunteer project in a developing country that would greatly benefit from your wisdom and a good solution.

Here's the goal: We need to create a small system for measuring and recording power supply, which frequently fluctuates/surges due to lightning strikes, poor infrastructure, demand on the wider electrical system, etc. I was wondering if this would be possible with a raspberry pi-based system. What I was envisioning is to have a voltmeter plugged into the wall running to a raspberry pi (could be battery powered so it can survive potential surges) that either a) collects voltage readings at a set interval of 10s for example or b) only records readings when power supply deviates from a specified range. These readings are logged (format isn't important, it could just write a long string of comma-separated values or something) and, in a perfect world, emailed to a central account at specified times.

My questions for you: Is this remotely possible? How much equipment is needed? Rough cost?

If you can't tell already, I have no idea what I'm talking about, so any help you have to offer would be greatly appreciated!

Posts: 2051
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Voltage Datalogger (please help out a noob)

Mon Apr 15, 2019 6:41 pm

The only time I have ever done this was with a Fluke meter and we hired it as they where £800 to buy!

Playing with mains is not good unless you know what you are doing - most of the cheap units you see on eBay require you to split the feed wires and pass the live through a clamp that induces a magnetic field that then gets converted to give current rather than voltage.

I have seen this https://shop.openenergymonitor.com/emon ... ansmitter/ but not tried it - it reads similar to your needs and they may be a starting point for you.
Need Pi spray - these things are breeding in my house...

Posts: 5485
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Voltage Datalogger (please help out a noob)

Tue Apr 16, 2019 10:09 am


Seeing as one of you first statements is " pretty clueless, electrically illiterate " I would suggest this is not a project you should be attempting.

Working with mains AC voltage is Dangerous, given the chance it will kill you or someone else and burn down your house.

Designing/building any device that's going to be connected to the mains requires someone not only qualified to work on mains electrical systems but also qualified to design such devices, its not just the problem of getting it to work but also making it safe to operate and safe should some thing go wrong and it fail.

I don't know about the laws in which ever country you intend to use it , but in the UK failure of such a device that resulted in death or property destruction would certainly see you prosecuted with probable jail time.
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

Posts: 2051
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Voltage Datalogger (please help out a noob)

Tue Apr 16, 2019 3:41 pm

Good point - maybe the folk at Open Energy Monitor would help?

Other way is to buy / hire a Fluke voltage monitor. The software we had though was for PC only and though the price has dropped it still reads PC only.

The next bit comes in that even with all this data can you solve the issue - That will involve technical expertise and external contractors so you may be better off just contacting them directly?
Need Pi spray - these things are breeding in my house...

Posts: 1613
Joined: Sun Feb 17, 2013 6:51 pm

Re: Voltage Datalogger (please help out a noob)

Fri Apr 19, 2019 7:55 am

One idea to remove the problem of hazardous working is to use a plug in AC-AC power adapter that gives out a low voltage like 5V.

It is important that it is AC output as that will be just an isolation transformer and not a regulated dc supply. It is also important to get one with a safety certification like CE so you know the transformer is of decent quality.

The AC output will be proportional to the mains voltage so can be used to monitor that by scaling up the results.

If it is just the level you are interested in then you would need to rectify the low voltage, smooth it with a reservoir capacitor, step down the voltage with a resistive divider into an ADC to feed into the Raspberry. ADCs can be got in the form of hats to just plug on top.

A more advanced form would be to sample the stepped down AC waveform directly with the ADC. The sampling rate needs to be a decent spped to get a good picture of the waveform, e.g. 800Hz. This method would allow very short term brownouts like a missing cycle to be monitored but it needs more sophisticated software.

Return to “Automation, sensing and robotics”