What are some of the primary applications of the ACS712 current sensor Arduino?
Before we delve into that, imagine a scenario where you’d like to obtain the current flowing through a device.
What would you use to measure it?
Also, say you have an Arduino project where you’d like to display the current passing through your modules.
What is the ideal measuring device? If you have the above queries, we got you covered.
Read this article to learn how to create a simple current-level sensor for your project.
Table of Contents
- What is an ACS712 Current Sensor
- ACS712 Current Sensor Pinout
- ACS712 Current Sensor Working Principle
- Acs712 Current Sensor Module Ratings
- Acs712 Dc Current Measurement Formula
- Interfacing ASC712 Current Sensor with Arduino
- ACS712 Current Sensor Arduino Code
- ACS712 Current Sensor Code Explanation
- Applications of ACS712 Current Sensor
- Summary
What is an ACS712 Current Sensor
As its name suggests, this is a module you can primarily apply in measuring the current passing through a device.
Its manufacturer is Allegro MicroSystems, and the module has many variations, each suited to a different current-level measurement.
The primary upside of the module is that you can use it to obtain both the DC and AC, and you can use it in numerous applications, as we’ll highlight below.
ACS712 Current Sensor Pinout
Below is a pin diagram that indicates the pinout of this module. It is an 8-lead SOIC package, as our diagram indicates.
ACS712 Current Sensor Pinout
Next, let us find out the function of each pin from the table below.
Pin No. | Pin Name | Function of the Pin |
Pin 1 and Pin 2 | IP+ | It is the module’s positive terminal imperative in current measurements. |
Pin 3 and Pin 4 | IP- | The pins are also useful in current measurements and operate as negative terminals. During connection, ensure you attach the external device in series with the IP+ and IP- pins. |
Pin 5 | GND Pin | It’s the Ground Pin. |
Pin 6 | FILTER | This is the module’s External Capacitor which is imperative to set the bandwidth. |
Pin 7 | VIOUT | It’s the voltage out (Vout)pin or module’s analog input. This is the pin whereby you measure the current of the device connected to the module |
Pin 8 | VCC | Power supply pin. |
Quiescent output voltage (VIOUT(Q)
Another parameter you need to know to understand the working principle of the module is the Quiescent output voltage.
It is primarily your external device’s output voltage before any current runs through it.
Take a case whereby you’re dealing with a uni-polar supply voltage.
In such a scenario, the Quiescent output voltage equals VCC ⁄ 2.
Hence, for an ACS712 Current Sensor on a 5V power supply source, VIOUT(Q) is 2.5V.
We calculate the Quiescent output voltage so that the real output of your external device is the difference between the measured voltage and the VIOUT(Q) value.
Therefore, in our measurements, 2.5V will be the output base voltage when we apply a 5V input.
ACS712 Current Sensor Working Principle
A Hall effect current sensor illustration.
The ACS712 module is primarily a Hall effect type of sensor.
Also, there’s an internal link between the IP+ and IP- meaning that when you connect power to the module, current flows across it.
This prompts the creation of a magnetic field on the module.
ACS712 converts this field to a voltage directly proportional to the input voltage you’re measuring.
The hall effect sensor is imperative in ensuring that the module’s power supply doesn’t interfere with the current of the device you’re measuring.
Acs712 Current Sensor Module Ratings
AcsOffset: This output voltage is at zero input current.
A closed loop Hall Effect Sensor.
There are three main variations to the ACS712 current sensor module, and each is optimized to measure a particular current range. Check out the table below.
ACS712 Current Sensor Module Type | Optimized current range in Amperes | Module Sensitivity in mV/A | Working Temperature Range (in degrees Celsius) |
ACS712ELCTR-05B-T | +5 to -5 A | 185 | -40 to 85 |
ACS712ELCTR-20A-T | +20 to -20 A | 100 | -40 to 85 |
ACS712ELCTR-30A-T | +30 to -30 A | 66 | -40 to 85 |
Table Explanation.
The ACS712ELCTR-05B-T module is best suited for current measurements in the +5 to -5 A range.
Also, from the table, this module features a 185mV sensitivity. It means that when the module’s output voltage changes by 185mV, there’s Δ1A in the input current.
The same also applies to the other modules.
For instance, for the ACS712ELCTR-20A-T, a change of 100mV in output voltage means a 1A input current, and so on for the third module.
Acs712 Dc Current Measurement Formula
Next, let us look at how to calculate our external device’s current from the above measurements.
External Device’s Current = (AcsOffset – (Arduino analog reading)) / Sensitivity
Arduino analog reading is the value you obtain from your Ardunino’s analog output pin.
Nonetheless, before using this value, you must convert it to an actual voltage value.
Sensitivity: This primarily depends on your module’s rating, as illustrated in the table above.
Interfacing ASC712 Current Sensor with Arduino
An Arduino Uno Board.
Normally, you do not need the ACS712 current sensor for voltage measurements, as you can directly obtain this from the Arduino Analog Pins.
Also, for larger voltage measurements than the Arduino’s 5V rating, you can measure voltage by primarily interfacing it with a voltage sensor module.
However, the ACS712 Current sensor module is central to current measurements.
Hence, in today’s experiment, we’ll elaborate on how to interface it with Arduino to obtain the load’s input current.
Components Required
- ASC712 Current Sensor Module
- Arduino UNO
- A lamp or any other viable load
- An LCD Display
A 16×2 LCD Display.
- 330Ω Resistor
- USB Connector- To power your Arduino Board.
- Connecting cables
- 10KΩ Potentiometer
- Power Supply
Circuit Diagram
Circuit Design
Make the connections as per the circuit diagram above. You can use any type of load (in our case, we will use a lamp).
ACS712 Current Sensor Arduino Code
Run the Arduino code below on your Arduino IDE.
ACS712 Current Sensor Code Explanation
After uploading the above code, you’ll obtain the current on the LCD reading. Earlier, we highlighted the current DC measurement formula.
We have incorporated it in the code to calculate the current.
Applications of ACS712 Current Sensor
- Battery Chargers
- Power Inverters
- Power Steering
Summary
This experiment enables you to check out the current of any load.
But the rule of thumb is to choose a module with the right rating from the three types we have discussed above.
Also, the Arduino code we have given incorporates the current measurement formula, so if you get the connection right, your setup should give you the current of any load.