Blog

ACS712 20A Current Sensor Module – Complete Guide

Current Sensor Module

ACS712 20A Current Sensor Module

Hall-Effect Current Sensing with Analog Voltage Output

Measuring current directly usually means breaking the circuit and inserting a sense resistor, then dealing with the voltage drop and power loss that resistor introduces - the ACS712 avoids all of that by using the Hall effect instead. Current flowing through the chip's internal conduction path generates a small magnetic field proportional to that current, and the chip's onboard Hall-effect sensor detects that field and converts it into a proportional analog output voltage, all while keeping the sensing circuitry and the high-current path galvanically isolated from each other - there is no direct electrical connection between the current-carrying path and the signal side of the chip. This 20A version outputs 100mV per amp, centered at half the supply voltage (2.5V on a 5V supply) at zero current, swinging higher for current in one direction and lower for the other, which is what lets a single sensor read both positive and negative - AC or bidirectional DC - current around that center point.

± 20A
Range
100 mV/A
Sensitivity
Hall-Effect
Sensing Method

Key features

Hall-Effect Sensing

Measures current without breaking the circuit or adding series resistance.

Galvanic Isolation

The sensing side is electrically isolated from the high-current path.

Bidirectional Measurement

Reads both AC and DC current, centered at a mid-supply zero point.

Low Insertion Resistance

Minimal internal resistance means negligible power loss in the measured circuit.

Fast Response Time

Reacts quickly enough to capture current transients and short spikes.

Onboard Screw Terminals

Solid, solderless connection for the high-current path on most breakouts.

Technical specifications

Supply Voltage 5V DC
Current Range ± 20A
Sensitivity 100 mV/A
Zero-Current Output 2.5V (half of 5V supply)
Bandwidth ~80 kHz
Output Analog voltage, proportional to current
Isolation Galvanic (2.1kV RMS working voltage)
Response Time ~5µs
Package Breakout module with screw terminals

Pinout

PinFunction
VCC 5V power supply
GND Ground
OUT Analog voltage output
IP+ / IP- High-current path screw terminals (the current being measured)

Applications

Battery charge/discharge current monitoring Motor current sensing and stall detection DC power supply current metering Overcurrent protection circuits Solar panel current logging Energy usage monitoring projects

What's in the box

1x ACS712 20A current sensor module

Downloads

