Building your own power meter with the Peacefair PZEM-022

hi there for a while now I was looking for a mains power meter similar to the Hopi meter that you may know from big drives YouTube channel but much less expensive let’s see if the content of this package can do the job okay what you have here is a ring shaped coil actually a current transformer and the module with four screw terminals and wiring instructions on one side and an LCD display on the other and a piece of paper in Chinese but with English instructions as well the instructions are better than expected and include even dimensions for the required cut out to panel mount the module assembly of the data sheet shows that the module is rated for eighty to two hundred and sixty volts ac and up to 100 amps or twenty two kilowatts which is of course an overkill for my purpose but it could be interesting for people with large solar converters but just to be clear this module works only with AC it does Auto ranging on current power and energy read hours the lowest power value is 0.5 watts and the lowest current is 20 milliamps I believe the main difference to the Hopi display is that the power factor only has two decimals but the Hopi uses three and voltage is shown only in footballs because I want to use this to build a Hopi meter placement with its own input and output sockets I bought the version with a closed current transformer coil for less than 11 pounds delivered if you want to measure current and power in existing cables you can get a slightly more expensive variant with a transforming that can be open so you don’t have to disconnect or cut a cable to get it through the transformer ring the module is the PZ II M – zo – – and made by a company called peace fair they do have a website showing their manufacturing areas and certifications and seem to be quite a professional outfit so there is some hope that the unit is reasonably well made accurate and safe the wiring instructions on the back are easy enough to follow Ct is the Conn transformer coil and connects to the upper two terminals the lower ones connect to mains AC as you can see one wire to the load is supposed to go through the current transformer ring to test the device of unknown quality the nice piece fare website not be standing directly with 240 volts mains is a bit of a gamble so I would rather use an isolation transformer in a very AK unfortunately I don’t have a very a canned my AC transformer can only go as high as 24 volts while according to the spec the module needs a Duvall’s so I decided to run two transformers back-to-back the first one is my bench AC power supply set to deliver isolated 6 volts AC which is fed into the second day of a 12 volt transformer so that is primary now delivers sufficiently high voltage to drive the module the 12 volt transformers are the small and can’t deliver much power on the primary certainly not enough to drive a decent test load in form of a 12 volt automotive lightbulb I feed that from the 6 volts instead but of course this means only the current will be accurate since the module assumes that voltage and current comes from the same source and that’s not the case here but this setup is just temporary for the first test while the 6 volt circuit is safe to touch the 100 220 volts AC voltage circuit is not although the high voltage is double isolated and relatively low power you can still get a very nasty electric shock if you try such a setup at home you need to know what you doing and you do so at your own risk the transformer you see is the 12 world one fed on its secondary by other atom black leads from the bench AC transformer the primary are the two yellow wires that go directly into the module the green wires tapped the six volts AC to go to the light bulb one lead going through the coil of course the second red wire you see is going to the bench multimeter to compare the current with the one shown

