Become a subscriber (Free)

Join 29,000 other subscribers to receive subscriber sale discounts and other free resources.
:
:
Don't worry -- youre-mail address is totally secure. I promise to use it only to send you MicroZine.

ACS712

The ACS712 can measure fairly high current using a built-in hall effect sensor. It can also withstand very high voltages that you find used in mains outlets (actually it can withstand a lot higher voltage ~2kV rms!).

ACS712 5A response

It is a very compact device package in an 8 lead SOIC, unlike the bulky ACS758. It comes in a range of current measuring capabilities ±5A, ±20A, ±30A (choose the correct chip!). So you can measure quite high current using this small device.

Since a magnetic field is used to detect the current (the hall effect part reacts to the magnetic field strength), it means that there is no direct electronic connection from dangerous high voltage to the low voltage microprocessor interface. Thus galvanic isolation is built in, and this device can safely measure current in the presence of high voltages.

The actual sense resistance in the circuit is a tiny 1.2mΩ so it won't affect the "sensed" side of the system very much at all i.e. the sensor voltage drop will be low.

This magnetic interface provides automatic isolation or voltages up to 2100VRMS. However you must take all high voltage safety precautions when using voltages over 30V. If you are not experienced in high voltage safety don't do it.

The lowest specification device can measure ±5A - this is the one usually found on breakout boards.

ACS712 Datasheet

Download the ACS712 Datasheet here.

ACS712 Specification

(ACS712ELCTR-05B-T)

  Parameter
Value
  Voltage Supply (VDD)
4V5 ~ 5V5
  Abs.Max VDD
-0.1V ~ 8V0
  Measurement range
±5A
  Interface
Analogue
  Active current (mA) (typ,max)
10, 13
  Conductor resistance 1.2mΩ
  Zero current output voltage[3]
VCC/2
  Output offset mV [1]
0V
  Sensitivity 185mV/A
  Noise
21mV
  Magnetic offset error [2]
-1mA
  Rise time (step response 10% to 90%)
3.5µs
  Error
±1.5%
  Output load resistance (min)
4k7
  Output load capacitance (max)
10nF
  Overcurrent for 100ms  100A
  Isolation Voltage  (VDC or VPK, VRMS)
2100Vrms
  Package Thermal resistance 23°C/W
  Max junction Temp. 165°C
  Operating temperature
-40°C ~ 85°C
        [1]   Factory trimmed for zero output.
        [2]   Occurs when device is subjected to high or over current.
        [3]  The device is Ratiometric.

Warning: This device does not operate below 4V5!

Other types of device such as the ACS758 or INA219 do operate to 3V0. However, the ACS758 is difficult to use for power levels below 30W (the current barely registers!), it is for very measuring high currents only.

ACS712 Block diagram

acs712 block diagram

How the ACS712 Works

The ACS757 generates a voltage proportional to the magnetic field caused in a conductor using the "hall effect". The output voltage is set to VCC/2 to indicate zero current flow. Changes in the magnetic field cause this value to rise or fall indicating positive or negative current. In this way large d.c. or a.c. currents can be measured.

Ratiometric Operation

The ACS71x devices are ratiometric meaning that as the power supply changes so the ouput changes by the same ratio. This is why the zero current output sits at VCC/2 i.e. the output does not depend on the supply voltage value.

ACS712 Filtered Output

Usually you add a a series capacitor and resistor to ground at the output to give a low pass filtered signal. However this forms a resistive divider with the following circuit that reduces the signal level. The ACS712 provides a filter pin to the internal opamps just after the gain amplifier and just before the output buffer opamp.

This means you can filter the signal without affecting the output level.

You add a capacitor to filter pin 6 according to the following table (see block diagram above):

acs712 filter capacitor vs rise time
This lets you set the bandwidth of the device.

ACS712 Accuracy

The basic accuracy of the device is ±1.5%        

ACS712 Resolution

The sensitivity of the device is 185mV/A, so every Ampere change results in a 185mV output change. The resolution should be determined by how many bits your ADC can measure but also see "Effect of noise on resolution".

If you use the Arduino ADC (10bit) then the resolution of the ADC device assuming a 5V reference is 5/pow(2,10) = 4.88mV. So the basic ampere resolution will be:
   
    185[mV/A] sensitivity gives 1.0/185 Amps/mV

    (1.0/185)*4.88  [A/mV][mV] = 0.0264 A/LSB = 26.4mA/LSB

Note: Using the Arduino ADC results in a resolution of 26.4mA.
Warning: 26.4mA is not the resolution that the ACS712 can support.
This resolution is good and as a percentage of full scale it is:

    (26.4e-3/5)*100 = 0.53%

This looks good but the Arduino ADC has better resolution than the device can output. This is because of "Effect of noise on resolution".

The only reason for using an ADC other than the Arduino ADC is for better gain and offset characteristics.

Effect of Noise on Resolution

Hall elements seem to have quite high noise output due to thermal and shot noise, so the effective resolution is limited by this noise. Dividing the noise by the sensitivity provides the smallest current that can be measured by the ACS712:

    Smallest current resolution = Noise/Sensitivity

    Smallest current resolution = 21/185  [mV]/[mV/A] = 0.113A

Warning: The smallest current this chip can measure is 113mA.
Note: Other ACS712 chips have different noise/sensitivity values.

The INA219 has far better resolution for lower currents (3.2A ~ 15A). However the INA219 can not measure with voltages higher than 26VDC.

