The ACS712 20A is a Hall-effect-based current sensor module that can measure AC (Alternating Current) and DC (Direct Current) currents up to ±20A. It is an upgraded version of the ACS712, designed specifically to measure a broader range of currents and is typically used in power monitoring, current sensing, overcurrent protection, and motor control applications.
The ACS712 uses the Hall-effect principle to sense the magnetic field created by the current flowing through the conductor. The current generates a magnetic field that is detected by the Hall sensor. The sensor then outputs a voltage corresponding to the strength of the magnetic field (and hence the amount of current).
To calculate the current from the sensor’s output, you can use the following formula:
Current (A)=Vout−2.50.185\text{Current (A)} = \frac{V_{\text{out}} - 2.5}{0.185}Current (A)=0.185Vout−2.5Where:
int sensorPin = A0; // Pin connected to ACS712 OUT pin int sensorValue = 0; // Variable to store the raw sensor value float voltage = 0.0; // Voltage corresponding to the sensor value float current = 0.0; // Calculated current in amps void setup() { Serial.begin(9600); // Start serial communication } void loop() { sensorValue = analogRead(sensorPin); // Read the analog value from the sensor voltage = (sensorValue / 1023.0) * 5.0; // Convert the sensor value to voltage current = (voltage - 2.5) / 0.185; // Convert the voltage to current (in amps) Serial.print("Current: "); Serial.print(current); // Print the calculated current in amps Serial.println(" A"); delay(500); // Wait for 500ms before reading again }
Origin: China
Brand: Generic