by the module turning the bench AC transformer on powers the circuit and the module comes alive unfortunately I have no footage from the multimeter but one point four one five amps shown by the module is spot on the clay on the display is from the protective film which I decided to leave on while experimenting as explained the what number is wrong because the module assumes the one point four one five amps have made 100 volts the power factor is 1 because in incandescent lightbulb is a nice assistive load where current and was stay in phase the manual talks about a button and there is this round thing on the right slightly recessed below the level of the ripped bezel with a real hard squeeze it is possible to deform the plastic enough to press it down short presses turn the backlight off on the unit remembers the last setting but without the backlight display is not easy to read so I don’t think I would ever use it without backlight a very uncomfortable long press allows you to change the alert threshold by waiting until the right digit blinks and then incrementing it round robin fashion to a desired value 22 kilowatts is the maximum value I’m going to test the alert later another painful long press brings you out of this through some kind of self-test and back to normal if you keep the pressure after the set clear appears you finally get to a function to clear the sofa accumulated energy the unit remembers the consumed energy during power down and restores it when it comes back to life I think it will use the clear energy function for more than either the backlight or the alerts unfortunately it’s the one requiring the longest press I think this user interface is really only usable with a screwdriver or a similar pointy object to press the button enough of testing let’s get inside 4cos head screws are all it takes to lift the back panel off it looks quite nice and tidy inside the brain is obviously that big chip covered by the green QC sticker and to be able to read any markings that sticker has to go the PCB is kind of sandwiched between the rear panel and the font once the rear panel is removed it can be simply lifted out no other screws holding it in place next to the LCD you see the infamous button it’s a bit tricky to adjust a camera on life justified to read the whiting but the big chip is a v98 one 1a then we have the s9 type of 1 7 1-3 3-1 a voltage regulator probably a capacitor that looks like a typical Y capacitor a current sense resistor a bank of 10 mic of our tantalum capacitors notice the track between the two inside terminals they are connected since one pair of terminals goes to the mains and the other pair to the current transformer coil this means the coil is at mains voltage don’t touch the coil or its wires and make sure it’s not touching anything conductive so back to the chipset it turns out that the v98 one one a is one variant of a family of extremely complex system-on-chip devices developed specifically for the use in electricity meters and its accuracy exceeds these IEC standards lacking the standards I’m taking their word for it but I have no doubt it’s more than good enough for my purpose what we have here is basically a microcontroller that has a built in specialized front-end for energy metering combined with an LCD toeyvah the datasheet spreads to almost 300 pages and it goes into all details which I won’t bore you with but I do want to

show you two diagrams the first one is a block diagram of the v98 family on the Left we have the analog inputs basically for a DC’s and on the far right is the usual microcontroller bus with CPU memory flash storage timers general purpose i/o and so on the interesting bit is this block labeled the vengo metering architecture it takes care of all the tricky signal processing to do power measurements converting to arm as measuring of active and reactive power frequency and so on it is shown in more detail here it’s quite an elaborate implementation and it’s all done independent of the program running in the processor I think this is good news for this power meter because it means all the firmware has to do is read ready calculated values from the hardware registers and display them so there is not much that can go on with a math by the way the three LEDs on the right in this type are used in electricity meters and of course not populated in this module they showed the accumulated energy encoded in form of pulses I think this is to allow the guy from the electricity company to read the meter by just holding an optical sensor to it as for the remaining chips the s9 one one one a implements a very basic switch mode power supply I found an English translation of the Chinese datasheet and the only technical data was 90 volts to 265 AC and fire falls DC out interestingly it seems to work just fine with less than 90 volts the power meter module itself states 80 volts as a minimum and I have managed to run it as low as 50 the five walls are then fed into the seven one three three one regulator which converts them to three points levels for the electronics I never had the opportunity to play with a current transformer and I want to do some experiments before putting the meter together as a start let’s briefly look at what wikipedia has to say about current transformers for one as you can see from the formula the more windings in the coil has the lower the current measured by the ammeter if for example the currents will a thick wire going through the coil was 1 amp and the coil had 100 windings then we measure one hundredth of an amp or 10 milliamps if you use a core with 1000 windings we only get one milliamp quite the opposite of a voltage transformer where you get higher voltages the more windings you use obviously we are supposed to measure the current in the coil and not the voltage that is induced in fact there’s a section here that wants one should not disconnect the burden that is the ammeter or you may get kilowatts and arcing exciting stuff the current in the lead going through the coil to the bulb is about 1.4 amps the beam 2 3 5 in normal a C volt mode shows about 3.8 9 balls in the open coil because of the high 10 Meg ohm input resistance of the beam 2 3 5 almost no current flows and it can be regarded as an open circuit if I select the low pass filter mode for variable frequency drives or VF d the same voltage now beats 16 point 1 volt interesting and in low set mode where the input impedance is reduced the same voltage needs 7.3 balls which are we supposed to believe in this test I have connected my two bench meters the agilent 34450a 150 plus in parallel to the BM 2 3 5 that made the voltage on the beam 2 3 5 go up slightly to 4.25 volts according to both bench meters the voltage is actually 20 point 7 volts where the BM 2 3 5 shows for 0.25 something strange is going on so I disconnected all the meters and connected the scope directly to the open coil no wonder the meters disagreed on the displayed RMS value the voltage consists of just spikes and look at the amplitude each horizontal line on the scope is 100 volts so we have 3 in advance peak to peak I guess Wikipedia was right in warning of high voltage on an open current transformer you can see how the spikes

