

The ACS712 is a Hall effect-based linear current sensor that provides an analog output proportional to the current flowing through it. It is capable of measuring both AC and DC currents, making it a versatile component for a wide range of applications. The sensor offers electrical isolation between the measured current and the output signal, ensuring safety and reliability. Its compact design and high accuracy make it a popular choice for current sensing in embedded systems, motor control, power monitoring, and energy management systems.








The ACS712 is available in different variants based on the current range: 5A, 20A, and 30A. Below are the key technical details:
| Parameter | Value |
|---|---|
| Supply Voltage (Vcc) | 4.5V to 5.5V |
| Current Measurement Range | ±5A, ±20A, ±30A (depending on model) |
| Sensitivity | 185 mV/A (5A), 100 mV/A (20A), 66 mV/A (30A) |
| Output Voltage | Analog, centered at Vcc/2 |
| Response Time | 5 µs |
| Isolation Voltage | 2.1 kV RMS |
| Operating Temperature Range | -40°C to 85°C |
The ACS712 is typically available in an 8-pin SOIC package. Below is the pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | IP+ | Current input terminal (positive side of the current to be measured) |
| 2 | IP- | Current input terminal (negative side of the current to be measured) |
| 3 | NC | Not connected |
| 4 | GND | Ground reference for the sensor |
| 5 | VIOUT | Analog output voltage proportional to the measured current |
| 6 | NC | Not connected |
| 7 | NC | Not connected |
| 8 | VCC | Supply voltage (4.5V to 5.5V) |
Below is an example code to measure current using the ACS712 sensor with an Arduino UNO:
// Define the analog pin connected to the ACS712 output
const int sensorPin = A0;
// Define the sensitivity of the ACS712 (e.g., 185 mV/A for 5A model)
const float sensitivity = 0.185; // Sensitivity in V/A
// Define the supply voltage (Vcc) of the sensor
const float Vcc = 5.0; // Supply voltage in volts
void setup() {
Serial.begin(9600); // Initialize serial communication
}
void loop() {
// Read the analog value from the sensor
int sensorValue = analogRead(sensorPin);
// Convert the analog value to voltage
float voltage = (sensorValue / 1023.0) * Vcc;
// Calculate the current (in amps)
float current = (voltage - (Vcc / 2)) / sensitivity;
// Print the current value to the Serial Monitor
Serial.print("Current: ");
Serial.print(current, 3); // Print current with 3 decimal places
Serial.println(" A");
delay(1000); // Wait for 1 second before the next reading
}
sensitivity with the appropriate value for your ACS712 model (e.g., 0.1 for 20A, 0.066 for 30A).No Output or Incorrect Readings:
High Noise in Output:
Output Voltage Does Not Change:
Q: Can the ACS712 measure both AC and DC currents?
A: Yes, the ACS712 can measure both AC and DC currents. The output voltage varies linearly with the instantaneous current.
Q: How do I determine the current direction?
A: Positive current flows from IP+ to IP-, causing the output voltage to rise above Vcc/2. Negative current flows in the opposite direction, causing the output voltage to drop below Vcc/2.
Q: What is the maximum current the ACS712 can handle?
A: The maximum current depends on the model: ±5A, ±20A, or ±30A. Exceeding this range may damage the sensor.
Q: Can I use the ACS712 with a 3.3V microcontroller?
A: Yes, but ensure the sensor is powered with 5V, and use a voltage divider or level shifter to scale the output voltage to 3.3V for the microcontroller's ADC input.