Datasheet (PDF) Arduino Current-Sensing Example Sketch
🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
ACS712-20AVCC/GND/OUT5V (or 3.3V - see code note) / GND / board analog pin
📟
20A range Current Sensor Module ACS712
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
20A range Current Sensor Module ACS712 - Arduino Uno
20A range Current Sensor Module ACS712 - Arduino Nano
20A range Current Sensor Module ACS712 - Arduino Mega
20A range Current Sensor Module ACS712 - ESP32
20A range Current Sensor Module ACS712 - ESP8266
20A range Current Sensor Module ACS712 - STM32
20A range Current Sensor Module ACS712 - Raspberry Pi Pico
📄 File: 20a_range_current_sensor_module_acs712_-_arduino_uno.inoArduino Uno
578 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin A0 on Arduino Uno
6#define ACS_PIN A0
7const float VCC = 5.0;
8const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
9const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
10
11void setup() {
12 Serial.begin(115200);
13}
14
15void loop() {
16 int raw = analogRead(ACS_PIN);
17 float voltage = raw * 5.0 / 1023.0;
18 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
19
20 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
21
22 delay(500);
23}
📄 File: 20a_range_current_sensor_module_acs712_-_arduino_nano.inoArduino Nano
579 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin A0 on Arduino Nano
6#define ACS_PIN A0
7const float VCC = 5.0;
8const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
9const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
10
11void setup() {
12 Serial.begin(115200);
13}
14
15void loop() {
16 int raw = analogRead(ACS_PIN);
17 float voltage = raw * 5.0 / 1023.0;
18 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
19
20 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
21
22 delay(500);
23}
📄 File: 20a_range_current_sensor_module_acs712_-_arduino_mega.inoArduino Mega
579 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin A0 on Arduino Mega
6#define ACS_PIN A0
7const float VCC = 5.0;
8const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
9const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
10
11void setup() {
12 Serial.begin(115200);
13}
14
15void loop() {
16 int raw = analogRead(ACS_PIN);
17 float voltage = raw * 5.0 / 1023.0;
18 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
19
20 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
21
22 delay(500);
23}
📄 File: 20a_range_current_sensor_module_acs712_-_esp32.inoESP32
834 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin 34 on ESP32
6// NOTE: this module is normally supplied with 5V (its zero-current point is VCC/2).
7// Power it from 5V still if your board has a 5V pin (Uno/Nano/Mega do); on 3.3V-only
8// boards power the module from 3.3V instead and this code's VCC constant already matches.
9#define ACS_PIN 34
10const float VCC = 3.3;
11const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
12const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
13
14void setup() {
15 Serial.begin(115200);
16}
17
18void loop() {
19 int raw = analogRead(ACS_PIN);
20 float voltage = raw * 3.3 / 4095.0;
21 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
22
23 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
24
25 delay(500);
26}
📄 File: 20a_range_current_sensor_module_acs712_-_esp8266.inoESP8266
836 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin A0 on ESP8266
6// NOTE: this module is normally supplied with 5V (its zero-current point is VCC/2).
7// Power it from 5V still if your board has a 5V pin (Uno/Nano/Mega do); on 3.3V-only
8// boards power the module from 3.3V instead and this code's VCC constant already matches.
9#define ACS_PIN A0
10const float VCC = 3.3;
11const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
12const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
13
14void setup() {
15 Serial.begin(115200);
16}
17
18void loop() {
19 int raw = analogRead(ACS_PIN);
20 float voltage = raw * 3.3 / 1023.0;
21 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
22
23 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
24
25 delay(500);
26}
📄 File: 20a_range_current_sensor_module_acs712_-_stm32.inoSTM32
836 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin PA0 on STM32
6// NOTE: this module is normally supplied with 5V (its zero-current point is VCC/2).
7// Power it from 5V still if your board has a 5V pin (Uno/Nano/Mega do); on 3.3V-only
8// boards power the module from 3.3V instead and this code's VCC constant already matches.
9#define ACS_PIN PA0
10const float VCC = 3.3;
11const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
12const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
13
14void setup() {
15 Serial.begin(115200);
16}
17
18void loop() {
19 int raw = analogRead(ACS_PIN);
20 float voltage = raw * 3.3 / 4095.0;
21 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
22
23 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
24
25 delay(500);
26}
📄 File: 20a_range_current_sensor_module_acs712_-_raspberry_pi_pico.inoRaspberry Pi Pico
846 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Analog pin 26 on Raspberry Pi Pico
6// NOTE: this module is normally supplied with 5V (its zero-current point is VCC/2).
7// Power it from 5V still if your board has a 5V pin (Uno/Nano/Mega do); on 3.3V-only
8// boards power the module from 3.3V instead and this code's VCC constant already matches.
9#define ACS_PIN 26
10const float VCC = 3.3;
11const float SENSITIVITY = 0.100; // V per A, for the ACS712 20A module variant
12const float ZERO_CURRENT_VOLTAGE = VCC / 2.0; // module outputs VCC/2 at 0A
13
14void setup() {
15 Serial.begin(115200);
16}
17
18void loop() {
19 int raw = analogRead(ACS_PIN);
20 float voltage = raw * 3.3 / 4095.0;
21 float current = (voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY;
22
23 Serial.print("Current: "); Serial.print(current); Serial.println(" A");
24
25 delay(500);
26}
Hall-effect AC/DC current sensor, 20A variant.
The ”2.5V at zero current” center point is nominal - individual units can be off by tens of millivolts, so read and store the actual zero-current voltage from your specific board at startup with no load connected, rather than assuming exactly 2.5V. The raw analog reading is noisy enough that a single ADC sample rarely gives a clean number - average many samples, or if measuring AC, calculate RMS current properly over a full cycle rather than reading one instant. And remember the IP+/IP- terminals carry the FULL load current, not a small sense current - use appropriately rated wire and connectors for whatever current you're actually measuring, and never exceed the sensor's rated range even briefly.