Page 1 of 5
New component: PZEM-004T Power Monitor
Posted: Wed Jul 19, 2023 7:26 pm
by medelec35
There are now a couple of
examples on the Wiki
One is for the ESP32 TTGO, sending the data to the built-in gLCD
The other is for Arduino Uno, using the timer UART to output the data at a baud rate of 19200
The simulation will give 9's and that is expected.
When running on hardware the correct results should be obtained.
Re: New component: PZEM-004T Power Monitor
Posted: Thu Jul 20, 2023 5:59 am
by jgu1
Hi Martin!
Thank you, I just order a couble Yesterday, so very convenient. Look forward to test
Br jorgen

Re: New component: PZEM-004T Power Monitor
Posted: Thu Jul 20, 2023 7:56 am
by medelec35
Hi Jorgen.
You're welcome.
I have just added some notes and a warning on the Wiki.
They are great units.
One application could be to monitor an extension lead and sound an alarm if exceed the rating.
I also use it to monitor mains supplied by my consumer unit.
The energy can be monitored so the price of energy can easily be calculated.
I'm thinking of adding that to the examples.
Can you let me know how you get on, please?
Re: New component: PZEM-004T Power Monitor
Posted: Thu Jul 20, 2023 5:50 pm
by jgu1
Hi Martin!
Concerning Wiki, thank you for info, I will have a look, and look at your examble.
Would be nice with price calculation too.
It seems to be an exciting unit, which is also why I ordered one right away. I ordered on Ebay so it may take a while before I receive the package. The moment I have the module I will test it and you will be the first to hear the result. In the meantime, I start getting ready to
have the program ready with Lcd display and arduino.
By the way, can I use ESP 32 TTGO wihtout have ESP IDF ver 5.0?
So far thank“s
Br Jorgen
Re: New component: PZEM-004T Power Monitor
Posted: Fri Jul 21, 2023 3:59 pm
by BenR
By the way, can I use ESP 32 TTGO wihtout have ESP IDF ver 5.0?
Yes this should work fine in the default IDF v4.1.
Re: New component: PZEM-004T Power Monitor
Posted: Fri Jul 21, 2023 5:49 pm
by medelec35
Hi Jorgen.
You're welcome.
In addiiton to bens reply.
For anyone reading this topic. I can confirm I have tested with both V4.1, 4.2 and 5.0
It works for all three versions.
So whichever version you have, there is no need to switch.
Re: New component: PZEM-004T Power Monitor
Posted: Sat Jul 22, 2023 8:43 am
by jgu1
Hi Ben and Martin!
Thank`s I Will order a ttgo too
In meanwhile I wait for the module I am starting on a testprogram with the PZEM module with a LCD display, later I att. the program and maybe you could have a look at it and check If it is possible what I do or not, so far it work in simulation
Br Jorgen
Re: New component: PZEM-004T Power Monitor
Posted: Sat Jul 22, 2023 9:24 am
by chipfryer27
Hi Jorgen
If you take a look at Flowcode App Developer you will find under free apps a complete working example of using the module. This connects to your PC running FAD via WiFi.
It may give you some pointers, and I can confirm that Martin's component is very easy to use allowing you to customise things to your needs. I'm really tempted by the TTGO too, but having loads of 16x2 displays I can't really justify the need vs cost
Regards
Re: New component: PZEM-004T Power Monitor
Posted: Sat Jul 22, 2023 5:55 pm
by jgu1
Hi Chipfryer!
Well ok I will have a look, thank“for hint. Yes I also have a lot of LCD display, so I understand you, but I already order a TTgo, so look forward to test Martins project.
As mention, while I wait for delevery I have made a testprogram with a LCD display, only test so not all parameter is added, maybe you and /or Martin will take look at my testprogram for see if I am totally "on wrong way"
Br Jorgen
Re: New component: PZEM-004T Power Monitor
Posted: Sat Jul 22, 2023 7:20 pm
by chipfryer27
Hi Jorgen
Your chart is pretty similar to the one I made to test functionality. In it I read every value and displayed, set a threshold, and if threshold was breached I'd reset the Energy. Purely as a test, and it worked fine.
I'm sure you will have similar success.
Regards