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:

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.