Voltage Measurement etc...

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
britesc
 
Posts: 43
Joined: Thu Apr 26, 2012 2:02 pm

Voltage Measurement etc...

Post by britesc »

Hi,

I have been searching for a simple way to capture the AC voltage, amps and hertz output from my 220V-230V generator .
I can purchase a combined digital display panel from China for about $10 or so.
What I want is the information to be able to feed into an MCU like a Raspberry Pi or Arduino.
It seems to me that as the inexpensive display unit from China captures all of this data surely I should be able to remove the display unit and grab the values.

My question is has anyone done such a thing, is it feasible?
I keep looking everywhere for sensors able to give me this information but nothing except inexpensive displays from China.

Any advice gratefully received.
regards,

jB

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Voltage Measurement etc...

Post by adafruit_support_mike »

What you're looking for are called "root-mean-square" measurements. Taking them isn't hard per se, but it highlights the difference between Makers and non-Makers.

EDIT: circuit removed because it was flat-out dangerous

For current, you'd want something like the INA169 current sense amplifier, but the INA169 only measures current flowing one way. For AC, you'd need a bidirectional current sensor like the LT1999 or the MAX9920. They do roughly the same thing as the circuit above, turning current input into something an ADC can digest.

In both cases, you'd sample the input at a high enough rate to get a good view of the waveform.. probably 20-30 times the base frequency, or 600sps to 1000sps.

For each sample, you'd subtract the zero-signal reading (probably whatever the ADC puts out for 2.5v) then square the result. To get the RMS value, you'd add all the squared values together, take the square root, then divide by the number of samples. You can do it for any length of sequence, but it's usually good to take several periods of the input waveform.

Like I said, it isn't all that hard if you're comfortable using ADCs and microcontrollers.

User avatar
Renate
 
Posts: 291
Joined: Tue Nov 13, 2012 3:21 pm

Re: Voltage Measurement etc...

Post by Renate »

Ouch. Britesc is in Spain with 230 VAC power.
That's 230 V RMS
That's 325 V peak = sqrt(2) * 230
That's 650 V peak-peak = 2 * sqrt(2) * 230
Switch off the garbage disposal on that circuit and you probably have 1000V peaks.

The first issue is safety.
That's why we try to avoid ever handling mains power.
We use wall warts so manufacturers who have (hopefully) done high potential testing on their units can guarantee isolation.

If you are using a generator, there's a chance that the neutral is floating.
Hot and neutral might even be reversed.
With an non-polarized plug to the generator, you'll have to deal with that.
You'd have to measure both the hot and the neutral to know what the line voltage is.

Particularly for power inverters, the signal waveform and DC offset could be anything.

This circuit with the 1 M resistor is dangerous.
Are you sure that it's never going to arc across the PCB or across the resistor leads?
Are you sure that it's never going to arc internally in the resistor?
Are you sure that a surge is not going to damage the resistor and drop its resistance to 1K?

Have you thought about how the ground connection on this circuit will work out?

Also, you still have to measure the current.
Calculate the voltage/current phase difference and the power factor.

Me? I'd use a stepdown transformer to measure the voltage.
Even then, I would throw in some clamping diodes in the circuit.
I'd use a current transformer to measure the current.

I'd be interested to see what this Chinese meter has for circuit protection.

Here's a fun video on destroying voltmeters using voltage spikes:
https://www.youtube.com/watch?v=M-FZP1U2dkM

User avatar
britesc
 
Posts: 43
Joined: Thu Apr 26, 2012 2:02 pm

Re: Voltage Measurement etc...

Post by britesc »

Thank you both for your support.
Seems the challenge I face has not got any easier.
I would have thought that there would be quite a call for this type of sensor with more an more home automation being undertaken.
It also puzzles me how eBay is awash with the inexpensive display unit versions but zero for just a pinout version.

Maybe LadyAda could get her brains around this one????

Kind regards and many thanks,

jB

User avatar
Renate
 
Posts: 291
Joined: Tue Nov 13, 2012 3:21 pm

Re: Voltage Measurement etc...

Post by Renate »

Adafruit does have a product for this application, but it's for 120 VAC.
https://www.adafruit.com/product/143

The important thing is that the interface to the external world is wireless.
With a closed unit there is only so much damage a screw-up can cause.

If you were intending to have the data from your Arduino connect to your desktop there would be the problem of isolation.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Voltage Measurement etc...

Post by adafruit_support_mike »

Renate is right: galvanic connections to anything higer than about 30v are inherently dangerous and should only be done by professionals with the appropriate training. Bad mistake on my part, good catch on his.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”