ACS712 Maximum power at 240V

The maximum power (±5A chip version) is:

    Ipeak  = +5A
    Irms   = Ipeak/sqrt(2) = 5/sqrt(2) = 3.54Arms
    Power = Vrms * Irms = 240 * 3.54 = 848W ~ 0.8kW

For the ±20A chip version you can measure:

    Ipeak  = +20A
    Irms   = Ipeak/sqrt(2) = 20/sqrt(2) = 14.14Arms
    Power = Vrms * Irms = 240 * 14.14 = 3394W ~ 3.3kW

For the ±30A chip version you can measure:

    Ipeak  = +30A
    Irms   = Ipeak/sqrt(2) = 30/sqrt(2) = 21.21Arms
    Power = Vrms * Irms = 240 * 21.21 = 5090W ~ 5kW

ACS712 and 3V operation

The ACS712 does not operate with 3V so the key to using it in a 3V system is to scale the output voltage using a resistive divider.

Note: You must power the chip from 5V for 3V0 divider operation.

The output defaults to 2.5V for zero current measured and for a ±5A device the sensitivity is 185mV/A so the maximum excursion of the output will be:

    2.5 + 185e-3*5 = 2.5 + 0.925 = 3.425.

Divider Ratio

The ratio to divide down by is to be less than:

    3.0/3.425 = 0.88.  // Maximum divide down ratio 0.88*maxV = 3V0

Using a 2k2 resistor from the output to the middle of the divide and 10k from the middle of the divider and to ground gives a ratio of:

    2k to 10k ratio : 0.82

Max Divided Output Voltage

Tacking the voltage at the middle of the divider, for an input of 3.245V (from the ACS712) the voltage you now get is:

    3.425*0.82 = 2.81V  // Max excursion

This is the maximum voltage at maximum current. Minimum current falls below 2.5V.

Center point voltage

Center point voltage is now 2.5*0.82 = 2.05V

New Sensitivity value

The sensitivity is now 185e-3*0.82 = 151.7mV/A

Results Check

Check results (check max current):

    Delta change / New sensitivity = Amps

    (max_excursion - center_point)/sensitivity

    Max Amp reading = (2.81 - 2.05)/151.7e-3 = 5.01A

Divider Conclusions

So you can use the above divider and still use a 3V0 ADC or connect to a 3V0 circuit without going above 3V (if the load stays within range - the chip should not).

You may need to insert a buffer amplifier to the divider output to drive the next circuit properly. You could also insert a clamp opamp/diode to prevent over voltage - this could happen if the current measured is higher than expected.

TIP: Use a resistive divider at the output to operate with 3V0 devices.

Conclusions

The ACS712 can easily measure current in the presence of very high voltage whilst still providing galvanic isolation - making it safe for use between high and low voltage circuits.

It has quite a good resolution of 113mA and with a bit of fiddling can be made to output a 3V0 compatible voltage. Its isolation voltage is 2100Vrms so it can withstand huge voltages!

You can get this chip in three ranges of current measurement ±5A, ±20A, ±30A (each version has a different resolution capability). For 240V mains you can measure 0.8kW, 3.3kW, 5kW. For 120Vrms systems these are halved to 0.4kW, 1.6kW and 2.5kW.

If you want to measure higher current then use an ACS758 (but it has lower resolution).

If you want more accuracy and need lower current capability (still respectable from 3.2A ~ 15A) the use an INA219. This chip can accurately measure voltage, current and power in the connected circuit up to voltages of 26V.



New! Comments

Have your say about what you just read! Leave me a comment in the box below.




Privacy Policy | Contact | About Me

Site Map | Terms of Use



Visit our Facebook Page:
To Visit Click Here


Recent Articles

  1. How the HMC5883L 3-axis digital magentomter works

    HMC5883L - How make a digital compass, Find out the differences between the HMC5883L and the QMC5883L and whether they are compatible.

    Read more

  2. Arduino absolute value - abs() - secrets revealed...

    Secrets of Arduino absolute value abs() - Why it might fail, Why it may cause problems...and how to fix it.

    Read more

  3. Arduino Analog Output...Easy analog output generation

    Arduino Analog Output: How to create the most accurate PWM analog ouput and how to create analog PWM sine waves.

    Read more

  4. ACS758 secrets...

    Using the ACS758 to measure very high current

    Read more

  5. Arduino Voltage Reference Capabilities

    Arduino Voltage reference: Both the Uno and Nano have a built-in voltage reference: Find out how to make it more accurate. In addition find out how to use it to measure the supply voltage 1V8 ~ 5V5

    Read more

  6. DigitalWrite and equivalent fast macros. Speed up your code!

    Find out how digitalWrite() works...Now use 17x Faster macros!

    Read more

Readers Comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's

SUPERB and FANTASTIC."

- Ranish Pottath

"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan

bursach<at>gmail.com<

"Awesome site,
very, very easy and nice
to navigate!"


- Matt
matt_tr<at>
wolf359.cjb.net


Learn Microcontrollers

"Interested in
Microcontrollers?"

Sign up for The
Free 7 day guide:

FREE GUIDE : CLICK HERE


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."


- Dave

de_scott<at>bellsouth.net

"Your site is a great
and perfect work.
congratulations."


- Suresh

integratredinfosys<at>
yahoo.com

"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.
Regards."


- Anon

Back to Top