logo elektroda
logo elektroda
X
logo elektroda

Analyzer - meter of 230VAC network parameters - single phase.

futek2 15597 129
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Analyzer - meter of 230VAC network parameters - single phase.

    Welcome to those interested in the topic of building a simple analyzer - meter of 230V network parameters - one phase.
    The meter is based on ESP32 module according to the schematic diagram, which is attached, and the whole circuit is not complicated.

    To build the meter you will need the following parts:
    1 - ESP32 DEVKIT V1 module with 4 MB memory, as shown in the attached image;
    2 - current measurement sensor - current transformer for 100A range with 1V output or for 25A range with 1V output type SCT013, as shown in the attached image;
    3 - sensor for voltage measurement - voltage transformer type TV16, as in the attached image;
    4 - 5k precision potentiometer - 2 pieces, as in the attached image;
    5 - power supply 230VAC / 5V 0.7A or charger with mini USB plug to power the ESP32 module, as in the diagram;
    6 - universal mounting board;
    7 - resistors and capacitors as in the diagram;
    8 - wires and test leads as in the picture of the whole meter.


    Important thing is when buying a
    current transformer, please choose the type that has an output of 1V



    I bought all the components on a well-known auction site, and the total cost did not exceed the amount of PLN 150.
    Enclosed are two versions of the software to upload to the ESP32. The difference is that one is for a maximum range of 25A, and the other is for 100A, depending on which current transformer you buy.

    The meter measures and displays the offset of sine waveforms of voltage and current relative to each other. It calculates COS fi, and if an inductive factor is detected, it calculates the capacitance of a capacitor to compensate for it.
    Additionally, there is a choice of calculating the THD factor from voltage or current measurements, along with graphs showing harmonic levels - max 9.

    Results and graphs are displayed on the screen of a phone, tablet or laptop.
    Connect to the meter over Wi-Fi, and the meter has an IP address of 192.168.10.1 - image attached.
    The software can be tested as soon as it is uploaded to the ESP32 module without the need to build the entire meter.
    Inclosed are images of the following screens and the appearance of the meter.

    I don't describe too much, because the design is simple, with which even a beginner in electronics can cope.
    All the calculations are contained in the software, with which I was not easy, especially with the counting and measurement of harmonics - I wanted to make it clear and give accurate results.
    The screens with the results are refreshed every 5 seconds, and the graphs are plotted using the vector graphics function - SVG.

    After building the meter, calibration is done with precision potentiometers.
    I calibrated using 2 kettles of 2000Watts each and a digital meter, which is sufficient to set the voltage and current range according to the readings on the meter.
    After calibrating, you should mark yourself the voltage end that will be connected to the neutral wire and the other end that will be connected to the phase wire.

    After attaching the current sensor to the phase wire, you should put it so that it is in front of the connected voltage wire on the phase.
    Connect the meter to the 230VAC network in the sketch drawing, which is attached.
    And when you are sure that the measurement of COS fi is correct, you need to mark yourself with a marker the direction of fastening the current sensor to the wire.
    I determined this by turning off all loads electricity, and leaving the desktop computer and the meter should show capacitive power factor, if inductive then I will swap the direction of the sensor clasp.
    For certainty, you can do some tests on other devices, such as a motor and should show inductive power factor, During calibration using kettles, the power factor should be near 1.

    As a housing for the meter, I used a laptop power supply case.

    In the meter it is possible to update the soft without removing the ESP32 module, you can upload new soft over WIFI using a browser from the address 192.168.10.1/new as the login window appears to us, then user admin password admin , and then select the correct bin file and wait for a message about successful upload of the software.

    I was inspired to do the design and build the meter and write the program code by this article from a couple of years ago - link below:
    https://majsterkowo.pl/rejestrator-napiecia-pradu-mocy/


    Please give me any comments and suggestions for improvement or changes.


    Greetings and I wish you satisfaction with the use of the analyzer - single phase 230 V network parameters meter.

    Finally, I suggest calibrating the current measurement to use 75% of the range I for 25A used two electric czjniki 2000Watts each because the measurements will be more reliable.


    I think that many colleagues will see what is happening in our home electrical networks, which will contribute to reducing expenses for electricity.

    Update-software 28.10.2022
    For both versions, a divider has been added - horizontal lines for THD graphs.
    Increased number of decimal places for voltage and current.


    Update-software 07.11.2022
    Added configuration window to be able to connect to a home router and send data to the server.
    Link below
    https://www.elektroda.pl/rtvforum/topic3929533-30.html#20261095


    Update-software 24.11.2022


    Description and programs for uploading software to ESP32.
    https://www.elektroda.pl/rtvforum/topic3929533-60.html#20300780

    Update - soft 10.01.2024


    Description and programs for uploading soft to ESP32.
    https://www.elektroda.pl/rtvforum/topic3929533-90.html#20878394


    Greetings
    Futek2

    Cool? Ranking DIY
    About Author
    futek2
    Level 19  
    Offline 
    futek2 wrote 519 posts with rating 224, helped 2 times. Live in city Częstochowa. Been with us since 2006 year.
  • ADVERTISEMENT
  • #2 20255953
    gulson
    System Administrator
    Great, once I bought a few pieces of it, I didn't know that you can do such wonders with it. By the way, contact me on PM for a small gift for the article ;)
  • #3 20255981
    simw
    Level 27  
    Great mini project - though maybe not that mini :)
    I don't see anything about kilowatt hours in the pictures. It seems that everything is already done to additionally make an energy meter.
  • #4 20256005
    futek2
    Level 19  
    Hello Col. simw .
    Thank you for the hint when I find some free time to add another version with energy counting in kWh. It is easy at this stage because all measurements are already made by the meter.
    I encourage you to test it on the sofa itself without mounting. and this will then encourage you to build the whole meter.
    I have an interesting observation from the measurements of various devices, mainly desktop computers, because they emit a lot of harmonics, but I also have interesting observations on LED bulbs and the operation of an automatic washing machine, especially when it spins.

    Regards.
    Futek2
  • #5 20256260
    jarekgol
    Level 39  
    futek2 wrote:
    I also have interesting observations on LED bulbs and the operation of an automatic washing machine, especially when it spins.
    triac controller?
  • ADVERTISEMENT
  • #6 20256299
    Shadowix
    Level 31  
    How is the quality of these measurements?
    Have you compared them with a decent meter/meter?
    The webserver is on ESP or is it sent to some MQTT database?
  • #7 20256346
    ^ToM^
    Level 42  
    A very practical device! Congratulations on your ingenuity.

    I think maybe we could add a grid and scale to the graphs. It's best to be able to turn it on and off. It is then easier to compare waveform sizes.
  • #8 20256366
    snow
    Level 31  
    In the diagram with ESP, I would change the description with the 5VDC power supply on the output not +5V and -5V, but +5V and GND. Or some other way. This power supply does not output -5V.
  • ADVERTISEMENT
  • #9 20256375
    futek2
    Level 19  
    Hello.
    I answer in turn.
    I had the opportunity to compare the meter with the measurements of the company meter PQM-707 by Sonel.
    The differences in the indications were at the level of about 1.5%, but it depends on the accuracy of the calibration.
    The THD calculation is also within these limits.
    And as for graphs and sending measurement data to the server, e.g
    https://thingspeak.com there is such a version in preparation, but it will require individual configuration of logging in to the home router and server data to which the measurement results will be sent.
    And as for the mesh, it's not difficult to add, but I didn't want to send too much data to the website, which could slow down refreshes. But I am collecting all comments and when the next version is created, I will take into account the suggestions of my colleagues.

    According to the remarks of snow I will correct the schematic.

    I am asking for comments related to the calibration because in the program code I made a certain reserve for possibly different parameters of the purchased transformers so that they fit in the adjustment range of precise potentiometers.

    The meter has already proven itself when setting the regulator parameters in the transmitting inductive reactive power compensator.

    Regards.

    Futek2
  • #10 20256619
    __Maciek__
    Level 20  
    Congratulations !
    I wonder if the introduction and measurement of the artificial zero voltage (3.3V/2) makes sense? From openenergymonitor sources, they use a low-pass filter to determine this artificial zero.

    In addition, I believe that the dynamics of the input signals is large enough to successfully use constant input elements and software calibration. (There is no question of different batches for different ranges.) PS. the shunt for the current transformer is usually small 5K is a lot and can lead to increased errors in the upper measurement range.

    Plus for the use of a voltage transformer. (I did without it, but I'm not happy with it in terms of potential risks.) Analyzer - meter of 230VAC network parameters - single phase.

    An important element is the comparison with reference indications. (At first I wanted to calibrate my measurement with a hair dryer - but I had terrible non-linearities - it turned out that the load characteristics it was doing were very different from sine - and comparisons to non-RMS meters were useless.)
  • #11 20256717
    futek2
    Level 19  
    Hello Col. __Matt__ .
    Choosing this option with a reference voltage of 3.3V /2, I was guided by the parameters of the ADC converters in ESP32. Their parameters are not in the full range linear beginning and end are slightly flattened.
    In the code, I corrected this defect of the ESP32 converter, it is not difficult to implement because someone has already developed an appropriate library.
    And since the measurements are not performed on the full range, especially in the middle of the herds, the reference voltage is 3.3V / 2 because it can be assumed that the maximum values do not exceed these maximum values and the lower minimum ones.
    When calibrating the transducer, however, you need to give a maximum voltage of 230VAC and for a current of at least 20A, it is so programmed in the conversion parameters that the voltage of 350V is correctly measured and the current of 28A is already underestimated by about 0.2A.
    There is a description of this linearity in the link below
    https://github.com/e-tinkers/esp32-adc-calibrate

    I believe that ESP32 for such a simple system has good parameters and counting speed because I sample measurements every 300us so that the graphs are smooth and the calculations are quite accurate because there is something to average, there is also a lot of calculation for harmonics because furier function libraries are used.
    And the program code is over 700kb.
    I may change something, but I tested it for a long time and I am convinced that many colleagues will be satisfied if they decide to build this meter for such a small amount of money.
    Regards.
    Futek2
  • #12 20256721
    shimano73
    Level 12  
    Hello, I wanted to download these packages but they have probably been deleted, at least that's the message I receive
  • #13 20256768
    futek2
    Level 19  
    Maybe it was when I updated
  • #14 20256943
    Janusz_kk
    Level 39  
    I downloaded the code and there is a bin, so we have an advertisement again or a substitute for the project because the author is ashamed of his code.
  • #15 20256968
    kris8888
    Level 39  
    I have a question why on most of the attached screenshots the apparent power expressed in VA does not exactly coincide with the product of the current and voltage values?

    Similarly, multiplying the given apparent value by the power factor does not give active power?
  • ADVERTISEMENT
  • #16 20257008
    __Maciek__
    Level 20  
    @futek2 That's not what I meant in terms of 3.3V/2. (I know that the ADC in ESP32 leaves a bit to be desired) rather why are you measuring - I think so based on the diagram, and you don't use a low-pass filter - is there any purpose for it (maybe to speed up calculations, but probably marginal, unless you use math on floats does the transducer noise negatively affect the measurements?)

    https://learn.openenergymonitor.org/electrici...oring/ctac/digital-filters-for-offset-removal

    @Janusz_kk I'm not surprised there and I understand the author, it's intellectual property, he shares part of his work - if you have questions about the details, ask, I think you'll get an answer. Today too many people count on everything ready served on a plate. I don't think that's the way. The author showed a lot of his work anyway and that should be appreciated. Perhaps, as he refines the code, he will share it, for example, on Github / in this thread .. but it's only his good will and it should be respected.
  • #17 20257020
    khoam
    Level 42  
    Janusz_kk wrote:
    I downloaded the code and there is a bin, so we have an advertisement again or a substitute for the project because the author is ashamed of his code.

    I also don't like it a bit, especially since the Arduino libraries he used are under the LGPL license. They too were "served on a plate" and are someone's intellectual property.

    futek2 wrote:
    I believe that ESP32 for such a simple system has good parameters and counting speed

    How did you deal with the noise on the ADC input (quite a common problem) and the calibration of the ADC itself (the characteristic is non-linear)?
    link
  • #18 20257028
    futek2
    Level 19  
    Responding wheels. kris8888 is to inform you that the calculations are exactly done. But I send the results on the website with one decimal place. But if you have such a wish, then at your request there will be an accuracy of 3 decimal places for current and 1 decimal place for voltage, then the rest will agree. No problem.
    Maybe trying to simplify the design too sparingly I did some things.
    But it's nice to read comments to improve the project according to the wishes of colleagues.
    Please confirm whether or not I should make a correction?

    Futek2
  • #19 20257047
    kris8888
    Level 39  
    Well, but it's not about the decimal places, because even taking the data from the first discharge where we have U=236V, I=10.4A, the apparent power should be 2454 VA and it is given as 2452 VA. In turn, even assuming these 2452 VA, multiplying by the power factor of 0.93 should give 2280W. A is 2289W. In other screenshots, these discrepancies are even greater.
  • #21 20257220
    kris8888
    Level 39  
    futek2 wrote:

    I think I would leave the rest of the results because it's not a laboratory after all.

    Well, not really, but if you want to use this device for, for example, counting active energy, then every watt matters and it's better not to round the intermediate values too much.
  • #22 20257289
    jarekgol
    Level 39  
    @kris8888 2 at 2454 is 0.08% is there anything to fight for? And I suspect that the input data is worse than 0.08% anyway
    @futek2 nice design and familiar casing :) Is this transducer in the hall or does it have coils inside? Where did you buy it? because there are others on Allegro. Why are there 2 zips of the same size?
  • #23 20257418
    khoam
    Level 42  
    jarekgol wrote:
    2 at 2454 is 0.08% is there anything to fight for? And I suspect that the input data is worse than 0.08% anyway

    In addition, the ADC accuracy in ESP32 is 3%. After calibration with LUT - maybe it will reach 1%.
  • #24 20257459
    TechEkspert
    Editor
    Great idea and execution.
    Maybe it will be possible to observe the influence of the nearby PV on the grid voltage?
    With a better frequency standard, the grid frequency stability could also be investigated.
  • #25 20257859
    shimano73
    Level 12  
    Very nice project, I can't wait to test it. How will it behave in the grid to which the photovoltaics and the fronius inverter are connected. I would be interested in a version with 3F and the ability to connect to a home WiFi network. I am considering mounting other current transformers on a smaller pcb board with an input current of e.g. 30A and enclosing everything in a housing mounted on a din rail, e.g. D3MG or D4MG and if I put some small tft after i2c there, ehh but I dreamed :) . I have a 15kW electric central heating furnace and 9kWp panels, so I have something to test :) My friend does not share sources, he respects them, but with their help I could manage my needs.
  • #26 20257865
    Dariusz Goliński
    Level 22  
    And I like this project very much.
    I would add the ability to dump measurements to a file for later analysis in lexel.
  • #27 20257962
    futek2
    Level 19  
    Hello colleagues interested in the description of the analyzer - a measure of network parameters.
    Thank you all for your opinions and suggestions for improvements, some I've already done, some require more input in writing the code.
    But no one has done this measure so far, so there is no point to discuss the results of the measurements.
    I made a small change in the graphs with harmonics is that the harmonic bars are higher than the actual calculations to make them more clearly visible because without this correction when they were from the actual calculations they had low levels. And I did it by squared the calculations taken to plot the graphs,

    Having this meter, I have already made further measurements, especially with my PV. And so the PV operation brings the power factor close to 1 (about 0.98) but the meter shows that the COS has changed to the opposite because the direction of the current flow has changed, but the shapes of the graphs have improved significantly.
    The changes took place on the THD charts to the advantage.
    In summary, the inverter of the PV installation improves the shape of the sine wave of voltage and current, so it can also be said that it improves the power factor to close to 1.

    Another test on a single-phase motor at a branch chopper. The engine has a power of about 2kW and when it starts to spin, it starts to generate inductive reactive energy, which the meter shows and calculates the capacitor, and it was 45uF. This factor changed to a small extent when I was grinding the branches. I connected in parallel to the cable that powered the shredder motor and the meter - the analyzer was at home fastened in the box on the same phase as the connected shredder.
    And what I noticed was that the power factor improved, it approached 1 (0.98) and at the same time the current consumed decreased by about 1.2A, which was shown by the analyzer meter, but not trusting, I took a digital multimeter and the meter showed the same - a decrease in current by the same value.
    I leave this experience without comment because maybe someone will do a similar experiment and the result will be similar.

    In the near future, I plan to do similar tests with other engines, such as from the central heating circulation pump or an automatic washing machine and even a refrigerator.

    Because maybe we do not realize that it is possible to reduce electricity consumption by at least a few percent by compensating for inductive reactive power.

    I also had the opportunity to make measurements where the 40kVar inductive reactive power compensator works and the test was a very simple measurement when it works - the compensator is turned on when the devices are turned on and when turned on when the devices are working.

    Similar effects, only a larger current difference on the main power cable and a deterioration of the inductive power factor of 0.68.
    Attached are a few photos where you can see how many capacitors are connected - the LED strip on the right.
    I think it's something to think about.
    Regards.
    Futek2
  • #28 20257995
    amigo71

    Level 13  
    Janusz_kk wrote:
    I downloaded the code and there is a bin, so we have an advertisement again or a substitute for the project because the author is ashamed of his code.

    Thank you for letting me know, I was about to download it to experiment a bit.
    I can buy it ready-made on alle **o, but it's no pleasure.
  • #29 20258047
    Janusz_kk
    Level 39  
    If I want to 'copy' once or twice, bin is enough for me, and I just wanted to see in the code how the author solved some things, because even without doing anything similar, but analyzing the code, a person learns and draws conclusions by building something else.
  • #30 20258115
    metalMANiu
    Level 21  
    But my colleague wanted to show off only the idea and execution, not the whole code

Topic summary

The discussion revolves around the construction of a single-phase 230VAC network parameter analyzer using an ESP32 module. Key components include the ESP32 DEVKIT V1, current transformers (SCT013 for 25A and 100A), and a voltage transformer (TV16). Participants share insights on measurement accuracy, calibration methods, and potential improvements, such as adding energy counting features and enhancing data visualization. The author, Futek2, provides updates on software versions, calibration techniques, and the importance of using appropriate transformers for accurate readings. Users express interest in testing the device with various appliances and suggest modifications for better performance.
Summary generated by the language model.
ADVERTISEMENT