Watt meter construction takes you to understand the basics of power measurement | Hacker Day

2021-11-26 10:16:16 By : Mr. Kevin Xu

You have almost never heard of a DC wattmeter-people just use volts and amperes in the back of their heads to do some mental arithmetic. On the other hand, the AC wattmeter is very useful on any workbench. This convenient DIY digital AC wattmeter not only has an impressive 30A current range, but also has a handheld design that is easy to carry.

The design of Electro-Labs provides hardware construction instructions and the core software of the PIC microcontroller. The detailed description will guide you to understand the various blocks of the schematic, and also provide some basic knowledge of AC power measurement in order to make a good measurement. The schematic and board layout are done using SolaPCB-this is a free Windows-only EDA tool that we have not heard of until now. The complete BoM and PIC code completes the construction. In terms of hardware, the unit uses the MCP3202 12-bit ADC converter with SPI interface, which can be easily connected to the microcontroller. A simple resistor divider for voltage and a linear current sensor IC based on the ACS-712 Hall effect are the main sensing elements. The phase calculation is done by the microcontroller. The importance of isolation cannot be ignored. Use an optical isolator to keep the digital part away from the analog part. The circuit board outline looks like it is designed to fit some ready-made handheld plastic enclosures (if you can't find one, please make one from a 3D printer).

Although the design is for the range of 230V~250V, it can be easily modified to 110V by changing some parts. Swap the transformer, change the value of the resistor divider, maybe some DC level conversion, and you can start. In addition to power, a good upgrade function of this meter is energy measurement. To learn more about the working principle of traditional electric energy meters, please watch [Ben Krasnow]’s video explaining KiloWatt Hour Meters

Okay, this is a good build, but something in the schematic confuses me: He uses two secondary stages to separate the analog stage from the digital stage, but the analog side is not galvanically insulated from the main stage. The main voltage is extremely unlikely to reach the digital ground through the poorly insulated secondary, defective MCP, and short-circuited resistor... But statistically speaking, it can happen and hurt the user. So, for me, this is not a safe design and makes HCPL useless.

To be constructive in my criticism, a good way to do this is to place two small transformers where there is only one secondary with two connections. This will increase the insulation level to thousands of volts

Don't be a bastard, but PCB is also a bad example. The creepage distance around the ACS712 is ridiculous (look at C8).

Oh yeah…. I just noticed how the optocouplers are placed... they seem to have no restriction on the intersection of the two domains...

No, because of this beautiful component "fully integrated, Hall effect-based linear current sensor IC with 2.1 kVRMS isolation and low resistance current conductor", the analog part is isolated from the power supply: http://www.allegromicro.com/ ~/ media/Files/Datasheets/ACS712-Datasheet.ashx

However, I think 12-bit resolution is too little for a decent dynamic range.

The fault lies in the creepage distance. There is a ground layer around the 230v AC wiring that enters and exits the ACS!

One corner of the analog side is said to have digital wiring. This is a very bad example. It smells a lot like automatic wiring and careless component placement.

Aaaah, I understand what you mean now, I thought you were talking about the current side. This is the specification from the transformer: Insulation: Prim / Sec.. = 10 MOhm to 500 Vcc – Sec / Sec.. = 2 megohms at 500 Vcc So yes, secondary to secondary seems worse.

It is my point of view. thanks:)

Will this buzz at 60hz?

It looks like it is set for the UK 230v 50hz

I don't quite understand why the fuse is located. On the schematic, it seems to be just protecting the hull sensor, but on the photo, it looks like it should be where it should be, right at the beginning of construction, to protect the entire sensor. In addition, how do they feel that the 40a fuse is a safe fuse size choice? The rated current of the hull sensor is 30a, but can the two welding connections withstand a current of 30a (please correct my naivety to the welding circuit)? I think you would want to protect it with a rating of no more than 80%, even so, it seems a bit high...

The Hall sensor is used to protect the fuse.

It makes me laugh very happily

Yes, the rated current of the terminal block is 16A, and the rated current of the hall is 30A. I definitely can't find any PCB fuse holders that exceed 16A... (though I haven't checked everywhere).

You have put forward some advantages, but as someone who is currently researching PCBs for automotive lighting applications up to 30A and looked at the fuse holders for this application, I can tell you that Digikey (just an example source) currently stocks 52 different Through-hole or SMT fuse holders are rated 16A @ 250V or higher:

