Interfacing ACS712 with Arduino
Summary
The ACS712 current sensor is a useful device for measuring electrical current in various applications. In this blog, we explore what the ACS712 current sensor is, how it works, and what hardware is needed to interface it with an Arduino. We also discuss several applications of this sensor, including power monitoring and control, robotics, and renewable energy systems. Whether you are a hobbyist or a professional, this blog provides essential information about the ACS712 current sensor and its potential applications.
In this blog, we are going to learn about the ACS712 Current sensor and Interfacing ACS712 with Arduino and measure the current flowing in a circuit.
Current flowing through a conductor causes a voltage drop. The relation between current and voltage is given by Ohm’s law. In electronic devices, an increase in the amount of current above its requirement leads to overload and can damage the device.
Measurement of current is necessary for the proper working of devices. Measurement of voltage is a Passive task and it can be done without affecting the system. Whereas measurement of current is an Intrusive task that cannot be detected directly as voltage.
What is the ACS712 Current sensor?
For measuring current in a circuit, a sensor is required. ACS712 Current Sensor is the sensor that can be used to measure and calculate the amount of current applied to the conductor without affecting the performance of the system.
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.

read more : Temperature Sensor Interfacing with Arduino
How does the ACS712 Current sensor work?
Current Sensor detects the current in a wire or conductor and generates a signal proportional to the detected current either in the form of analog voltage or digital output.
Current Sensing is done in two ways – Direct sensing and Indirect Sensing. In Direct sensing, to detect current, Ohm’s law is used to measure the voltage drop that occurred in a wire when current flows through it.
A current-carrying conductor also gives rise to a magnetic field in its surrounding. In Indirect Sensing, the current is measured by calculating this magnetic field by applying Faraday’s law.

ACS712 Current Sensor uses the Indirect Sensing method to measure the current. To sense current, a low-offset Hall effect sensor circuit is used in this module. This sensor is located at the surface of the IC on a copper conduction path. When current flows through this copper conduction path it generates a magnetic field which is sensed by the Hall effect sensor. A voltage proportional to the sensed magnetic field is generated by the Hall sensor, which is used to measure current.
read more : Arduino Hacks we bet you did not know!
Hardware required for interfacing ACS712 current sensor with Arduino:
- Arduino UNO - 1 (You can use any Arduino board for this project)
- ACS712 current sensor - 1
- DC motor - 1 (You can use any other load for this project)
- Jumper cables - As required
- Power supply for the load.
Circuit Diagram of ASC712 Current Sensor with Arduino

