How accurate is the Peacefair PZEM-004T AC Comms Module?

Поділитися
Вставка
  • Опубліковано 4 жов 2024
  • This is kind of a continuation of the previous video on modifying the PZEM-004T module, providing the promised information on accuracy and some usage hints for the software.
    00:15 Voltage accuracy
    03:29 Current accuracy
    07:08 Frequency accuracy
    07:50 Power factor comparison with DL69-2048
    08:11 Power factor using phase shift
    16:12 Summary on power factor
    17:40 Using the software
    21:58 Using the PZEM-004T
    My previous video on modifying the PZEM-004T: • Modifying the Peacefai...
    The schematics and software is here: github.com/The...
    The other panel meter (a DL69-2048): • Modifying (and repairi...
    Building the power resistors: • Home Lab Equipment: Ma...
    You can support the channel by becoming a patron. www.patreon.co...
    As a patron you get early access to all my videos as well as exclusive content.
  • Наука та технологія

КОМЕНТАРІ • 35

  • @samuelwozinski2585
    @samuelwozinski2585 3 роки тому +1

    Thankyou so much for posting this! I was considering using the pzem-004t for a personal project to measure small changes in current, and I had my doubts about the accuracies listed in the spec sheet. This has been super helpful.

  • @googoostoned
    @googoostoned 4 місяці тому +1

    Ein gutes Video. Vielen Dank.

  • @Jack82836
    @Jack82836 2 роки тому

    Very interesting. Thank you. Double thanks for the subtitles!!!

  • @useris0987650
    @useris0987650 Рік тому +1

    Maybe accuracy differences are caused by different current density? 10 turns will have 10 times smaller current density. It definitely improves transformer efficiency, maybe somehow impact output current current too, can't find anything. You could try repeat the accuracy test with single loop of ten wires. Also, if seeking accuracy, comparison with 10A shunt version would be interesting, that should be more accurate in general.

  • @laverdadapesta100pre
    @laverdadapesta100pre 4 місяці тому

    Hello, thanks for that great video, I would just like to ask you if it is possible to access the data of the function you measured.

    • @TheHWcave
      @TheHWcave  4 місяці тому

      Sorry, I did not keep the data.

  • @isabido
    @isabido 2 роки тому

    Fantastic precision exam and very good documentation of the entire procedure, I learned many ideas and concepts from it.
    I still have doubts as to how the PZEM-004T calculates the PF value, if not by controlling the phase angle. Could you give me a better explanation? I am trying to solve some problems in a Shelly EM that is not able to measure a reactive load of two ducted air conditioning machines, which in standby has a P=20W V=235 CosPhi=0.1 I=1A (it is the reading that the digital meter from my electric company returns me), the shelly EM indicates P= -5W V=236 PF= -0.02
    Thanks again for the shared knowledge! You already have a new subscriber.

    • @TheHWcave
      @TheHWcave  2 роки тому +1

      You are correct in suspecting that the PF shown by the PZEM-004T is not very accurate for very small PF values. The reason is hard to explain in a UA-cam comment, but I try. Please check the V9881D datasheet. In chapter 10 it explains its inner workings very detailed. The signal processing part of the chip measures active (P) and reactive (Q) power but it does not measure or calculate PF. This is done in the firmware. PF can be calculated using pf = cos(arctan(Q/P)). So, how does it measure P and Q? There is a lot going on in the signal processing part of the chip but in essence the trick is that for active power P, it multiplies volts and currents while for reactive power Q, it first phase-shifts the current by 90 degrees before multiplying. If you consider the 2 extreme cases: first current and volts are in phase. The multiplication produces a (power) wave form that is always positive and the RMS average of that is active power. At the same time the Q calculation takes the same current and voltage and does the same multiplication but first phase shifts the current by 90 degrees. The result is a power wave that is always symmetrical around 0 (same amounts are positive and negative) so the average Q is simply zero. Plugged into the formula you get a PF = 1. If the current is phase shifted by nearly 90 degrees already, the then active power would be mostly symmetrical around zero with a tiny non-zero rest, and Q will now be a large negative average. This gives a large negative value of P/Q and an arctan of -89.9999 deg and cos(89.9999) is a PF of nearly zero. Obviously this method has increasing accuracy problems (because of arctan) the lower the PF gets but the P and Q values themselves are still very accurate. The problem in calculating very small PFs might well explain the discrepancies you see because both meters indicate show very small PFs.

    • @isabido
      @isabido 2 роки тому +1

      @@TheHWcave Infinite thanks for taking your time to give me this splendid summary explanation. I had been checking the datasheet of this v9881d and also of the ADE7953 (www.analog.com/media/en/technical-documentation/data-sheets/ADE7953.pdf, they seem very similar. they apply an HPF before the multiplication (this is where I understand according to your explanation that it is where the 90º phase shift occurs due to the high pass filter?) and then an LPF to eliminate harmonics.
      What I don't understand is why it does for PF=cos(arctan(Q/P)) instead of something simpler like PF=P/S. If S = V x I and the P extracts it with the displacement trick.
      Also at the beginning of your explanation you say that P=V x I, wouldn't this be S?
      Excuse me if I'm talking nonsense, I'm starting to understand this fabulous world of AC! Thanks again for your effort to make me understand.

    • @TheHWcave
      @TheHWcave  2 роки тому +1

      @@isabido Yes AC is complicated especially if it is no longer sinusoidal.. Anyway, no the 90 deg. shift is done only for the current channel and after the HPF and LPF which are used for both. Also there is a phase compensation (delay) circuit but that gets really into details. These chips were made to meet the standards for electricity (smart) meters so they are doing a lot of wonderful signal processing to get the best accuracy for P and Q. Note that apparent power S is not V x I. S is a vector (as are P and Q) and the magnitude of S is the vector sum of P and Q, in other words S = SQRT(P^2 + Q^2) (Pythagoras)

    • @isabido
      @isabido 2 роки тому

      @@TheHWcave I knew of the formula S = SQRT(P^2 + Q^2) , but this would also be valid, right? S= Vrms x Irms. Thanks!

    • @TheHWcave
      @TheHWcave  2 роки тому +1

      ​@@isabido Yes that is correct

  • @BjornV78
    @BjornV78 3 роки тому +1

    6:11 I guess that the current transformer is not optimized for low currents, but more for high current 10A and more.
    1A or 1.4A is still 1 to 1,4% of the range this current transformer use.
    At the moment, i'm building a isolation transformer with buildin "dim bulb current limiter" with 4 halogen G9 bulbs to make it very compact.
    At the output, i'm gonna use a selfmade "electronic circuit breaker" where the trippoint can be set from 1mA to 3A.
    For measuring the current, i use the same current transformer as yours, that came with one of the Peacefair meters that i have,
    and i discovered that the accuracy to set this trippoint is much better when i use 4 to 5 turns on the primairy side of this current transformer.
    My i ask, what type of amplifier you used for amplifying the output of the signal generator ?
    Is it a "simple" audio amplifier or so ?

    • @TheHWcave
      @TheHWcave  3 роки тому +1

      Its a 100W mono audio amp board using a TPA3116D2 chip from Ebay. It is actually surprisingly good for the price. It needs a fairly beefy power supply if you draw a lot of current on the output or it will start distorting the wave form. Otherwise it is very efficient (class D). It is linear from 60Hz to 2kHz, The 3db points are at

    • @BjornV78
      @BjornV78 3 роки тому

      @@TheHWcave thx for the reply. I have a JOY-iT JDS6600 60Mhz signal generator, and that one has also a very low current output, but now i have a idea to amplify it.
      A have one more tip, you mentioned that it can be dangerous to switch between x10 and x1 , for a workarround, you can use the multiple turns as fixed primary, and switch the burden resistor between x10 and x1.
      For the x1 position, you can use a fixed burden resistor value, and for the x10, you can use the switch to parallel a lower resistor value.
      That way you only switch the secundairy side of the current transformer, that carry a low current, and also the x10 and x1 use the same amount of primary windings and the accuracy will become better for the x1 position. Grtz

    • @TheHWcave
      @TheHWcave  3 роки тому +1

      @@BjornV78 A good idea and and I actually did something like that before ua-cam.com/video/Lf5nhBLmJ-c/v-deo.html . but in this case there are some problems. Firstly the x10 resistor needs to be 10x higher not lower. Since a current transformer must never be operated without load, you need to wire the x10 mode resistor hard in (0.5 Ohm in this case) and use the switch to add the lower resistor (a 0.05555 ohm resistor in this case) in parallel. Tricky to find / make such a value (e.g. from resistance wire) and then the unpredictable contact resistance of the switch is already in the same region. A better way is to use a make-before-break switch with a 0.5 Ohm (x10) and the stock 0.05 Ohm (x1) resistor. The switch contact resistance may still spoil it, but this may work. Unfortunately the chip is calibrated for the 0.05 ohm resistor and the filter network, so you can't just use higher resistor values. Without these constraints, your idea is definitely valid.

  • @MassimoFantinato
    @MassimoFantinato Рік тому

    Thank you very much for this useful video.
    Just one question, regarding ups. Is this module a viable solution when they are included? A lot of switching UPS generate a lot of noise and have some current dispersion.
    Is this module still a viable solution? If not, do you know any other cheap solution for power measurements for ups?
    Thank you.

    • @TheHWcave
      @TheHWcave  Рік тому

      I am not sure I understand the question. If you are concerned if the module can measure power draw from noisy devices, like SMPS, the answer is yes. I have never seen any issues

  • @neail5466
    @neail5466 3 роки тому

    Man, you are rocking. ❤️+1
    I remember you have shown that the accuracy range is unreliable under 200mA, is that the cause ?
    Use a pi4 as laptop. It would be better for Ubuntu, you can also use multi os / boot even with ssd, but make sure to have a ups connected.

    • @TheHWcave
      @TheHWcave  3 роки тому

      Not sure why it isn't as accurate as expected at

  • @bjornroesbeke
    @bjornroesbeke 3 роки тому

    With my device, 3 out of 4 requests go unanswered and the software (any software, not just your python script) complains about the timeout.
    When it does respond, it seems to be as accurate as you've shown. I'm happy to have this cheap monitoring device.
    Were you able to reprogram its address by any chance? I can't even read those registers.

    • @TheHWcave
      @TheHWcave  3 роки тому

      How strange. Mine works like clockwork. I had another viewer asking me about the update rate and I ran a test polling the module as fast as possible using only the AC_COMBOX.py command line interface with --time 0 parameter. This managed about 10 polls per second but we found that the firmware only sends new data about every 1.2 to 1.5 seconds (i.e. you get 10-15 times the same data packet if you poll 10 times /s). Normally I don't see timeouts or any other issue and I think that other viewer also did not see timeouts on his module.
      No I never attempted to change the slave address
      Could you try running just AC_COMBOX.py ? Try other USB ports, maybe USB2.0 instead USB3.x . Another possibility is interference. I do get a timeout or even sometimes a reset of the module if I use the x1/x10 hardware switch under load. In my built the current transformer with the x10 coil is right next to the module and can apparently cause some issues when the switch is moved. This should not be the case with a x1 and a single wire going through the core. In general it could be that your environment/mains is very noisy causing interference on the USB cable? If you are using the original PZEM-004T with the capacitor-dropper power supply there must be enough mains voltage to power the board and the opto-couplers (more than 60V-70V if I remember). Last tip, if you poll for example every second, you should be able to see the RX LED on the module light up periodically. If the message decodes correctly (checksum...) the TX LED should light at the same rate. If the RX doesn't light regularly at the poll rate, messages from the PC don't get to the module. If it does light regularly but the TX LED doesn't or not at the same rate, then the PC message contained errors and the microcontroller could not understand it. If they both light regularly then there is a problem in the PC

  • @pepethefrog7193
    @pepethefrog7193 3 роки тому

    Great content. Kudos!
    I need to measure the power direction. Negative amps or negative powerfactor. I use to prevent grid-tie solar power feeding into the grid (and paying for it). Unluckily this seems not possible with this meter and there is no hack as there was with the older variant of this meter. Any idea?

    • @TheHWcave
      @TheHWcave  3 роки тому

      No, unfortunately not. It does not care about which way you orientate the current transformer. You would need something that is made for solar installations, I suspect the majority of power/energy meters do not support direction.

    • @irfansensoy5901
      @irfansensoy5901 8 місяців тому

      The same situation applies to me. Have you found a method to measure energy to prevent energy going back to the grid?

    • @pepethefrog7193
      @pepethefrog7193 8 місяців тому

      @@irfansensoy5901 shelly 3EM

  • @audiodiy154
    @audiodiy154 2 роки тому

    HI , WHAT IS THE MINIMUM RESPONSE TIME FOR THE MODULE TO DETECT VARIATION IN VOLTAGE, FREQUENCY, A, WH? ETC

    • @TheHWcave
      @TheHWcave  2 роки тому

      From the datasheet the V9881D seems to collect and process data at speeds of several tens of kilohertz to do all kinds of signal processing and zero-crossing detection and parameters such as volts, current and power are internally available at least every 10ms or even more often. However, the firmware doing the serial connection over USB and sending the data using the MODBUS protocol with checksum etc is much slower and sends updates only about every 1 to 1.5 seconds. That means a fast change may be registered but you may not learn about it until up to 1.5s later. Worse, if a spike comes and goes within the 1.5s window, you may not get any information about that event.

  • @DEMOxSPL
    @DEMOxSPL Рік тому

    Hey, is it possible to measure 15-100hz ac voltage with this and read kind of accurate readings?

    • @TheHWcave
      @TheHWcave  Рік тому

      Sadly no. The module datasheet says 45 to 65Hz.. The chip datasheet itself says 35 to 75Hz and I measured that on my unit, 30 to around 400Hz is usable, but that may be an exception.

    • @DEMOxSPL
      @DEMOxSPL Рік тому

      @@TheHWcave So from your tests anything under 30hz is unaccurate? Do you have an idea how get accurate measurements 15-100hz? With different circuit or ic? Thanks

    • @TheHWcave
      @TheHWcave  Рік тому

      @@DEMOxSPL I am not entirely sure what you are trying to measure. I am guessing AC voltage at 15-100Hz like for a VFD (Variable Frequency Drive)? The problem is the low frequency. Most meters do not go below 45 or 40Hz. From my own collection, the only 2 handheld meters that would work are the Brymen BM235 and BM869s because they have a VFD mode that goes from 10Hz. Bench meters go even lower. The Agilent 34401A goes down to 3Hz . The OWON XDM 1041 goes down to 20Hz. These are just meters I have. There are many more out there...

    • @DEMOxSPL
      @DEMOxSPL Рік тому

      @@TheHWcave I want to measure power output from car audio amplifier (sub level range) I want to make my own circuit.

    • @TheHWcave
      @TheHWcave  Рік тому

      @@DEMOxSPL Ok, that's different then. Its an interesting project. If you have a reasonably smart scope, one way to do this would be to attach a resistor R as dummy load as speaker and use the scope to measure the voltage V over R and perform the math operation (V*V)/R on the signal which gives you a power graph