

The ACS712 is a Hall effect-based linear current sensor that provides an analog output proportional to the current flowing through it. It is designed to measure both AC and DC currents with high accuracy and electrical isolation. The sensor is widely used in applications such as motor control, power monitoring, overcurrent protection, and energy metering. Its compact design and ease of integration make it a popular choice for current sensing in embedded systems.








The ACS712 is available in different variants based on the current range: 5A, 20A, and 30A. Below are the key technical details:
The ACS712 is typically available in an 8-pin SOIC package. Below is the pin configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | IP+ | Positive current input terminal (connect to the load or current source) |
| 2 | IP- | Negative current input terminal (connect to the return path of the load) |
| 3 | NC | Not connected (leave unconnected or grounded) |
| 4 | GND | Ground (connect to the system ground) |
| 5 | VIOUT | Analog output voltage proportional to the current |
| 6 | NC | Not connected (leave unconnected or grounded) |
| 7 | NC | Not connected (leave unconnected or grounded) |
| 8 | VCC | Supply voltage (4.5V to 5.5V) |
Below is an example of how to interface the ACS712 with an Arduino UNO to measure current:
// Include necessary libraries (if any)
// Define the analog pin connected to the ACS712 VIOUT pin
const int sensorPin = A0;
// Define the sensitivity of the ACS712 (e.g., 185 mV/A for ACS712-05B)
const float sensitivity = 0.185; // Sensitivity in V/A
// Define the zero-current output voltage (2.5V for ACS712)
const float zeroCurrentVoltage = 2.5; // Zero current 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) * 5.0;
// Calculate the current in amps
float current = (voltage - zeroCurrentVoltage) / sensitivity;
// Print the current value to the Serial Monitor
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
delay(1000); // Wait for 1 second before the next reading
}
No Output Signal:
Incorrect Current Readings:
Noisy Output:
Q: Can the ACS712 measure both AC and DC currents?
A: Yes, the ACS712 can measure both AC and DC currents. The output voltage will vary proportionally with the instantaneous current.
Q: What happens if the current exceeds the sensor's range?
A: If the current exceeds the sensor's range, the output voltage will saturate at the supply voltage (5V) or ground (0V), and the readings will no longer be accurate.
Q: How do I handle temperature drift in the ACS712?
A: You can implement software compensation by monitoring the temperature and adjusting the readings based on the sensor's temperature coefficient.
Q: Can I use the ACS712 with a 3.3V microcontroller?
A: Yes, but you will need to ensure that the output voltage from the ACS712 does not exceed the ADC input range of the microcontroller. You may need a voltage divider or level shifter.
This concludes the documentation for the ACS712 current sensor.