DIY mains power consumption meter

Nov 25, 2022 Last reply: 3 years ago 36 Replies

Why, that won't help with power-factor.

How's that help rms volts isn't going to assist in getting true power.

That depends on filtering.

Quite, so a modest attempt with filtering and ideally rms conversion would be fine. Any mains hash would be very local, and not all scopes can cope with a scope ground, can deal with true differential inputs for live-neutral measurement.

I think Johns solution is a good stab at getting results. They can be scaled to match actual meter readings.

If you want true power then you will need simultaneous measurement of volts and current, the sort of thing your current meter will do. I have wondered given there are periodic flashes with power and a magnetic optical reader, whether there is information to be gained there.

Example of the port that I see may have some security at different levels:

formatting link
However: The IEC specification defines the following communication modes:

Mode A: Supports bidirectional data exchange at 300 baud without baud rate switching. This protocol mode permits data readout and programming with optional password protection.

It already runs a good deal faster than that...

Erm, that is pretty much exactly what it does. (it also low pass filters out the DC offset introduced to make bipolar waveform palatable to the ADC)

erm, again yes...

and the rest - it basically runs "flat out" during the sample window. I will time it later and see what it can manage on that platform.

What do you think I was using when I was testing it?

You may find this helpful:

formatting link

But your mains 'test lead' is single-insulated.

Owain

Yeah, I like to live dangerously... :-)

Out of curiosity, I instrumented the EmonLib code to toggle the built in LED at the start of each iteration of the main sample loop. Here is what I got running on a nano with a Atmega 328p at 16MHz :

formatting link
That is ~350 uSec/iteration, giving a sample rate of > 2.85 kHz (57 points per mains cycle)

IMHO quite impressive for an 8 bit RISC CPU with no FPU...

Two ADC conversions, approx 16 double precision floating point operations, plus some integer maths, logic and branching

This is starting to feel a bit too much like my day job...

That sounds like it was designed in Spain then. I've not forgotten the pvc tape used to insulate wires joined together under a bed to feed a reading light. Brian

Since you have not seen the photo, it is basically an extension lead about 2m long with a plug one end and a trailing double socket at the other. The mid section of 1.5mm^2 flex has its outer sheath removed. This enables single cores (or multiple turns of) to be clamped round for current test purposes. Not intended for normal use obviously!

A question which this interesting thread has reminded me of: I have one of the 'plug in 'piggyback' power meters, with volts and wattage measurements etc. Presumably using a similar current transformer sensing mechanism.

Any thoughts of the accuracy of such beasts?

Thanks, J^n

The one I had (since deceased) seemed to be ok. It could certainly cope with traditional (i.e. leading or lagging) current profiles. I am not sure how good it was on ones with lots of harmonic distortion on the current profile. While many probably use a similar design, it is quite possible that some are much better than others.

They typically don't use a current transformer, they use a small value series resistor and measure the voltage drop. More accurate because there's no worries about the nature of the inductive coupling of the current-carrying wire, and probably less susceptible to stray magnetic fields.

Theo

Yes, I was looking at Big Clive's tear-down of his 'Hopi' Power Meter.

I presume the output of a CT is to some degree dependent on the quality of the mating of the ferrite surfaces?

You can get nice little potted modules for that, eg:

formatting link
(also higher current, with captive wires, etc)

I've not used one, but they would be my go-to solution in a project where I wanted a mains input and a USB port or wallwart wouldn't do.

Theo

Surely Clive must have looked at that ?

He seemed to like this one:

formatting link

Yup, they want to be clean and preferably well aligned. (there is a small amount of positional misalignment allowed on the one I have. Having said that, fiddling with it mechanically does not seem to change the reading.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required