Home / Wiki / Sensor / Electric
ACS712 current sensor

Introduction

This is ACS712 current sensor module, it can detect the AC(analog current) and DC(digital current), there is a sensor named ACS712 used in the ACS712 sensor module, the sensor can detect the current range from -5A to 5A and the output voltage is 185mV/A, when three’s no current have be detect, the output voltage is half of the VCC. when detect the current by Arduino, we use the analog I/O port. The principle of it is based on the hall-effect, so, remember that avoid to measure the current in the magnetic file.   

 

Features

Supply Voltage: 4.5 to 5.5V DC

Measure Current Range: -5A to 5A

Sensitivity: 180mV/A to 190mV/A,

Typical: 185mV/A


Usage

void setup() {

  Serial.begin(9600);

}

 

void loop() {

 float average = 0;

 for(int i = 0; i < 1000; i++) {

     average = average + (.0264 * analogRead(A0) -13.51);//for the 5A mode,  

//   average = average + (.049 * analogRead(A0) -25);// for 20A mode

// average = average + (.742 * analogRead(A0) -37.8);// for 30A mode

   delay(1);

 }

 Serial.print("Current :");

 Serial.print(average/1000);

 Serial.println("A");

}


Resource 

Program

Schematic

Datesheet


Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0