mandulaj / PZEM-004T-v30

Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter
MIT License
256 stars 108 forks source link

Check if module is connected #119

Closed pvoncken closed 4 months ago

pvoncken commented 4 months ago

I'm using this library to monitor my solar panels. Works perfect But now i noticed that in case the fuse of that group blows my arduino doesn't update the sensors anymore. I undserstand that this is caused because the PZEM's need 230Volt to work.

It would be be nice if it was possible to check if a PZEM-adress is still connected.

mandulaj commented 4 months ago

You will be getting Errors returned from the Sensor (values are Nan). Perhaps you can just perform a check on that and if you get errors, you raise the alarm?

if(isnan(voltage)){
        Serial.println("Sensor not connected");
}
pvoncken commented 4 months ago

Why didn't I think of that. This works perfect. Thanxs!