Skip to content

How to measure Current using ACS712 Current Sensor and Arduino

Introduction

Acs712 current sensor interfacing with Arduino for AC and DC Current Measurement. In this tutorial, you will learn how to interface ACS712 hall effect current sensor with Arduino? And How to measure DC Current using asc712 hall effect sensor and how to measure AC Current using acs712 hall effect sensor. It is necessary for the high current applications to monitor the current in the circuit. Now we discuss what is ACS712 and its applications.

Front View of ACS712

What is the ACS712 AC/DC Current Sensor?

ACS712 Current Sensor is a fully integrated, Hall-effect-based linear sensor IC. This IC has a 2.1kV RMS voltage isolation along with a low resistance current conductor.

Front and Back view of ACS712

It can measure both direct current and alternating current. It is a linear type sensor. It has features of noise cancellation, very high response time.it’s simply a current sensor that uses its conductor to calculate and measure the amount of current applied.

It can be used in applications requiring electrical isolation as the terminals of the conduction path are electrically isolated from the IC leads. Thus, this IC doesn’t require any other isolation techniques. This IC requires a supply voltage of 5V. Its output voltage is proportional to AC or DC current.

Check out our website www.probots.co.in to find all the parts for your projects! We have 2000+ Electronic Modules, Sensors, and Components for all your electronics projects.

You can purchase this s ACS712 here – Buy Now

Board Overview and Pinout

Pinout of AC712
Sl no.PinDescription
1VccInput voltage is +5V for typical applications
2OutputOutputs Analog voltage proportional to current
3GndConnected to the ground of the circuit
4Screw TerminalThe wire through current has to be measured is connected here
Pinout Description

Feature of ASC712

  • 80kHz bandwidth
  • 66 to 185 mV/A output sensitivity
  • The low-noise analog signal path
  • Device bandwidth is set via the new FILTER pin
  • 1.2 mΩ internal conductor resistance
  • Total output error of 1.5% at TA = 25°C
  • Stable output offset voltage.
  • Near zero magnetic hysteresis

Types of acs712 current sensors

This ACS712 sensor is classified based on the current ratings, which are mentioned below.

The circuit has different current ratings, so while choosing the current sensor choose according to your Current requirements.

SL.noType of ACS712TA (°C)Optimized Range, IP
                  (A)
Sensitivity, Sens
(Typ) (mV/A)

1ACS712 -5A–40 to 85±5185
2ACS712 -20A–40 to 85±20100
3ACS712 -30A–40 to 85±3066
ACS712 Sensors available with different Current Ratings

Applications

  • Motor speed control in motor control circuits
  • Electrical load detection and management
  • Switched-mode power supplies (SMPS)
  • Protection for over-current

working of acs712 current sensor

This acs712 sensor consists of a  linear hall effect circuit along with a copper conduction path. The copper conduction path is located around the surface of the die. When ac or DC passes through a copper conduction path, it produces a magnetic field.

Hall Effect in Sensor

 This electromagnetic field interacts with the hall effect sensor. Hall effect circuit converts this electromagnetic field into proportional voltage either ac or dc depending on input current type.  This output voltage is measured with the help of Arduino or any microcontroller.

How to use the ACS712 module with Arduino

Wiring diagram of ACS712 with Arduino

The ACS712 module has two phoenix terminal connectors (green color ones) with mounting screws as shown above. These are the terminals through which the wire has to be passed. In our case, I am measuring the current drawn by the motor so the wires that are going to the load (motor) are passed through the ACS 712 Module. Make sure the module is connected in series with the load and be extra cautious to avoid shorts.

ACS712 wiring with Motor to measure the current how much it take while running

On the other side, we have three pins. The Vcc is connected to +5V to power the module and the ground is connected to the ground of the MCU (system). Then the analog voltage given out by the ACS712 module is read using an analog pin on the Microcontroller.

float voltage;
void setup()
{
  Serial.begin(9600);                    //Start Serial Monitor to display current read value on Serial monitor
}

void loop()
{
  unsigned int x=0;
  float AcsValue=0.0,Samples=0.0,AvgAcs=0.0,AcsValueF=0.0;
  for (int x = 0; x < 10; x++)          //Get 10 samples
  {
    AcsValue = analogRead(A0);           //Read current sensor values   
    Samples = Samples + AcsValue;        //Add samples together
    delay (3);                           // let ADC settle before next sample 3ms
  }
  AvgAcs=Samples/10.0;                   //Taking Average of Samples
  voltage=AvgAcs*(5.0 / 1024.0);         //((AvgAcs * (5.0 / 1024.0)) is converitng the read voltage in 0-5 volts
  Serial.print("Raw Voltage:");
  Serial.print(voltage);
  AcsValueF = (2.5 - voltage)*1000/0.185; //2.5 is offset,,,   0.185v is rise in output voltage when 1A current flows at input
  Serial.print("\t");
  Serial.print("Motor Current :");
  Serial.print(AcsValueF);               //Print the read current on Serial monitor
  Serial.println(" mA");
}
Current Measured by ACS712, the value printed in Serial Monitor
Current values vary according to the load on the motor

All the components used in this article are readily available on our website. And also other interesting electronic components are there, Please visit https://www.probots.co.in and also you can place it online, we can deliver it. images only for reference

2 thoughts on “How to measure Current using ACS712 Current Sensor and Arduino”

  1. Hello Congratulations
    my question for a
    Nano Arduino, would be the same pins,
    What would be the pins for your connection in Nanoarduino

Leave a Reply

Your email address will not be published. Required fields are marked *