Free delivery on orders above Rs 900 | Single Delivery charges for Multiple Items

Cart

Your Cart is Empty

Back To Shop

Cart

Your Cart is Empty

Back To Shop

Interfacing ACS712 Current Sensor with Arduino – Step by Step Guide to Measure Current

The article covers the definition of the current sensor, it’s working and interfacing of the current sensor with Arduino.

Have you ever think how much current your electrical appliances required? If you wish to measure the current consumption of your electrical equipment, the current sensor comes to play.

A Current Sensor is an important thing for power calculation and management applications. It measures the current taken by the circuit and generates an appropriate signal. This sensor generates an analog voltage at the output.

In this tutorial, we are going to learn about the definition of the current sensor, it’s working and interfacing of the current sensor with Arduino.

What is the ACS712 Current sensor?

ACS712 is a Hall Effect-Based Linear Current Sensor. This sensor can measure both DC(Direct Current) and AC(Alternating Current). It has 2.1kVRMS voltage isolation and an integrated low-resistance current conductor. This ACS712 is a chip.

Source: www.electronicshub.org

The ACS712 sensor module has 3 pins:

  • VCC: Power supply – 5v
  • GND: Ground
  • OUT: Analog output voltage

There are three types of ACS712 Sensor based on the range of its current sensing. These ranges are +/-5A, +/-20A and +/-30A. The features of ACS712 current Sensor are followed,

  1. 80kHz bandwidth
  2. 66 to 185 mV/A output sensitivity
  3. The low-noise analog signal path
  4. Device bandwidth is set through the new FILTER pin
  5. 1.2 mΩ internal conductor resistance
  6. Stable output offset voltage.
  7. Near zero magnetic hysteresis

How ACS712 Current sensor works?

When it comes to the working principle of this sensor, it can be direct sensing or indirect sensing. For the ACS712 current sensor, it uses indirect sensing.  The direct sensing uses Ohm’s law to measure the voltage drop across the wire when current flows through it. In indirect sensing, the   Ampere law is used to measure the current by calculating the magnetic field. This method uses either a transformer or Hall effect sensor or  to sense the magnetic field. 

To sense the current, this IC uses a low-offset Hall sensor. This sensor is located on the surface of the IC on a copper conduction path. It has a copper strip connecting internally to the IP+ and IP- pins of the sensor. When the amount of current flows through this copper conductor, it generates a magnetic field which is sensed by the Hall Effect sensor. The hall effect sensor generates the voltage proportional to the sensed magnetic field which is used to measure current.

Interfacing ACS712 Current Sensor with Arduino

To measure the current, we need Arduino or any other microcontroller to interface with a current sensor. The below image shows the connection diagram of the ACS712 current sensor with an Arduino microcontroller. Using, this we can measure AC as well as DC current. Here, I am using DC motor as a load.

Software and Programming Code

Download the Arduino IDE Software and the LCD display library for this code from the below links,

#include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); const int currentPin = A0; int sensitivity = 66; int adcValue= 0; int offsetVoltage = 2500; double adcVoltage = 0; double currentValue = 0; void setup() { Serial.begin(9600); lcd.begin(16, 2); lcd.print(” Current Sensor “); lcd.setCursor(0,1); lcd.print(” with Arduino “); delay(2000); } void loop() { adcValue = analogRead(currentPin); adcVoltage = (adcValue / 1024.0) * 5200; currentValue = ((adcVoltage – offsetVoltage) / sensitivity); Serial.print(“Raw Sensor Value = ” ); Serial.print(adcValue); lcd.clear(); delay(1000); //lcd.display(); lcd.setCursor(0,0); lcd.print(“ADC Value = “); lcd.setCursor(12,0); lcd.print(adcValue); delay(2000); Serial.print(“\t Voltage(mV) = “); Serial.print(adcVoltage,3); lcd.setCursor(0,0); lcd.print(“V in mV = “); lcd.setCursor(10,0); lcd.print(adcVoltage,1); delay(2000); Serial.print(“\t Current = “); Serial.println(currentValue,3); lcd.setCursor(0,0); lcd.print(“Current = “); lcd.setCursor(10,0); lcd.print(currentValue,2); lcd.setCursor(14,0); lcd.print(“A”); delay(2500); }

After successfully uploading the code, you can see the below output,

Final Words

I hope this tutorial helps you to understand the basics of the current sensor, it’s working principle and the interfacing of the current sensor with Arduino. With the help of this tutorial, you can easily measure the current requirement of your electrical appliances. 

Cart

Your Cart is Empty

Back To Shop
GET DISCOUNT CODE

It will take just few seconds to claim 7% Discount, After Submitting check Email for Coupon code.

    X
    GET DISCOUNT CODE