correspond with a positive and negative half waves and each high voltage spike is then followed by this oscillation of the voltage settling down to 0 to test what the signal looks like when the current transformer is properly loaded I connected a 55 ohm resistor across the tip of the pole and the earth clip now the signal looks much more sinusoidal like what you would expect and the amplitude which is effectively the voltage across the resistor is just a bit above the 100 milli volt peak-to-peak using the BM 2 3 5 and current mode we can read the current to be one point four six milliamps since the currents who the lightbulb is around one point four six dams this looks like the coil has 1000 windings if you remember the formula for current transformers shown earlier to confirm I use this set up the motor is powered by mains and the con transformer is connected to it but it also goes through the beam 2 3 5 to measure the current delivered by the coil into the module as before the test cone in the lead going through the coil and Bob comes from my AC power supply I would like to point out that this circuit looks harmless but because the current transformer is connected to the mains powered module the coil its wires and the beam 2 3 5 and it’s leads are now all at mains voltage level and you can easily get a serious electric shock if you’re not very careful if you use them module in an open environment like this you do so at your own risk the current through the Bob at around 1.4 m/s before has dropped slightly to 1.3 9 amps since the mains voltage is only 230 levels at the moment and my AC power supply is not stabilized the current readout on the module is indeed 1000 times the current through the coil as measured by the beam 2 3 5 okay it’s high time to put this dangerous setup permanently into an enclosure to use it more safely this is the enclosure I picked after considerable search on ebay banggood and other places this one is from asked components and you can get it for 8 pounds 30 delivered it is very sturdy and ip54 rated which is why it comes with this wider of a seal to fit into the goof around the top that I don’t really need I chose these books because I want to add a UK main socket on the lid and that needs space and a sturdy lead construction because inserting you keep plugs requires quite some force so those supports in the middle make this enclosure perfect for this for starting turning holes I did a couple of Triffids the module is slightly wider a narrow part between the two leftmost supports so I need to plan for enough clearance on the left the power socket goes on the right it will fit either way around but I think I will put it in that way for the input I selected a c14 socket also known as a socket for kettle leads for this you need to watch out because many cheap ones are not rated for icons this one has one of the highest current ratings I could find it is marked 250 was 10 amps following vde standards and 250 volts 15 amps following ul take your choice given that UK main sockets are usually certain amps max and I don’t plan to go that high anyway it should be okay if you do lots of high power stuff a better and cheaper alternative is to use a trailing wire and a Yuki mains block for the input but I wanted a clean box that stores away without having cables hanging out of it I used the side view to test for the depth of components and arrangements of the coil and the c14 socket in case you’re wondering the outlets it’s temporarily on an eraser to allow me to positioning it without falling over all the time of course the erase is not going to be part of the build I considered putting the c14 socket on the other side another module but then it gets very close to the school terminals of the module two hours later and the holes are cut filed reasonably smooth and the components mounted I want to mount the con transformer on the