http://www.digikey.com/product-search/en?pv69=123&pv69=3&FV=fff4000a,fff8003e,f80009,f8000b,f80015,f8001a,f800fa,f801d7,f802ac,f8037e,f80433,f8053f,f8064c,f8064d% 2Cf80658% 2Cf806db% 2Cf8076f% 2C1080017% 2C1080018% 2C108001d% 2C108001e% 2C1080020% 2C1080021% 2C1080076% 2C1080088% 2C108008b% 2C108009c% 2C108009e% 2C10800d6% 2C10800d9% 2C10800dc% 2C10800e4% 2C10800e8% 2C10800ed% 2C10800ee% 2C1080121% 2C1080185% 2C10801b8% 2C10801be% 2C10801f1,108056c,108056f,1080570,1080572,1080713,1080725,1080e41&mnonly=0&newproducts&1&10&10&10&10&10&10&10&1page=0&10&10&10&10page=0

Gosh, they even have a 40A @ 500V fuse holder that uses MAXI Blade fuses. OMG!

You should recheck your fuse selection. There are 5 types that support more than 30A and more than 400V. Of these, only 2 can be mounted on the PCB. In fact, these are only blade connectors, not fuse holders (unless you want to use 28V automotive fuses.)

All of the following products have a rated voltage of 600-1500 VAC @ 30A or 32A (of course, their exact ratings depend on the standard you use, as shown in their data sheets). All box fuses are used. All are designed to be placed on the PCB through through holes: 486-1163-ND 486-3045-ND 486-1757-ND 486-1766-ND 486-3044-ND

In addition, the following components can be screwed/riveted on the PCB. 486-3042-ND 486-3043-ND

The main point of my initial response to you is very simple, there are *Yes* The fuse holder mounted on the PCB is designed for 16 amps or more. In my application, I use 25A or 30A blade fuse and a set of blade fuse holders (not just "connectors") because I use low voltage DC, but as shown in the above section, there are several Fuse holders can handle some fairly high currents and voltages.

For safety reasons, your fuse should be the lowest rated current of all components, PCB traces, wires, etc. in the path. This is to ensure that when an overcurrent occurs, the fuse is the part that will blow, not any other part. This is not to protect your parts, but to prevent them from exploding and/or catching fire.

Partitioning is such a laborious process. I suggest multiplying by 1/N instead. Since N is fixed (N=40), 1/N is a constant and will be used in many places in the code.

The PIC18 hardware also supports multiplication through a 16b x 16b single-cycle multiplier. You cannot divide in a loop.

It is only one step away from becoming an electric energy meter. Energy = the sum of all n (V[n] * I[n] ).

The differential input ADC (U5) for line voltage detection may be a better choice. This cuts the required/transmitted data in half, eliminates some calculations, and actually measures the voltage on R1 (instead of two slightly delayed measurements-but this may not make sense because CH1 usually does not change.)

The MCP3202 will *almost* work in differential mode, except that IN- needs to be within 100mV of Vss, and IN can never be lower than IN-. (CH0 or CH1 can be used as IN-.)

I am the co-author of AN220 "Watt-Hour Meter using PIC16C923 and CS5460".

Premature optimization is the root of all evil.

Division is not in the time-critical part of the code. All samples have been collected. The only effect is the imperceptible delay before updating on the display.

For the sake of clarity, I will leave division in it.

Not familiar with MCP3202, but MCP3301 (13-bit ADC) does not seem to have this problem. See common mode and vref diagram.

>There is no limit to the common mode input range, which is equal to the absolute input voltage range: VSS -0.3V to VDD 0.3V. However, for a given VREF, if the entire range of the A/D converter is to be used, the common-mode voltage swing is limited.

Not a bad start. Some layout issues that others have noticed, but more importantly, there is no mention of crest factor, harmonics, or simultaneous I/V measurements, all of which define the accuracy of the RMS calculation, especially when trying to measure any modern electronic equipment When drawing.

Elm Chan's version: http://elm-chan.org/works/heco/report_e.html-powered by 100-120V AC without isolation. – Voltage/current/power/power factor/frequency, V/I waveform, power factor, harmonics,

> But 12-bit resolution is not enough for the current channel, because the load current varies from a few milliamps to 10 amperes or more, just like idle current and heater current. To solve this problem, a 16-bit ADC is added to the current channel, and a 12-bit integrated ADC is used in the voltage channel.

ACS712 is a highly overrated chip. It will fail under 15A current (arc ic burst). (Postscript of the bad experience with them and using a standard current induction transformer without any problems).

I said 15A is a little bit more, 15A is instantaneous, 2-5A consistency may cause it to pop up. It was a poorly designed chip from the beginning and should not be packaged in SOIC-8. Now, this is their recommended layout, plus my own supplement to enhance current and heat dissipation.

Do you have experience with ACS711? I hope its performance is better than the 712 you mentioned. My current application uses QFN-12 package. I am using <30VDC, but up to 25A.

Please be kind and respectful to help make the comment section great. (Comment Policy)

This website uses Akismet to reduce spam. Learn how to handle your comment data.

By using our website and services, you explicitly agree to the placement of our performance, functionality and advertising cookies. learn more