Logging frequency and voltage of AC line? - Page 1
Forum section: electronics / beginners

author: AMyatt
author_rank: Contributor
timestamp: March 27, 2014, 03:19:11 am
content: Hello,I need to log the frequency and voltage of a 240v AC line every second for a 24 hour period.I have an SMA SBU5000 battery backup system connected to the house and it keeps reporting that the supply voltage exceeds its pre-defined limits. Because it only logs the voltage every minute I can't see when or by how much the voltage is actually being exceeded.Is there some cheap way (under $100) I can log the frequency and voltage (or at least voltage) of a 240v AC line every second?Thanks in advance.

author: paulhm81
author_rank: Regular Contributor
timestamp: March 27, 2014, 06:09:56 am
content: For the voltage part there are cheap multimeters with serial connection to a computer. The software can record over a long period of time. I don't know about the frequency . I think any multimeter with a pc connection can do the voltage log.

author: ve7xen
author_rank: Super Contributor
timestamp: March 27, 2014, 07:41:46 am
content: For voltage, as mentioned, there are some cheap multimeters that can do that. It would be interesting to know if your battery system is reporting on peak cycle voltage or RMS voltage or something else. Depending on which you're looking for, you'll want a different type of measurement. Something like the UT61E can record (True)RMS or instantaneous peak voltage at 1-2Hz with the included software (or some third party ones).Line frequency is more difficult, as accurately measuring low frequencies generally requires a reciprocal counter, and this is not how most multimeters measure frequency. You'd generally need a dedicated counter, which will break your budget. If you have some experience with microcontrollers, this is pretty easy to implement yourself, but I don't know of anything off the shelf. Maybe there is a DIY project or someone's hobby to sell something like that.A few years ago someone on  asked a similar question and I spent some time hacking around at a solution. I don't frequent that place anymore, but my post is still hanging around if you're curious:http://hardforum.com/showthread.php?t=1505775This code doesn't measure voltage, but I might still have it hanging around (in very rough state) somewhere.

author: Smokey
author_rank: Super Contributor
timestamp: March 27, 2014, 08:32:33 pm
content: I've been playing around with a similar situation due to some power fluctuations I've been seeing. I needed a lower voltage and something isolated to send into my data logger, so I ended up using the transformer out of an AC wall wart. 120VAC to isolated 9VAC (Yes I made sure it's actually isolated).I was amazed at how terrible the sine wave looked on the scope. It's not due to the transformer, it's what's actually on the line. The peaks (+ and -) were really ringy and the waveform was generally distorted. I guess a whole house worth of stuff plugged into that circuit and charging caps at the peaks of the waveform leaves it a little less than a perfect sine wave. I'm not sure how a non-true-RMS meter would interpret the value of the voltage.I'm not sure how long your unusual power events last, but 1 second might not be enough to really see what's going on. You probably won't record any short excursions.

author: linux-works
author_rank: Super Contributor
timestamp: March 27, 2014, 09:24:35 pm
content: how accurate do you need the line freq measurement to be?what I'm thinking is that an arduino can count freq easily enough and it could report the data over a ttl serial line.every second is do-able but if you let the counter run longer, it can pick up more samples, divide by time and get a much more accurate reading. you'd have to give up the 1sec intervals, though. why do you need such frequent updates, btw?

author: Smokey
author_rank: Super Contributor
timestamp: March 27, 2014, 10:43:30 pm
content: (Just a hypothetical, not saying this happens but...)If you expect 220V and you get just one cycle of 350V, that's never going to get recorded with 1 second interval logging but I'm pretty sure you would want to know that it happened if you were concerned with the voltage.

author: AMyatt
author_rank: Contributor
timestamp: April 02, 2014, 05:00:24 am
content: Smokey,I do see your point. This spike in voltage appears to occur every half an hour. My plan is to log as frequently as possible (with reasonably priced hardware) and hopefully catch something abnormal.The aim of this is to hopefully prove whether or not it is in fact a voltage spike or a false error on the backup system due to poorly designed software or hardware.-----My plan is to purchase a UT61E multimeter and do some logging.Thanks everyone for your help.

author: G7PSK
author_rank: Super Contributor
timestamp: April 02, 2014, 07:25:48 am
content: I would look around for any thermostats in the house first, it's most likely due to some heavy load shedding as a thermostat cuts out, turn of any thing with a thermostat and then see if your battery box reports any over volts.

author: Rerouter
author_rank: Super Contributor
timestamp: April 02, 2014, 07:50:29 am
content: Counting the uS or CPU ticks between rising edges on the sine is a nice and accurate way to measure the frequency, e.g. the atmega 328 has a 4uS tolerance with the arduino micros code, you have 60 samples per second which you can average to easily get ppm deviations,for this i would recommend an opto-coupler to isolate it (series resistor), with the transistor output pulling low the micros input with say a 10K pullup to supply rail, while it may have its turn on point shift long term, and will have its reading influenced by supply spikes, its simple,Also if you use a bidirectional one you get 120 readings per second,For voltage, well my only thought would be a peak detect circuit and a sample and hold circuit (2-4 op amps) with the inputs divided down to a sane level and possibly a diode strapping it ignoring the negative half , so you can log the max and do RMS calcs as long as you want

author: AMyatt
author_rank: Contributor
timestamp: April 02, 2014, 08:02:40 am
content: G7PSK,At the time when it is reporting over voltage, there is zero load.Basically, the "battery box" has the ability to isolate the house from the public grid either during power failures or on-demand.Whilst isolated, it regularly checks the voltage and frequency of the public grid to make sure it is within specification before reconnecting. If either is too high or too low it will lock down for 30 minutes and re-check. We have a pretty steady supply here (and the limits of this thing are set rather high; 210 - 280 I think).I am certain it is a software bug as it only happens when off grid, however the company insists it must be over voltage.

author: Wytnucls
author_rank: Super Contributor
timestamp: April 02, 2014, 08:20:02 am
content: It could be done with 2 meters, recording at the same time. It would cost a bit more than 100 USD though. A couple of Uni-T 71 meters can do it, as you can see on the screen capture. Logging for 24 hours would need fresh batteries.