ACS712 Current Sensor Module 5A / 20A / 30A – Arduino Wiring, Calibration & AC/DC Current Measurement
The ACS712 current sensor module provides an analogue voltage proportional to the current flowing through its screw-terminal current path. It can measure current in either direction and is available with ACS712 variants optimised for ±5A, ±20A or ±30A measurement ranges.
This guide covers variant identification, Arduino UNO wiring, DC current measurement, low-voltage AC RMS measurement, zero-current calibration, ADC limitations and common troubleshooting steps.
ACS712 Overview
The ACS712 IC operates from a 4.5V to 5.5V supply and is normally powered from 5V on this style of module. With no current flowing, the analogue output is nominally half the supply voltage, or about 2.5V when powered from 5V. Current in one direction moves the output above this midpoint and current in the opposite direction moves it below the midpoint.
The ACS712 is not a clamp sensor. The load current flows through the low-resistance conductor inside the sensor IC via the two screw terminals. Hall-effect sensing electrically separates this primary current path from the VCC, OUT and GND signal connections.
The ACS712 IC itself provides galvanic isolation between its primary current conductor and signal pins. However, the safe working voltage of a complete breakout module also depends on its PCB spacing, terminal block, tracks, assembly and enclosure. Do not use an unidentified generic module for mains or other hazardous voltages simply because the ACS712 IC has a high isolation rating.
5A, 20A and 30A Variants
The three versions use different factory-set sensitivities. The sensitivity value used in your software must match the ACS712 variant fitted to the module.
| ACS712 Variant | Nominal Range | Typical Sensitivity at 5V | Approx. Output at Full Scale |
|---|---|---|---|
| 05B | ±5A | 185mV/A | About 1.58V to 3.43V |
| 20A | ±20A | 100mV/A | About 0.50V to 4.50V |
| 30A | ±30A | 66mV/A | About 0.52V to 4.48V |
They should not be treated automatically as guaranteed continuous-current ratings for every generic breakout board. At high current, the PCB copper, solder joints and screw terminal can become the limiting parts. Confirm the current capability of the exact module assembly and wiring before using it near the top of its sensor range.
At IC level, the ACS712 has an 80kHz nominal bandwidth and approximately 1.2mΩ primary conductor resistance. Components fitted to a particular breakout board can reduce its effective bandwidth.
Module Connections
The pictured module style has a three-pin signal header marked VCC, OUT and GND, plus a two-position screw terminal carrying the measured current.
| Module Connection | Function | Notes |
|---|---|---|
| VCC | Sensor power | Connect to 5V for normal operation |
| OUT | Analogue current signal | Approximately 2.5V at zero current when VCC is 5V |
| GND | Signal-side ground | Connect to controller ground |
| Screw terminal 1 | Primary current path | Connect in series with the load circuit |
| Screw terminal 2 | Primary current path | Connect in series with the load circuit |
Generic modules do not always identify which screw terminal corresponds to the ACS712 IP+ side. If a known positive DC current produces a negative reading, reverse the two current-path connections or invert the sign in software.
Arduino UNO Wiring
The Arduino UNO is convenient for this module because both use a nominal 5V supply and the UNO provides a 10-bit analogue input.
| ACS712 Module | Arduino UNO | Function |
|---|---|---|
| VCC | 5V | Sensor supply |
| GND | GND | Signal ground |
| OUT | A0 | Analogue current measurement |
Low-Voltage DC Current Path
Switch the load supply off before changing the current-path wiring. A typical high-side connection is:
Power supply positive → ACS712 screw terminal → ACS712 screw terminal → load positive
Connect the load negative back to the power supply negative in the normal way. The two screw terminals form a series current path; neither screw terminal is the module's signal GND connection.
With a 5V sensor supply, OUT sits near 2.5V at zero current and can approach about 4.5V on the 20A and 30A variants. Many 3.3V microcontrollers, including ESP32-family devices, cannot directly measure this full range. Use a suitable voltage-scaling circuit or compatible external ADC. A standard Raspberry Pi computer also requires an external ADC because its GPIO header does not provide a general-purpose analogue input.
Arduino DC Current Test
No external Arduino library is required. The sketch below measures the zero-current offset during startup, averages the analogue input and converts the result to amperes.
The first few seconds are used to measure the module's real zero-current output. Disconnect or switch off the load current while this calibration is taking place.
Set SENSITIVITY_V_PER_A to 0.185 for the 5A version, 0.100 for the 20A version or 0.066 for the 30A version.
const int SENSOR_PIN = A0;
// Select the value for your ACS712 variant:
// 5A = 0.185 V/A
// 20A = 0.100 V/A
// 30A = 0.066 V/A
const float SENSITIVITY_V_PER_A = 0.185;
const int ZERO_SAMPLES = 1000;
const int READ_SAMPLES = 200;
float zeroCounts = 0.0;
void setup() {
Serial.begin(115200);
delay(500);
Serial.println("ACS712 current sensor");
Serial.println("Keep current at 0 A while calibrating...");
long sum = 0;
for (int i = 0; i < ZERO_SAMPLES; i++) {
sum += analogRead(SENSOR_PIN);
delay(2);
}
zeroCounts = sum / (float)ZERO_SAMPLES;
Serial.print("Zero ADC reading: ");
Serial.println(zeroCounts, 2);
Serial.println("Calibration complete.");
}
void loop() {
long sum = 0;
for (int i = 0; i < READ_SAMPLES; i++) {
sum += analogRead(SENSOR_PIN);
}
float averageCounts = sum / (float)READ_SAMPLES;
// The ACS712 and UNO ADC are both referenced to the same 5 V rail.
// Sensitivity values above are specified at a nominal 5 V supply.
float voltsFromZero =
(averageCounts - zeroCounts) * (5.0 / 1023.0);
float currentA =
voltsFromZero / SENSITIVITY_V_PER_A;
Serial.print("Current: ");
Serial.print(currentA, 3);
Serial.println(" A");
delay(500);
}
Expected Result
With no current flowing, the serial output should remain close to 0A, although a small amount of variation is normal. Apply a known low-voltage DC load and the displayed current should change accordingly.
If the current magnitude looks reasonable but its sign is reversed, the current is simply flowing through the ACS712 in the opposite direction to the software convention. Reverse the screw-terminal current-path connections or invert the result in software.
Low-Voltage AC RMS Measurement
The ACS712 can also measure alternating current. For a 50Hz or 60Hz low-voltage AC signal, the following example repeatedly samples the waveform and calculates RMS current over a 200ms measurement window.
Do not use the generic breakout module for direct mains measurements unless the complete module, terminal spacing, PCB construction, enclosure and installation have been independently verified as suitable for that hazardous voltage.
const int SENSOR_PIN = A0;
// Select the value for your ACS712 variant:
// 5A = 0.185 V/A
// 20A = 0.100 V/A
// 30A = 0.066 V/A
const float SENSITIVITY_V_PER_A = 0.185;
const int ZERO_SAMPLES = 1000;
const unsigned long WINDOW_US = 200000UL;
float zeroCounts = 0.0;
void setup() {
Serial.begin(115200);
delay(500);
Serial.println("ACS712 AC RMS measurement");
Serial.println("Keep current at 0 A while calibrating...");
long sum = 0;
for (int i = 0; i < ZERO_SAMPLES; i++) {
sum += analogRead(SENSOR_PIN);
delay(2);
}
zeroCounts = sum / (float)ZERO_SAMPLES;
Serial.print("Zero ADC reading: ");
Serial.println(zeroCounts, 2);
Serial.println("Calibration complete.");
}
void loop() {
unsigned long startTime = micros();
unsigned long sampleCount = 0;
float sumSquares = 0.0;
while ((unsigned long)(micros() - startTime) < WINDOW_US) {
int raw = analogRead(SENSOR_PIN);
float voltsFromZero =
(raw - zeroCounts) * (5.0 / 1023.0);
float currentA =
voltsFromZero / SENSITIVITY_V_PER_A;
sumSquares += currentA * currentA;
sampleCount++;
}
float rmsCurrent = 0.0;
if (sampleCount > 0) {
rmsCurrent = sqrt(sumSquares / sampleCount);
}
Serial.print("RMS current: ");
Serial.print(rmsCurrent, 3);
Serial.println(" A");
delay(300);
}
Expected Result
With no load current, the calculated RMS value will normally be slightly above zero because sensor and ADC noise are also included in the RMS calculation. With a steady 50Hz or 60Hz AC load, the displayed value should settle near the actual RMS current after calibration.
Accuracy, ADC Resolution and Calibration
The ACS712 output is analogue, so measurement quality depends on the sensor variant, ADC resolution, electrical noise, zero-current offset, temperature and calibration.
| Variant | Sensitivity | Approx. Current per UNO ADC Count |
|---|---|---|
| 5A | 185mV/A | 26mA/count |
| 20A | 100mV/A | 49mA/count |
| 30A | 66mV/A | 74mA/count |
These figures use the UNO's nominal 5V, 10-bit ADC. Averaging many readings reduces random variation but does not remove sensor offset, sensitivity tolerance or temperature drift.
Zero-Current Calibration
Measure the OUT voltage or ADC value while exactly 0A is flowing and use that measured value as the zero point rather than assuming it is precisely 2.500V. The example sketches perform this automatically at startup.
Known-Current Calibration
For better absolute accuracy, pass a stable known current through the sensor and compare the ACS712 result with a suitable reference meter. The effective sensitivity can then be calculated from the change in output voltage divided by the reference current.
Effective sensitivity = |loaded output voltage − zero-current voltage| ÷ reference current
Use the resulting value in place of the nominal 0.185, 0.100 or 0.066V/A constant.
The 5A sensor's 185mV/A sensitivity makes it more suitable for relatively small currents than the 20A or 30A versions when all are read by the same ADC. Choose the lowest range that safely covers the expected current.
Troubleshooting
Output stays near 2.5V
- Confirm the load current actually passes through both screw terminals in series.
- Do not connect the load only to VCC, OUT or GND; those pins are the signal side of the sensor.
- Check that the load itself is switched on and drawing current.
- Verify that OUT is connected to the selected analogue input.
Reading is much too high or too low
- Confirm the sensitivity constant matches the 5A, 20A or 30A ACS712 variant.
- Re-run zero-current calibration with absolutely no load current flowing.
- Check the reading against a known current and calibrate the sensitivity if required.
- Confirm the controller's ADC reference and voltage range are appropriate.
Reading is negative
- The ACS712 is bidirectional, so a negative value normally means the current is flowing through the primary conductor in the opposite direction.
- Reverse the two current-path wires if you want that direction to display as positive.
- Alternatively, multiply the software result by -1.
Reading jumps around near zero
- A small amount of sensor and ADC noise is normal.
- Average multiple samples as demonstrated in the DC example.
- Keep analogue wiring short and away from motors, switching regulators and other noisy wiring.
- Recalibrate zero after the module temperature has stabilised when low-current accuracy is important.
- For very small currents, use the 5A version or a higher-resolution measurement system.
Arduino reading is stuck near 0 or 1023
- Check that VCC is connected to 5V and GND to Arduino GND.
- Measure OUT with a multimeter; at zero current it should normally be near half the supply voltage.
- Check for a short circuit or incorrect connection on the OUT pin.
- Confirm the load current is within the selected sensor range.
ESP32 or another 3.3V controller gives incorrect readings
- Do not power the ACS712 IC from 3.3V; its specified supply range is 4.5V to 5.5V.
- Check the maximum permitted voltage of the controller's ADC input.
- Use an appropriate divider, analogue conditioning circuit or external ADC when the ACS712 output can exceed the controller's ADC range.
- Recalculate the conversion for the ADC resolution and scaling actually used.
ACS712 breakout boards are produced by multiple manufacturers and can differ in PCB copper, filtering, terminal blocks and assembly quality. The ±5A, ±20A and ±30A figures are ACS712 sensing ranges and do not by themselves guarantee that an unidentified module can safely carry that current continuously. The isolation ratings of the ACS712 IC also do not certify the complete breakout board for mains or other hazardous-voltage use. Verify the exact module, wiring, current, temperature and voltage requirements before applying power.