underside of the lid in a gap between the module and the power socket keeping it all on the lid greatly simplifies the cable once I made this little wooden bracket that will be glued on the lid and two plastic cable ties through the holes on either side will secure the current transformer it is important not to use conductive material to avoid causing short-circuit loops all wired up I used one point five millimeter flex rated 16 amps to wire the connection from the C 14 Inlet to the outlet sorbets the pound life wire goes through the current transformer sinner but still main slated wires connect mains to the module and the original wires of the current transformer are just long enough so no ugly extensions are needed for first test are plugged in a fan heater at first only the fan is running which draws 180 milliamps and uses about 33 watts and has a power factor of 0.7 for when I turn on the heater the current jumps to 4.4 m/s and consume power is now 1 kilowatts plus the power of the motor the power factor is now one because the large resistive load turns out the tiny amount of apparent power caused by the motor with a fan heater still plug in it’s a good time to test the alert feature I have set the threshold to 0.3 kilowatts or 300 Watts when only the motor runs consuming 33 watts or so the displays like it was before but when I turn on the heating coil the one kilowatt causes the display to start blinking since the no speaker or beeper blinking is all you get it stops and the power talks below the special the alert feature is always active to avoid being bothered by her lords you need to set it to a really high threshold some more tests he is an energy-saving fluorescent lightbulb rated for 11 watts as you can see it’s pretty much spot-on but its power factor and 0.64 isn’t great this next test case is a LED light bulb normally rated for 8.5 watts it is trying 9.2 watts instead with a pretty terrible power factor this bulb has a built-in dim function if you turn it off and quickly on again it dims to 40% and repeating this again it uses it to 15% it is now running at 3.6 4 watts which is indeed 40% of 9.2 words the camera doesn’t do this justice because the light is indeed much reduced I know it’s down to 1.51 watts the coven has dropped below the measuring threshold so the power factor is shown as one although it’s probably isn’t in reality I was about to finish this video when I thought of a way to test the frequency display and in this setup my function generator is set to 50 Hertz assign driving an amplifier you see on the left the amplifier speaker output feeds the secondary winding of the blue transformer in the middle because the impedance of the transformer is too low the 4 ohm power vs that is in series with the transformer the 2 times 115 volt primary windings are in series and feed the power meter with about 60 volts through the C 14 input and the multimeter which is said to Hertz I can drop the frequency on the function generator as you can see the power module does show the correct value this works all the way down to 29 Hertz but anything blower causes the frequency of the power meter to fluctuate but if you go back up to 29 Hertz or higher it shows again the correct value let’s see how high we can go no problem of course going to 60 Hertz 70 of us 80

Hertz no problem 90s still good okay 99 habits is the maximum display it just stops there even if you go higher after I succeeded in testing the frequency display I wondered if I could verify the power factor true this is much harder in the end I used this setup as before the blue transformer is producing the AC voltage going into the power meter I need to go to almost 100 volts to get enough current to flow which makes this quite dangerous so if you try this you do so at your own risk basically everything in the red dotted box including your scope is at that high voltage the output of the power meter is connected to a capacitor of one microphone in CS with a resistor of 1.5 kilo although I used a 1 watt resistor it is quite overloaded and it gets very hot very quickly which is why I can run this only for a few seconds at a time they are two scopes connected channel one tapping between the resistor and the capacitor and channel 2 on the other side of the capacitor together with a common ground for the scope channel one measures the voltage drop across the resistor which is therefore equivalent to the current flowing in the circuit while channel 2 measures the voltage across the whole circuit you can see this one’s form of providing the isolated high voltage going into the input socket of the power meter the capacitor and resistor circuit is connected to the output and you can see the scope opes and the black lead are used to connect the common scope card on turning the power on the meter shows a current of 30 milliamps 1.45 watts and a power factor of around 0.5 1 the yellow trace of channel 1 is the current and the blue trace of channel 2 the voltage the Purple Line is channel 3 of the scope which isn’t connected but I turned it on as a neat trick to get a very visible sewer line on the display I have automatic phase measurement turned on and on the bottom left you can see the phase difference of around 56 degrees let me turn on statistics to make it a bit more prominent the yellow countries is leading the blue voltage trace by around 56 degrees the current leading the voltage is what you would expect for a capacitive load the cosine of 56 degrees is 0.56 which is the same in the same ballpark but a bit higher than the 0.52 shown on the power meter maybe the automatic measurement is a bit of due to the slightly distorted waveforms of the passing food to transformers so let’s measure it manually using cursors basically we need to measure the time difference where the two curves cause food is your line so I move one vertical cursor to the point where the blue curve crosses and then do the same with the other cursor for the yellow curve the only thing we are interested in is the B X minus a X read out which is three point two eight milliseconds to convert this into a phase shift Angra divide the value by the duration of the full period which is of course 20 milliseconds for 50 Hertz AC and multiply the result is 360 degrees this calculation produces fifty nine point zero four degrees the cosine of 59.0 four degrees is zero point five one which is just what the power meter showed not that I had any doubts that the chip in the power meter would be able to measure the power factor correctly but it’s nice to have it confirmed well and there you have it my poor man’s poppy meter module and enclosure and sockets were about 25 pounds delivered for me it’s certainly good enough and I found experimenting with a Khan transformer measuring the power factor very interesting I leave a list of parts used in the description below if you liked this video give it a thumbs up and feel free to comment thanks for watching