You almost never hear of a DC Watt Meter – one just does some mental math with Volts and Amps at the back of one’s head. An AC Watt Meter, on the other hand, can by pretty useful on any workbench. This handy DIY Digital AC Watt Meter not only has an impressive 30A current range, but is designed in a hand-held form factor, making it easy to carry around.
The design from Electro-Labs provides build instructions for the hardware, as well as the software for the PIC micro-controller at its heart. A detailed description walks you through the schematic’s various blocks, and there’s also some basics of AC power measurement thrown in for good measure. The schematic and board layout are done using SolaPCB – a Windows only free EDA tool which we haven’t heard about until now. A full BoM and the PIC code round off the build. On the hardware side, the unit uses MCP3202 12 bit ADC converters with SPI interface, making it easy to hook them up to the micro-controller. A simple resistive divider for voltage and an ACS-712 Hall Effect-Based Linear Current Sensor IC are the main sense elements. Phase calculations are done by the micro-controller. The importance of isolation is not overlooked, using opto-isolators to keep the digital section away from the analog. The board outline looks like it has been designed to fit some off-the-shelf hand-held plastic enclosure (if you can’t find one, whip one up from a 3D printer).
Although the design is for 230V~250V range, it can easily be modified for 110V use by changing a few parts. Swap the transformer, change the Resistive voltage divider values, maybe some DC level shifting, and you’re good to go. The one feature that would be a nice upgrade to this meter would be Energy measurements, besides just Power. For an inside look at how traditional energy meters work, head over to this video where [Ben Krasnow] explains KiloWatt Hour Meters
Ok that’s a nice build but something in the schematic bugs me:
He uses two secondaries to separate the analog stage from the digitial one, but the analog side is not galvanically insulated from the main.
It’s highly unlikely that the main voltage would reach the digital ground through a badly insulated secondary, a deficient MCP and a shorted resistor …. but statistically, it could happen and harm the user.
So, to me, It’s not a safe design and renders the HCPLs useless.
To be constructive in my criticism, a good way to do it would have been to put two small transformers in the place of only one with two linked secondaries.
This would step up the insulation rating to thousands of volts
Not to be a dick, but the PCB is a bad example too.
The creepage distances are ridiculous around the ACS712 (have a look at C8).
oh yeah…. i just noticed the way the opto couplers are placed….. they seem to have no restriction in intersecting the two domains…..
Nope, the analog part IS ISOLATED from the mains thanks to this nice component “Fully Integrated, Hall Effect-Based Linear Current Sensor IC
with 2.1 kVRMS Isolation and a Low-Resistance Current Conductor”: http://www.allegromicro.com/~/media/Files/Datasheets/ACS712-Datasheet.ashx
However, i think 12 bits of resolution is way too little for a decent dynamic range.
The fail is in the creepage distance, there is ground plane around the 230v AC traces that go in and out the ACS!
There are supposedly digital traces crossing one corner of the analog side, a very bad example, smells a lot like auto-routed and careless component placement.
Aaaah, i see what you mean now, i thought you meant the current side.
This is from the spec of the transformer: Insulation: Prim / Sec.. = 10 MOhm to 500 Vcc – Sec / Sec.. = 2 megohms at 500 Vcc So yeah, it appears worse secondary to secondary.
Exactly my point. Thank you :)
Doe this hum at 60hz?
looks like its set up for British 230v 50hz
I don’t quite get why the fuse location. On the schematic it seems like it’s protecting the hull sensor only, however on the photos it looks like its where it should be, right at the start of the build to protect the whole thing.
Also how do they feel a 40a fuse is a safe fuse size choice? The hull sensor is rated for 30a, but how in the world (and please correct me on my naivety of soldered circuits) are those 2 soldered connections going to sustain 30a? I would think you would want to protect it at no more than 80% of the rating and even at that, it seems a little high…
The hall sensor is there to protect the fuse.
That made me laugh quite a bit
Yeah, the terminal blocks are rated for 16A, the hall for 30A and I sure cannot find any PCB fuse holder capable of more than 16A….(did not check everywhere though).
You bring up some good points, but as someone who’s currently working on a PCB for an automotive lighting application at up to 30A, and having looked at fuseholders for this applications, I can tell you that Digikey (just an example source) currently stocks 52 different through-hole or SMT fuseholders rated for 16A @ 250V or higher rating:
http://www.digikey.com/product-search/en?pv69=123&pv69=3&FV=fff4000a%2Cfff8003e%2Cf80009%2Cf8000b%2Cf80015%2Cf8001a%2Cf800fa%2Cf801d7%2Cf802ac%2Cf8037e%2Cf80433%2Cf8053f%2Cf8064c%2Cf8064d%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%2C108056c%2C108056f%2C1080570%2C1080572%2C1080713%2C1080725%2C1080e41&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=500
OMG, they even have a fuseholder rated for 40A @ 500V using MAXI Blade fuses. Holy cow!
You should re-examine your fuse choices. There are 5 that support 30A or more AND 400V or more. Of those, only 2 could be mounted on a PCB. in reality, these are simply blade connectors, and not fuse holders (unless you want to use 28V automotive fuses.)
All of the following are rated for 600-1500 VAC @ 30A or 32A (of course, their exact ratings vary depending on what standards you’re using, as shown in their datasheets). All use cartridge fuses. All are designed to be placed through-hole on a PCB:
486-1163-ND
486-3045-ND
486-1757-ND
486-1766-ND
486-3044-ND
Additionally, the following can be screwed/riveted to the PCB.
486-3042-ND
486-3043-ND
The point of my initial response to you was simply that there *are* PCB-mounted fuseholders designed for 16+ Amps. In my application I’m using 25A or 30A blade fuses and a set of blade fuseholders (which are not just ‘connectors’), because I’m working with low voltage DC, but as shown in the parts above, there are several fuseholders that can handle some pretty high current and voltage.
For safety reasons, your fuse should be the lowest current rating of all your parts, PCB traces, wires etc in that path. This is to make sure when over current were to happen, the fuse is the part that will blow and not anything else. This is not a case of protecting your parts, but to prevent them from blowing up and/or starting a fire.
Division is such a laborious process. I’d suggest multiplying by 1/N instead. Since N is fixed (N=40), 1/N is a constant, and would be used in many places in the code.
Multiplication is also supported in the PIC18 hardware by a 16b x 16b single cycle multiplier. Can’t do division in a single cycle.
Only one step away from being an energy meter too. Energy = sum ( V[n] * I[n] ) for all n.
A differential input ADC (U5) for line voltage sense might have been a slightly better choice. This would reduce the data required/transmitted by half, eliminated some computations, and really measured the voltage across R1 (instead of two measurements slightly delayed in time – but that’s likely moot as CH1 generally wouldn’t change.)
The MCP3202 would *almost* work in differential mode, except IN- needed to be within 100mV of Vss, and IN+ could never go below IN-. (Either CH0 or CH1 can function as IN-.)
I was co-author of AN220 “Watt-Hour Meter using PIC16C923 and CS5460”.
Premature optimization is the root of all evil.
The division is not in a time critical section of the code. All the samples have already been taken. The only effect would be an imperceptible delay until update on the display.
For the sake of clarity, I would just leave the division in.
Not familiar with the MCP3202, but the MCP3301 (13-bit ADC) doesn’t seem to have that issue. See common mode vs vref graph.
>The common mode input range has no restriction and
is equal to the absolute input voltage range: VSS -0.3V
to VDD +0.3V. However, for a given VREF, the common
mode voltage has a limited swing if the entire range of
the A/D converter is to be used.
Not a bad start. Some layout issues that others have already noted, but more importantly no mention of crest factor, harmonics or simultaneous I/V measurement, all of which define just how accurate the RMS calculation will be, especially when trying to measure the draw of any modern electronics.
Elm Chan’s verison: http://elm-chan.org/works/heco/report_e.html
– powered from 100-120V AC, no isolation.
– voltage/current/Power/Power Factor/Frequency, V/I waveform, power factor, harmonics,
>But 12-bit is not sufficient resolution for current channel because the load current varies in range from several milliamperes to 10 amperes or above as like idle current and heater current. To solve this issue, a 16-bit ADC is added for current channel and a 12-bit integrated ADC is used for voltage channel.
The ACS712 is a highly overrated chip. It will fail at 15A+ currents (arcing + ic popping). (Bad experiences with them and went to a standard current sense transformer afterword with no issues whatsoever).
A bit more on the 15A I’m saying, 15A momentary, 2-5A consistent can cause it to pop. It’s a badly designed chip from the get go that should not be in an SOIC-8 package. Now, this is with THEIR recommended layout, plus my own additions to beef up for current and heatsinking.
Any experience with the ACS711? I hope its performance is better than what you’ve mentioned for the 712. My current application uses the QFN-12 package. I’m working with <30VDC, but up to 25A.