_05._PZEEM_004T_SERIAL_MONITOR.ino/_05._PZEEM_004T_SERIAL_MONITOR.ino.ino0000755000000000000000000000276014166541465021003 0ustar /* Youtube.com/LeimanGoVlog Tokopedia.com/tridipiproject saweria.co/leimangovlog instagram/tridipi.project github.com/leiman07 leimanilmu.blogspot.com */ //Cara membuat digital KWH meter digital dengan PZEM004T #include #include #include PZEM004Tv30 pzem(D1, D2); void setup() { Serial.begin(115200); } void loop() { float voltage = pzem.voltage(); if(voltage != NAN){ Serial.print("Voltage: "); Serial.print(voltage); Serial.println("V"); } else { Serial.println("Error reading voltage"); } float current = pzem.current(); if(current != NAN){ Serial.print("Current: "); Serial.print(current); Serial.println("A"); } else { Serial.println("Error reading current"); } float power = pzem.power(); if(current != NAN){ Serial.print("Power: "); Serial.print(power); Serial.println("W"); } else { Serial.println("Error reading power"); } float energy = pzem.energy(); if(current != NAN){ Serial.print("Energy: "); Serial.print(energy,3); Serial.println("kWh"); } else { Serial.println("Error reading energy"); } float frequency = pzem.frequency(); if(current != NAN){ Serial.print("Frequency: "); Serial.print(frequency, 1); Serial.println("Hz"); } else { Serial.println("Error reading frequency"); } float pf = pzem.pf(); if(current != NAN){ Serial.print("PF: "); Serial.println(pf); } else { Serial.println("Error reading power factor"); } Serial.println(); delay(2000); } //PROJECT : Program Digital KWH Meter dengan Serial Monitor //DIBUAT : TRIDIPI.PROJECT //TANGGAL : 07/12/2021