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

How do I reset the energy meter values? #94

Closed loyolaphysics closed 3 months ago

loyolaphysics commented 1 year ago

I want the energy meter to reset every time it is turned off, How do I do that?

mandulaj commented 1 year ago

It depends on your setup. There is no way to do this automatically. I guess you could reset the module during the initialization on boot. This assumes your MCU turns on and off simultaneously with the PZEM module. If your MCU stays on constantly, you could detect the PZEM as off when the communication fails and then next time the communication succeeds send a reset command. However, I wouldn't recommend this as there is a chance that you get false positives. Otherwise, there isn't a way to detect when the module turns on/off alone..

mandulaj commented 1 year ago

Has your issue been resolved? If so please kindly close this issue. Thanks :)