Master Piece
Master Piece
int mVperAmp = 78; // use 100 for 20A Module and 66 for 30A Module
double Voltage = 0;
double VRMS = 0;
double AmpsRMS = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
int sensorValue = analogRead(A1);
float volt = sensorValue * (245.0 / 1024.0);
Voltage = getVPP();
VRMS = (Voltage/2.0) *0.707; //root 2 is 0.707
AmpsRMS = (VRMS * 1000)/mVperAmp;
delay(2500);
}
float getVPP()
{
float result;
int readValue; //value read from the sensor
int maxValue = 0; // store max value here
int minValue = 1023; // store min value here
return result;
}