Академический Документы
Профессиональный Документы
Культура Документы
Features
Supply Voltage: 4.5V~5.5V DC
Measure Current Range: -5A~ 5A
Sensitivity: 180mV/A ~190mV/A, Typical: 185mV/A
Usage
Arduino test the crrrent.
1.Hardware connection
600px
Notice:Current sensor can not directly connect on both ends of the power supply.
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");
}
4.Open the serial monitor.You can see the current you test.
Resource
Demo code
ACS712.pdf