Thanks @tve pulling the protocol line low has made this much easier to accommodate the two different voltages.
I've attached a new circuit diagram below.
Both the PZEM and the ESP32 must now share the same common ground connection, otherwise the PZEM will not be able to pull the ESP RX low.
Hi guys,
Thanks for continuing the discussion, and improving the solution!
BTW this week the guys from moddable will try to implement the pzem-004t sensor (see here).
Really looking forward to have a full Node-RED solution...
Can we trust our mains' power meters? - YouTube
Interesting.
New shelly product, but it just arrived too late for @BartButenaers ...
Shelly Pro 3EM is a DIN rail mountable three-phase energy meter. Enhanced with all the gen2 firmware flexibility and LAN connectivity, it provides professional integrators with additional options for end-customer solutions.
The price is pretty exxy though
Craig
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
Bart, not sure if you have your 3 pzems working yet ?
I eventually got some more to test and can confirm they work well wired as per
@smcgann99,
Not not yet, but I am almost getting to it. Wanted to get my pzem-t004 devices running it via node-red-mcu, but had a lot of issues to measure values from my hc-sr04 sensor via Moddable. However meanwhile @phoddie and @ralphwetzel have solved all my issues. So now I first need to find some time install my hc-sr04 distance sensors in my water vessels in the garden, and then I will certainly get back here for my energy monitoring. Step by step, in a very limited free time...
But thanks already for sharing your experiences and diagram !!!!
@BartButenaers – we demoed the pzem-t004 sensor connected to Node-RED MCU Edition at FOSDEM earlier this year. It works nice t(at least for me!). Let me know when you are able to get back to this, so I can dig out the hardware and reconfirm that the pieces are working as expected.
Is that device Modbus? If so which node did you use for that?
Thanks. It is how the 8286 talks to the pzem that I am interested in.
OK, I could dig things out - it has been running for ~4 yrs now.
Had to make a change (add a resistor to drop Voltages (5V-3.3V) - a recognised Mod).
Comms is Serial @ 9600. (TX/RX)
I could dig out the comms spec, which I think I have, but then someone else has already done the leg work.
I tried ChatGPT
Me: What serial protocols does a pzem-004t support?
ChatGPT: The PZEM-004T is a power monitoring module that measures various electrical parameters such as voltage, current, power, and energy consumption of an AC circuit. It communicates these measurements over a serial interface to a host device such as a microcontroller or a computer.
The PZEM-004T uses the Modbus RTU protocol over a TTL-level serial interface (RX/TX pins) to communicate with the host device. Modbus RTU is a widely used serial communication protocol in industrial automation and is supported by many devices and software tools.
The PZEM-004T uses a default baud rate of 9600 bps and supports 8 data bits, 1 stop bit, and no parity. It also supports a configurable Modbus address and can communicate with multiple PZEM-004T modules over a single serial bus using different addresses.
In summary, the PZEM-004T supports the Modbus RTU protocol over a TTL-level serial interface, with a default baud rate of 9600 bps and configurable Modbus address.
I could have told you that
Is that device Modbus? If so which node did you use for that?
@Colin , yes the pzem-t004 is Modbus. It is implemented as an ECMA-419 sensor driver, so In Node-RED MCU Edition it uses the MCU Sensor node, like any other sensor. You just pick the sensor from the list, configure the pins, and go.
At the bottom of the property editor, there's a link to the driver sources. The implementation uses ECMA-419 Serial directly to talk to the Modbus device. I suppose at some point we could build that out further and break that out to an MCU Modbus Node.
That's great. I have a PZEM attached to a Pi Zero, but I have a need for another, so will look at using an ESP device to drive it.
Excellent. I'm going to get my PZEM out of storage now, so I can make sure everything is still working.
No panic, I haven't even ordered it yet