Current Sensor ACS712 (5A) - dimaatmelodromru/techdoc GitHub Wiki

5A Analog AC and DC Current Sensor

The ACS712 Current Sensor in an effective and precise solution for industrial, commercial or educational applications. The package is optimized for any customer implementations. Typical applications are overcurrent fault protection, load detection, motor control, etc.

The device is based on a precise IC Hall sensor with a copper conduction path placed in close proximity, so that the magnetic field, generated by a current in the conductor is sensed and converted into a proportional voltage. A low-offset, chopper-stabilized BiCMOS Hall IC is programmed for precision after packaging.

The voltage value on the output pin has a positive slope (>VIOUT(Q)) when an increasing current flows through the copper conduction path (from pins 1 and 2 to pins 3 and 4), which is the path used for current sensing. The internal resistance of this conductive path is 1.2 mΩ typical, providing low power loss. ACS712 survives up to 5× overcurrent conditions. The terminals of the conductive path are electrically isolated from the sensor leads (pins 5 through 8). This allows the ACS712 current sensor to be used in applications requiring electrical isolation without the use of opto-isolators or other costly isolation techniques.

Typical Application

Packaging

A small, surface mount SOIC8 package. The leadframe is plated with 100% matte tin, which is compatible with standard lead (Pb) free printed circuit board assembly processes. Internally, the device is Pb-free, except for flip-chip high-temperature Pb-based solder balls, currently exempt from RoHS. The device comes fully pre-calibrated.

Operating Temperature

-40 to 85 0C

Top Features

Low-noise analog signal path Device bandwidth is set via the new FILTER pin 5µs output rise time in response to step input current 80 kHz bandwidth Total output error 1.5% at TA = 25°C 1.2 mΩ internal conductor resistance 2.1 kVRMS minimum isolation voltage from pins 1-4 to pins 5-8 5.0 V, single-supply operation 66 to 185 mV/A output sensitivity Output voltage proportional to AC or DC currents Factory-trimmed for accuracy Extremely stable output offset voltage Nearly zero magnetic hysteresis Ratiometric output from a supply voltage

Safety Standard Compliance

Parameter Specification
CAN/CSA-C22.2 No. 60950-1-03
Fire and Electric Shock UL 60950-1:2003
EN 60950-1:2001

Example Code

We use the EmonLib library from openenergymonitor.org that allows to convert the raw data from analog input into useful values.

// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance

void setup()
{  
  Serial.begin(9600);
  
  emon1.current(1, 5);             // Current: input pin, calibration.
}

void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
  

  Serial.print("Current : ");
  Serial.print(Irms);              // Irms
    Serial.println(" mA");
}

Result

We test the sensor by giving 12 measurement points from -2A to 2A input range. The voltage reading of each corresponding measurement is seen as:

Input Current, A Output Voltage, V
-2 2.148
-1.5 2.224
-1 2.312
-0.5 2.403
-0.2 2.44
0 2.474
0.2 2.505
0.5 2.546
1 2.645
1.5 2.727
2 2.817
⚠️ **GitHub.com Fallback** ⚠️