The ACS712 is a Hall effect-based current sensor capable of measuring both AC and DC currents up to ±30A. It outputs an analog voltage proportional to the current flowing through it, allowing for precise current monitoring. The sensor is compact, easy to use, and widely employed in applications such as power monitoring, motor control, battery management, and overcurrent protection systems.
Below are the key technical details of the ACS712 0-30A current sensor:
Parameter | Value |
---|---|
Supply Voltage (Vcc) | 4.5V to 5.5V |
Measurement Range | ±30A |
Sensitivity | 66mV/A |
Output Voltage Range | 0.5V to 4.5V |
Zero Current Output | ~2.5V |
Response Time | 5 µs |
Bandwidth | 80 kHz |
Operating Temperature | -40°C to +85°C |
The ACS712 module typically has three pins for connection:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (4.5V to 5.5V) |
2 | OUT | Analog voltage output proportional to the current being measured |
3 | GND | Ground connection |
The following code demonstrates how to use the ACS712 with an Arduino UNO to measure current:
// Include necessary libraries (if any)
// Define the analog pin connected to the ACS712 OUT pin
const int sensorPin = A0;
// Define the sensitivity of the ACS712 (66mV/A for 30A version)
const float sensitivity = 0.066; // Sensitivity in V/A
// Define the zero-current output voltage (2.5V for ACS712)
const float zeroCurrentVoltage = 2.5;
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 (5V reference, 10-bit ADC)
float sensorVoltage = sensorValue * (5.0 / 1023.0);
// Calculate the current in Amperes
float current = (sensorVoltage - 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 or Incorrect Readings:
High Noise in Output:
Output Voltage Stuck at 2.5V:
Overheating of the Sensor:
Q1: Can the ACS712 measure both AC and DC currents?
Yes, the ACS712 can measure both AC and DC currents. The output voltage will vary proportionally with the instantaneous current.
Q2: How do I calculate the current from the sensor's output voltage?
Use the formula:Current (A) = (Output Voltage - Zero Current Voltage) / Sensitivity
For the 30A version, the sensitivity is 66mV/A, and the zero-current voltage is approximately 2.5V.
Q3: Can I use the ACS712 with a 3.3V microcontroller?
Yes, but ensure the sensor is powered with 5V, and use a voltage divider or level shifter to scale the output voltage to the 3.3V range.
Q4: What is the maximum current the ACS712 can handle?
The ACS712 30A version can measure currents up to ±30A. Exceeding this limit may damage the sensor.
By following this documentation, you can effectively integrate the ACS712 current sensor into your projects for accurate current measurement and monitoring.