Skip to content

Commit

Permalink
Update MultipleCurrentSensorMeasurement.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
viknesh2798 authored Apr 14, 2020
1 parent e840160 commit 5280ed2
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ACS712 sensor2(ACS712_30A, A1);
void setup() {
Serial.begin(9600);

// This method calibrates zero point of each sensor,
// This method calibrates zero point of each sensor,
// It is not necessary, but may positively affect the accuracy
// Ensure that no current flows through the sensor at this moment
sensor1.calibrate();
Expand All @@ -17,11 +17,13 @@ void setup() {

void loop() {

// To measure current we need to know the frequency of current
// To measure current we need to know the frequency of current.
// By default 50Hz is used, but you can specify own, if necessary
float i1 = sensor1.getCurrentAC();
float i2 = sensor2.getCurrentAC();


// The current through each current sensor is printed
// every 1 sec in the Serial monitor
Serial.println(String("I1 = ") + i1 + " A" + "\tI2 = " + i2 + " A");
delay(1000);
delay(1000);
}

0 comments on commit 5280ed2

Please sign in to comment.