PZEM-016 single phase modbus energy meter

Just for the hell of it, I ordered one too. Already have three modbus devices, so figured adding a fourth
should be easy. Itā€™ll be interesting to see how it compares to my WattsOn power transducers.

Even if itā€™s junk, at 12 bucks, itā€™s a throw-away item anyway.

Yeh, I thought the esp8266 might be 120mA or there abouts, Iā€™m sure Iā€™ve read that somewhere here with ref to the emonESP. I doubt I would personally go that route, it was just an example. However, I do now wonder IF there were several slaves daisychained (including the 5v terms) if you would effectively have No of slaves x 100mA on tap for powering the master? Depends how isolated those outputs are I guess?

Not sure what you mean there, by ā€œthe deviceā€ are you referring to the monitor? Thatā€™s limited to 100mA. Or are you refering to a ā€œmasterā€ device with itā€™s own supply? I was suggesting using the esp8266 AS the master and powered via the slave(s).

My point was that if the slave(s) can power a simple master and communicate with the outside world (eg post to emoncms or emonhub) this is a totally self-sufficient monitoring solution, no additional AC adapters required (9v AC or 5v DC), no additional CTā€™s, no sockets to be installed for those plug-in adapters and no additional hardware to plug a USB adapter into or power supply for that device. But, although there may be a cost/space saving due to low component count, it is not something that a casual ā€œDIYerā€ could easily install, because of the lack of plug-in adapters.

That was my thinking, I have no Modbus devices at home, so even if this turns out to be useless as a monitor, I will have something to develop Modbus applications with and test hardware/adapters etc for not a lot of money.

I was thinking of your comment:

I shouldā€™ve said: e.g. a RasPi. Sorry for the ambiguity.

Yep. That part would be nice.

Not necessarily unity. When I put mine into calibration mode, it expects 230V, 2A with a 60Ā° phase shift as recommended by the energy IC manufacturer. Any introduced phase error becomes much easier to spot once the two sine waves are offset from each other.

Just ordered one to test.
I see the module wifi autonomous modded with an esp8266 put inside the box.
If anyone will be developing code for this, iā€™d be interested to test.

Hi Chaveiro, I will try to help a bit. I have a topic which I am going to post a few instructions on as I also want help similar to you and in return I hope someone can help me. :slight_smile: Here is the link: Modbus RTU (RS485) Instructions

Hereā€™s a couple of closeups of the component side and one of the back side of the PCB:

Bill you received it today? It was fast!

From what iā€™m seeing on the pcb, it does have galvanic isolation to the rs484 part.

Hi Nuno,

Surprised me too. I wasnā€™t expecting it for several more days.

It looks like it does have galvanic isolation.

Iā€™ve got it working with a small python script. Wasnā€™t difficult, but then Iā€™ve already got three other Modbus instruments, so it was just a matter of making some changes and she worked like a champ.

Hereā€™s the script:

pzem-016.py.txt (859 Bytes)
APScheduler-2.1.2.tar.gz (40.8 KB)
minimalmodbus.zip (116.3 KB)

Itā€™s very basic. Doesnā€™t do anything but read the registers and print their contents.
As written, it needs minimalmodbus and Advanced Python Scheduler v2.12
You dont have to use APS. I use it to read my other meters every 5 seconds, so I left it in the script.
Any loop construct will work.

1 Like

Iā€™m still waiting for my orderā€¦
Sure, please post your script or a link to github.

So I guess it must be U2 that does all the maths. Can you tell what it is?

I set my camera to 12 MP in the hopes of being able to enlarge the picture to read the characters on the chip, but no joy. The markings are very faint. I had it in full sunlight, but still no help. Bummer.

Ah well, I guess at $12 per unit, thereā€™s not a lot of incentive to reverse engineer it ;-).

PB and I thought the same thing, i.e even if itā€™s junk, at that price itā€™s a throw-away item.
So far, it seems to be fairly accurate. I have a 40 W incandescent lamp as a load with 10 turns wrapped
through the CT window and itā€™s reading 429.1 W, 3.57 A, 120.2 V.

But hey, whatta ya want fer 12 bucks, right? :wink:

So internally consistent at least. Do you have a trusted meter you can compare those numbers with?

I guess I could buy one and stick it on the calibrator to give it a good run for its money, but I doubt my calibratorā€™s V output would have enough ousht to drive its power supply. I needed a separate V input on my monitor for that reason. One V input to power the unit, and 3V inputs to measure. Once installed, you can daisy chain the first off any of the other three but when calibrating, just having the power supply attached to the calibratorā€™s V output distorts the signal (as do many 9VAC wall-warts).

The Fluke 27 DMM I have (calibration unknown) consistently reads 0.4 to 0.5 V higher than the
Modbus meter.

Butā€¦ I do have access to TMDE that gets calibrated anually.
Iā€™ll take it to work with me tonight and check it against a a Fluke 289 true RMS DMM.

Whatever it is, it looks like you flash it via JTAG, note the TDI TMS TCK pins in the bottom left corner. And youā€™d need an isolated programmer since all that sits on the scarey side of the barrier.

I noticed they used an STM32 with an ST-LINK header in one of their products:
https://www.webx.dk/oz2cpu/energy-meter/energy-meter.htm

That too would need an isolated STLINK programmer. Actually, that entire hack project is very dangerous (they do mention it in the fine print). Theyā€™re wiring up external hardware to the live side of the barrier so all of the display hardware is live.

Now, speaking of STM32sā€¦ whatā€™s been happening out there in OEM / STM32 land?

Got one of those too.

Version 13 of your script is the newest thing Iā€™ve seenā€¦

Looks like my 27 isnā€™t too far off. (canā€™t complan too much, it was a freebie)
Compared to a calibrated Fluke 289, the unit reads a consistent 0.3 Volts low.

Mine arrived yesterday,

Itā€™s a ā€œVangoā€ V9881D (link to datasheet http://www.vangotech.com/tw/uploadpic/152783461494.pdf)

the rs485 transceiver is a Maxim MAX485 (link to datasheet https://datasheets.maximintegrated.com/en/ds/MAX1487-MAX491.pdf). The spec of a MAX485 is a ā€œwhole unitā€ so there would only be a maximum of 31 of these (plus a master) in a single rs485 chain (without repeaters).

the isolation is done by a pair of CT Micro CT817Cā€™s (link to datasheet ā”‚CT Micro International Corporationā”‚)

there is also a ā€œS9111 ADAC2ā€ that I didnā€™t find any info on, but itā€™s position and tracks lead me to suspect it might have something do with creating the 5v DC supply.

I havenā€™t hooked up to a load yet, but I did try communicating with just the rs485 and 240v connected and it seems to communicate fine with the ā€œone to oneā€ windows utility in the zip posted earlier in this thread.

The terminal blocks are a tad el cheapo (as expected) but aside from that it seems ā€œokā€ build wise. However IMO the connection map on the underside can be a bit misleading as it is correct whilst looking at the underside, but it needs inverting when looking at the module from the top which is where the terminal screws are (despite the map possibly suggesting otherwise), thatā€™s not an issue when the unit is loose in your hand, but if mounted and youā€™re using an online map or looking at another unit, you could get it wrong.

I am going to try writing a python script a little later (if I donā€™t get otherwise engrossed with something else), Iā€™ll post here what I learn.