int A=0,B=0; float Vin1=0,Vin2=0; float R1 = 10000; // R1 = 10K ohm float R2 = 1000; // R2 = 1K ohm float Rs = 0.500; // Rs = 0.500 ohm float Volt=0,Curr=0,Power=0; float Vcal =-0.34; //voltage celibration float Ical =0.05; //Current celibration void setup() { Serial.begin(9600); } void loop() { //take reding from module// A = analogRead(A0); Vin1 = A * (5.0 / 1023.0); Volt = Vin1*((R1+R2)/R2)+Vcal; //voltage divider equation B = analogRead(A1); //convert to the parameters // Vin2 = B * (5.0 / 1023.0); Curr=((Vin2/Rs)/3 )+Ical; Power=Volt*Curr; //print parameters on serial terminal // Serial.print(" Volt = "); Serial.print(Volt,2); Serial.print(" Curr = "); Serial.print(Curr,2); Serial.print(" Power = "); Serial.print(Power,2); Serial.println(""); }