Code
|
#define sensorPin A0 |
Code Explanation
We have declared the analog pin A0 of Arduino for reading the current sensor’s output using the “#define” preprocessor component and named it “sensorPin”.
In the void setup() function, we are starting serial data communication with the baud rate of 9600. “Serial.begin(9600);” is the syntax used for initializing the serial communication.
In the void loop() function, we are calculating the final current using the ACS712 sensor’s analog output value. Finally, the current value will be displayed on the serial monitor.
Applications
- Inverters
- SMPS
- Battery Chargers
- Automotive Applications like Inverters
- Used in industrial, commercial, and communication applications
- overcurrent fault protection circuit
read more : Obstacle Avoidance Robot with Ultrasonic Sensors using Arduino
Conclusion
In this blog post, we have learned that the ACS712 Current Sensor is a versatile and reliable device that provides accurate current measurements in a variety of applications. By understanding its inner workings and hardware requirements for interfacing with an Arduino, you can unlock its full potential and take advantage of its many benefits. Whether you're monitoring power consumption in a home automation system or measuring the output of a solar panel, the ACS712 Current Sensor is an essential tool for any electronics enthusiast. So don't wait any longer, get your hands on this amazing ACS712 Current Sensor and start exploring the endless possibilities it has to offer!
If you appreciate our work don't forget to share this post and leave your opinion in the comment box.
Please do check out other blog posts about Arduino Interfacing with Ultrasonic Sensor , LED Interfacing with Arduino , Interfacing GSM Module with Arduino , Interfacing MAX30100 Pulse Oximeter with Arduino , IR Sensor Interfacing with Arduino , How to connect ZMPT101B to Arduino and How to use Buzzer with Arduino.
Make sure you check out our wide range of products and collections (we offer some exciting deals!)
Excerpt
Frequently Asked Questions
1. How to use ACS712 current sensor Arduino?
The ACS712 sensor is used to measure the current flowing in a circuit. You can interface the ACS712 sensor with Arduino by going through the above blog.
2. Can ACS712 work with 3.3 V?
Yes, the ACS712 can work on 3.3V.
3. Can ACS712 measure DC current?
Yes, the ACS712 current sensor can measure DC current.
4. How current sensor works with Arduino?
The current sensor gives a different voltage level as output at different values of current flowing through the circuit. Based on the analog output of the ACS712 current sensor the current measurement is done.
5. What is ACS712 current sensor?
The ACS712 current sensor is a device that uses the Hall effect to measure both direct and alternating currents. It comprises a Hall sensor circuit with a copper conduction path positioned near the surface of the die. The sensor offers accurate current sensing solutions for a variety of systems, such as industrial, commercial, and communications systems.
6. Is ACS712 analog or digital?
The ACS is an analog sensor for detecting the flow of electricity, which produces a linearly varying signal named VOUT. This sensor can measure the direction and magnitude of both AC and DC currents.
7. What is the ACS712 current sensor?
The ACS712 current sensor is a device that measures both AC and DC currents. It uses Hall effect sensing technology, providing an analog voltage output proportional to the current flowing through it. This makes it ideal for various electronics projects and applications where current monitoring is essential. Its compact design and ease of use are additional benefits for hobbyists and professionals alike.
8. How does ACS712 measure current using Hall effect?
The ACS712 measures current by utilizing the Hall effect, which detects magnetic fields generated by the current. As current flows through a conductor, it creates a magnetic field, which the sensor detects. The Hall effect sensor outputs a voltage proportional to this magnetic field, which translates directly to the current measurement, allowing for accurate readings in real-time.
9. How do I connect ACS712 to Arduino?
To connect the ACS712 to an Arduino, connect the VCC pin to the Arduino’s 5V, the GND pin to the ground, and the output pin (Vout) to an analog input pin (e.g., A0). Make sure the load current flows through the sensor’s input terminals. This simple setup allows you to integrate current monitoring into your Arduino projects effortlessly.
10. What code is used to read current from ACS712?
Yes, the ACS712 can measure both AC and DC currents effectively. Its design allows it to detect the current flow in either direction, making it versatile for various applications. This feature is crucial for projects that require monitoring different types of electrical loads, providing flexibility for electronics enthusiasts.
11. Can ACS712 measure both AC and DC current?
The ACS712 modules come in different versions, typically offering ranges of 5A, 20A, and 30A. The sensitivity varies as follows: for the 5A version, it's 185 mV/A, for the 20A version, it's 100 mV/A, and for the 30A version, it’s 66 mV/A. This makes them suitable for a range of projects requiring different current measurements.
12. What is the range and sensitivity of ACS712 modules?
To calibrate the ACS712, first measure a known current with a multimeter. Then, adjust the output readings in your code by calculating the difference between the measured and expected values. You can add an offset in your calculations to compensate for any variations, ensuring accurate current readings in your projects.
13. How do I calibrate ACS712 for accurate readings?
To filter noise from the ACS712 output, you can use a low-pass filter circuit, typically consisting of a resistor and capacitor (RC filter). Additionally, you can implement software filtering techniques such as averaging multiple readings in your code. This helps smooth out the output and provides more stable current measurements.
14. How to filter noise in ACS712 output?
Common errors in ACS712 wiring include incorrect connections to the VCC, GND, and output pins, leading to inaccurate readings. Additionally, ensure that the load current flows through the sensor terminals correctly. Misconfiguration can damage the sensor or produce erroneous data, impacting your project's performance. Always double-check your wiring.
15. What are common errors in ACS712 wiring?
The ACS712 sensor is effectively used in projects such as energy monitoring systems, power consumption measurement, and motor control applications. It’s also popular in home automation projects where current monitoring is crucial. Its versatility allows it to be integrated into various electronic designs, making it a favorite among hobbyists and engineers alike.
16. What projects use ACS712 sensors effectively?
1. How to use ACS712 current sensor Arduino?
The ACS712 sensor is used to measure the current flowing in a circuit. You can interface the ACS712 sensor with Arduino by going through the above blog.
2. Can ACS712 work with 3.3 V?
Yes, the ACS712 can work on 3.3V.
3. Can ACS712 measure DC current?
Yes, the ACS712 current sensor can measure DC current.
4. How current sensor works with Arduino?
The current sensor gives a different voltage level as output at different values of current flowing through the circuit. Based on the analog output of the ACS712 current sensor the current measurement is done.
5. What is ACS712 current sensor?
The ACS712 current sensor is a device that uses the Hall effect to measure both direct and alternating currents. It comprises a Hall sensor circuit with a copper conduction path positioned near the surface of the die. The sensor offers accurate current sensing solutions for a variety of systems, such as industrial, commercial, and communications systems.
6. Is ACS712 analog or digital?
The ACS is an analog sensor for detecting the flow of electricity, which produces a linearly varying signal named VOUT. This sensor can measure the direction and magnitude of both AC and DC currents.
7. What is the ACS712 current sensor?
The ACS712 current sensor is a device that measures both AC and DC currents. It uses Hall effect sensing technology, providing an analog voltage output proportional to the current flowing through it. This makes it ideal for various electronics projects and applications where current monitoring is essential. Its compact design and ease of use are additional benefits for hobbyists and professionals alike.
8. How does ACS712 measure current using Hall effect?
The ACS712 measures current by utilizing the Hall effect, which detects magnetic fields generated by the current. As current flows through a conductor, it creates a magnetic field, which the sensor detects. The Hall effect sensor outputs a voltage proportional to this magnetic field, which translates directly to the current measurement, allowing for accurate readings in real-time.
9. How do I connect ACS712 to Arduino?
To connect the ACS712 to an Arduino, connect the VCC pin to the Arduino’s 5V, the GND pin to the ground, and the output pin (Vout) to an analog input pin (e.g., A0). Make sure the load current flows through the sensor’s input terminals. This simple setup allows you to integrate current monitoring into your Arduino projects effortlessly.
10. What code is used to read current from ACS712?
Yes, the ACS712 can measure both AC and DC currents effectively. Its design allows it to detect the current flow in either direction, making it versatile for various applications. This feature is crucial for projects that require monitoring different types of electrical loads, providing flexibility for electronics enthusiasts.
11. Can ACS712 measure both AC and DC current?
The ACS712 modules come in different versions, typically offering ranges of 5A, 20A, and 30A. The sensitivity varies as follows: for the 5A version, it's 185 mV/A, for the 20A version, it's 100 mV/A, and for the 30A version, it’s 66 mV/A. This makes them suitable for a range of projects requiring different current measurements.
12. What is the range and sensitivity of ACS712 modules?
To calibrate the ACS712, first measure a known current with a multimeter. Then, adjust the output readings in your code by calculating the difference between the measured and expected values. You can add an offset in your calculations to compensate for any variations, ensuring accurate current readings in your projects.
13. How do I calibrate ACS712 for accurate readings?
To filter noise from the ACS712 output, you can use a low-pass filter circuit, typically consisting of a resistor and capacitor (RC filter). Additionally, you can implement software filtering techniques such as averaging multiple readings in your code. This helps smooth out the output and provides more stable current measurements.
14. How to filter noise in ACS712 output?
Common errors in ACS712 wiring include incorrect connections to the VCC, GND, and output pins, leading to inaccurate readings. Additionally, ensure that the load current flows through the sensor terminals correctly. Misconfiguration can damage the sensor or produce erroneous data, impacting your project's performance. Always double-check your wiring.
15. What are common errors in ACS712 wiring?
The ACS712 sensor is effectively used in projects such as energy monitoring systems, power consumption measurement, and motor control applications. It’s also popular in home automation projects where current monitoring is crucial. Its versatility allows it to be integrated into various electronic designs, making it a favorite among hobbyists and engineers alike.




