5A ACS712 Current Sensor
5A ACS712 Current Sensor
The 5A ACS712 Current Sensor is a highly accurate and reliable Hall effect-based current sensor module designed to measure AC and DC currents up to 5 amperes. This module is based on the Allegro Microsystems ACS712 IC, which provides a high level of precision and stability in current measurement applications.
The 5A ACS712 Current Sensor module is designed to measure the current flowing through a wire or circuit. It works by sensing the magnetic field generated by the current flow and converting it into a proportional analog output voltage. The module can measure both AC and DC currents, making it suitable for a wide range of applications, including power monitoring, motor control, and energy management systems.
4.5V to 5.5V
13mA (typical)
185 mV/A (typical)
1.5% (typical)
50 s (typical)
-20C to 85C
-40C to 125C
19.5 x 15.5 x 4.5 mm
The 5A ACS712 Current Sensor module is suitable for a wide range of applications, including |
Power monitoring and measurement
Motor control and feedback
Energy management systems
Industrial automation
IoT devices and sensor networks
Robotics and autonomous systems
The module has a simple 5-pin interface |
Power supply input (4.5V to 5.5V)
Ground connection
Analog output voltage
IP+ | Positive current input |
IP- | Negative current input |
5A ACS712 Current Sensor Documentation
Overview
The 5A ACS712 Current Sensor is a highly accurate and sensitive Hall effect-based current sensor that measures AC and DC currents up to 5A. It provides a precise and stable output voltage proportional to the input current, making it an ideal choice for industrial, commercial, and IoT applications.
Pinout
The 5A ACS712 Current Sensor has a 5-pin package with the following pinout:
VCC: Power supply pin (5V)
GND: Ground pin
OUT: Analog output pin (0-5V)
VS: Voltage supply pin (optional, for ratiometric applications)
Z: Zero-crossing detection pin (optional)
Technical Specifications
Current measurement range: 5A
Sensitivity: 185 mV/A
Accuracy: 1.5% at 25C
Operating voltage: 4.5V to 5.5V
Operating temperature: -20C to 85C
Code Examples
### Example 1: Basic Current Measurement using Arduino
This example demonstrates how to measure the current flowing through a load using the 5A ACS712 Current Sensor with an Arduino board.
```c
const int currentPin = A0; // Analog input pin connected to the OUT pin of the ACS712
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(currentPin);
float voltage = sensorValue (5.0 / 1023.0);
float current = (voltage - 2.5) / 0.185; // Convert voltage to current using the sensitivity value
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
delay(1000);
}
```
### Example 2: Current Monitoring with Raspberry Pi and Python
This example shows how to monitor the current consumption of a load using the 5A ACS712 Current Sensor with a Raspberry Pi board and Python.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
current_pin = 18 # GPIO pin connected to the OUT pin of the ACS712
def read_current():
adc_value = GPIO.input(current_pin)
voltage = adc_value (5.0 / 1023.0)
current = (voltage - 2.5) / 0.185 # Convert voltage to current using the sensitivity value
return current
while True:
current = read_current()
print("Current: {:.2f} A".format(current))
time.sleep(1)
```
### Example 3: Ratiometric Measurement using ESP32 and MicroPython
This example demonstrates how to perform ratiometric current measurement using the 5A ACS712 Current Sensor with an ESP32 board and MicroPython.
```python
import machine
import time
adc_pin = machine.Pin(32) # ADC pin connected to the OUT pin of the ACS712
vs_pin = machine.Pin(33) # VS pin connected to a voltage reference (e.g., 3.3V)
def read_current():
adc_value = adc_pin.read_u16()
vs_value = vs_pin.read_u16()
voltage = adc_value / vs_value 3.3 # Ratiometric conversion
current = (voltage - 2.5) / 0.185 # Convert voltage to current using the sensitivity value
return current
while True:
current = read_current()
print("Current: {:.2f} A".format(current))
time.sleep(1)
```
These examples illustrate how to use the 5A ACS712 Current Sensor in various contexts, demonstrating its versatility and ease of integration into IoT projects.