Author Topic: Using a modified Peacefair PZEM-004T module as cheap mains data-logger  (Read 3072 times)

0 Members and 1 Guest are viewing this topic.

Offline theHWcaveTopic starter

  • Regular Contributor
  • *
  • Posts: 161
  • Country: gb
The Peacefair PZEM-004T (about 12 US$)  module measures AC mains voltage, current, active power, frequency, energy and power factor. It has a serial interface (TTL level, 9600bps,8 data bits,1 stop) using a Modbus like protocol. There is no display itself. The module is powered from mains (80V onward) and can be bought with either a current shunt for up to 10A current range, or a current transformer for up to 100A. I got the version with the current transformer.   The module is often used for energy monitoring projects but I wanted to use it for general measuring and data logging of AC (mains)-powered devices, and I wanted it to measure from 0 volts onward. The modification is fairly easy to do and I went a bit further and changed the way the module is powered by using an isolated (!) DC-2-DC converter to get the operating power directly from the serial interface. I must stress that an isolated DC-2-DC converter is needed here because the measurement circuit based on the VANGO V9881D is directly connected to mains.

I build a little box that contains the module, the current transformer and a switch that runs the to-be-measured current either straight through the current transformer (x1 mode) or through 10 turns (x10 mode). The x10 mode boosts the reading accuracy for low currents but when in use,  you need to divide the measured current (and power) by 10 to get the correct values.  Basically you get one extra digit of resolution that way. Of course in x10 mode, the maximum current is now only 10A not 100A.

The accuracy of my modified module was:

  • voltage: 0.5%
  • current: 1.2%  in x10 mode,  1.5% in x1 mode (it improves slightly with more current)
  • frequency: 0.1% (45 to 65 Hz, but it measures > 1kHz with less accuracy)
  • power factor:  hard to quantify but in general close to other methods I used to compare it with (other power meters, and oscilloscope)
My software samples the data every 0.5 seconds, displays it and saves it in a spreadsheet

My reverse-engineered schematics of the original module are attached as well as the schematics of the modification. I wrote a little Python program (runs under Linux and Windows) to display and record the values in a CSV file for spreadsheet analysis and plotting. You can download it free here:
https://github.com/TheHWcave/Peacefair-PZEM-004T-


Details of the tear-down, the modification and accuracy tests are also in these YouTube videos:
https://youtu.be/qRsjsenvlJA
https://youtu.be/j0_y8dPfpKc
 
The following users thanked this post: intabits, GnomeZA, TheFire8472


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf