Measuring High AC Voltage using ACS712

hi all ..

I know how to measure AC current using ACS712 Using arduino ..

but my problem know is can I use ACS712 to measure AC voltage between 220v and 660v ..

I have found this topic about measuring high ac voltages using arduino ...

http://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter

but if I can measure high AC voltages using ACS712 it will be much easier to me ...

if it can accomplish using the IC ... can you please tell me what the formula to use in arduino code for that ..

or provide me with a sample arduino code for that ..

Thanks alot

the Under Taker :smiling_imp:

I don't know about the sensor but I remind you that the voltage you are playing with is lethal. Please make sure you take all safety precautions.

Weedpharma

hi weedpharma ...

thanks for your attention ..

I am working just fine with high voltages no problem and I am taking all safety parameters in consideration.

thanks again :slight_smile:

On looking at the device, I see that it is only a current sensor.

There is a link between the in and out that generates a field dependant on the current and this is sensed.

The current path is isolated so there is no common gnd. There is also the matter of isolating the HIGH voltage.

There is no facility to measure voltage.

My previous reference to danger is because there is no indication of experience. Many newbies have no knowledge of electronics and I did not want to see someone leave the forum too soon!

Weedpharma

dear Weedpharma ,,,

that is okay ,, I will figure some way out to measure high AC voltage ..

I am not professional in this filed this is my experience indication :slight_smile:

but your warning is important even for professionals ..

thanks again for your attention and fast replay ..

I'm guessing being the 'under taker' will mean something, but what, I am not sure.
Especially when I read:

I am working just fine with high voltages no problem and I am taking all safety parameters in consideration.

Even a novice can say that and then realise an instant too late that they did indeed forget to not touch that wire.

Weedpharma is correct, the ACS712 is only for measuring current, and has no ability to measure volts.
Also, if you are measuring AC current, do you have a means to counter the opposing half of the sine wave, as in, do you have a recitifier and some circuitry to give you RMS or peak current?


Paul

hi rockwallaby …

that’s to much terms behind my limited knowledge but I will tell you my plan to measure Current :

I have ordered this module and I expected it to arrive today …

I have studied to many articles about that topic the major two are those

after searching a little bit and watching some videos I found it almost easy and no problem to get AC

current measured using this module

if you think there is some thing I miss please tell me about it …

thanks for your time

const int currentPin = 3;
const unsigned long sampleTime = 100000UL;                           // sample over 100ms, it is an exact number of cycles for both 50Hz and 60Hz mains
const unsigned long numSamples = 250UL;                               // choose the number of samples to divide sampleTime exactly, but low enough for the ADC to keep up
const unsigned long sampleInterval = sampleTime/numSamples;  // the sampling interval, must be longer than then ADC conversion time
const int adc_zero = 510;                                                     // relative digital zero of the arudino input from ACS712 (could make this a variable and auto-adjust it)

void setup()
{
 Serial.begin(9600);
}

void loop()
{
 unsigned long currentAcc = 0;
 unsigned int count = 0;
 unsigned long prevMicros = micros() - sampleInterval ;
 while (count < numSamples)
 {
   if (micros() - prevMicros >= sampleInterval)
   {
     int adc_raw = analogRead(currentPin) - adc_zero;
     currentAcc += (unsigned long)(adc_raw * adc_raw);
     ++count;
     prevMicros += sampleInterval;
   }
 }
 
 float rms = sqrt((float)currentAcc/(float)numSamples) * (75.7576 / 1024.0);
 Serial.println(rms);
}

The ACS712 board you ordered is a good circuit as it has a gain and offset adjustment, so you can use it for very small measurements.

As user dc42 points out in that post you linked to, you need to find the RMS of the signal as it is AC, always varying.

That thread then goes on to describe how this might be done in code, which I will be interested myself to see how good it is for my own projects.

But, typically, this is done by using a precision rectifier and then an op-amp to further calculate the RMS, which then can be read directly by an ADC.

Code is easy, let us know how it goes, you'll need a calibrated AC current meter to compare against.
My only concern is with safety, in that, you are going to wire up a 220VAC RMS line to this little board.
You talk also of 660 VAC, is this peak or RMS that you mean?

Either way, you need to be extremely careful how you go about this in terms of saftey with such high AC voltages.

I personally would use a CT for such a task. A CT is fully isolated from the signal you are measuring and therefore much safer. CT = Current Transformer.


Paul

dear rockwallaby ...

you are 100% right .. my only problem is that current I will be measure between 0 ma and 100 ma ...

is high voltage but very low current ...

all CT I have found measure range of amps my project is quit precisely that working with ma not exceed 100 ma ...

I think you now get closer to what is my problem is am I right ??

I am using very small inverter 100w to get 220 v AC then using trible output transformer to get about 660 v

all this to make small measurements for very small currents but requiring high voltage to get current measured

I have also think to measure the current before the inverter I mean on 12v DC line ...

what do you think about that ??

A lot of reference to 600vac but nothing to say what you are using it for.

We all like to know what everyone else is doing!

It may also let us come up with ideas that may help.

Weedpharma

hi Weedpharma ,,,

I measured hardness for a very big stones that need very high voltage to measure it's toughness

...

it is not a secret project :grinning:

The_Under_Taker:
...

it is not a secret project :grinning:

Curiosity is satisfied. Thanks.

With the amount of information supplied by some newbies, you would think that they are working on a top secret project! :slight_smile:

Weedpharma

hhhhhhhhh yes almost every new one in this field keep his military secrets away from us :smiley:

I want to measure 220v ac using arduino

The_Under_Taker:
I am using very small inverter 100w to get 220 v AC then using trible output transformer to get about 660 v

all this to make small measurements for very small currents but requiring high voltage to get current measured

The ACS712 will not measure small currents. Its good for several amps where accuracy and noise is non-
critical. Its not accurate enough for any measurement application, its for motor controllers and over-current
sensing.

Sounds like xyproblem again. Please explain in detail what you are trying to do...

Accurate measuring of small currents would normally be done low-side with a shunt resistor and opamp,
and there are specialized chips to make this easier.

The_Under_Taker:
I am using very small inverter 100w to get 220 v AC then using trible output transformer to get about 660 v

all this to make small measurements for very small currents but requiring high voltage to get current measured

A very small inverter produces square waves, not sine waves, so any RMS voltage you read with a DVM will be wrong.

Paul