Measuring real and reactive power WITHOUT measuring voltage on EmonTX

OEM is an awesome project!  Thanks so much for sharing all your hard work.

I have an interesting challenge.  I need to be able to measure whole-house real power and reactive power.  As I understand it, this can be achieved using the current EmonTX by connecting the EmonTX to both a CT clamp (to measure current) and an AC-AC adapter (to measure voltage).

BUT I don't have a mains socket anywhere near my consumer unit, so I can only connect a CT clamp to the EmonTX and connect an AC-AC adapter to my Nanode base unit.  But, as I understand it, in order to measure real power and reactive power, and to have these measurements accurate even when harmonics are present, I need to be able to sample the current and voltage waveforms many times per cycle, and to accurately align these current and voltage samples in time.  This raises two issues when the current and voltage are being measured on different nodes, connected by a low-bit-rate RF link:

  1. How to transfer of many (hundreds?  thousands?) of samples from one node to the other?  The RF link has no forward error correction so the chances of successfully transferring a thousand-byte packet is rather low.
  2. How to synchronize time across both nodes?

I've been trying to hack together a solution and I'd love your opinions on my proposed solution (or if you know of an existing solution then please let me know!):

Let's assume that voltage measurements are done on the Nanode, current measurements are done on the EmonTX and the majority of the calculations are also done on the EmonTX (we'll see why in a moment).

To tackle the challenge of having to send huge amounts of data over the RF link:

Let's assume that the voltage waveform is a pure sine wave, but the current waveform has nasty harmonics. With this assumption, we no longer have to transfer many samples per cycle of the voltage waveform over the RF link; instead we just need to transfer a few parameters to define the sine wave (e.g. zero-crossing times and maximum amplitude).  So we program the Nanode to send these parameters to the EmonTX and the EmonTX can then reconstruct the full voltage waveform using a trigonometry lookup table.  This setup also means that the Nanode can get on with other time-consuming work in between sending calibration packets to the EmonTX.

To tackle the time sync problem:

Let's setup the EmonTX's interrupt service routine to timestamp the first valid byte of every packet it receives (using the micros() function). Let's setup the Nanode to send a packet to the EmonTX every, say, 5 seconds.  This packet contains the instantaneous Nanode time and the voltage sine wave parameters for the last few AC cycles.  Hopefully, the time taken to transmit a packet from the Nanode to the EmonTX will be relatively constant and something we can measure in the lab and set as a constant in the code.  This way, the EmonTX can calculate the offset between its micros() clock and the Nanode's micros() clock.

The end result is that the EmonTX can spend most of its time sampling the (messy) current waveform. It can calculate instantaneous power by multiplying the instantaneous current readings with the reconstructed voltage waveform; and this voltage waveform reconstruction can be kept reasonably in-sync with the actual voltage through regular callibration packets from the Nanode.

Does that sound vaguely sensible?!

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

I can see what you're getting at, but it sounds highly fraught. My considered opinion is it could be very hard getting this to work, and then I would have doubts about its reliability. What is the exact problem with monitoring voltage - are you able to get a low voltage cable back to your consumer unit - like a telephone extension type cable? The 9 V a.c would be quite happy in that.

An alternative thought - I've not built or tested this - would be to use a capacitive pick-up at your consumer unit. The idea is: normally, we use an adapter to provide 11 V a.c then divide it down 11:1 to get about 1 V rms with a resistive divider. You could achieve the same using a capacitive voltage divider, a large capacitor (low reactance) at the earthy end and at the high-voltage end a small capacitor (high reactance), which you make by wrapping a couple of dozen turns of well-insulated wire around the line cable. You need a high impedance op-amp external to the emonTx to interface to the ADC input, and don't use the bias circuits built into the emonTx pcb.

(R4 + C3 simulate the input of the ADC).

It was first published in this thread where there's a bit more explanation: http://openenergymonitor.org/emon/node/1059#comment-6258 I proposed this a while ago, it was scaled for a 1 V p-p input (not 3.3 V) and I don't know whether anyone built it.

 

PaulOckenden's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

The Eco Eve device uses something similar. A bit of foil wrapped around one of the main grid cables.

I'm not sure it could accurately measure voltage, but it's a good way to get the phase angle.

 

P.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Thanks loads for your replies!

What is the exact problem with monitoring voltage?

I should expand a bit on exactly what I'm doing!  I'm doing a computer science PhD on smart meter disaggregation (aka non-intrusive load monitoring)*.  I'm kitting my home out with whole-house meters and wireless individual appliance monitors on every appliance.

Next term, I'm running an MSc student project on visualisation and analysis of electrical energy consumption with about 10 students, each of whom will also install an EmonTX (to measure whole-house consumption) and IAMs.  The problem is that most of these students live in rented accommodation, where their fuse box is in a communal area.  Hence tinkering with their mains wiring (to install a socket) or running cables from their flat to the communal hall are not possible.

use a capacitive pick-up at your consumer unit

I wasn't aware of this technique until today!  Sounds very intriguing, I may well have a tinker.  If I can use the capacitive pickup in the consumer box to get phase angle, and an AC-AC adapter on the base station to measure RMS voltage then I should be good to go.

Thanks again for the replies!

(By the way, there's also some discussion of this issue on the Navitron forum).

* Incidentally, the ultimate aim of my PhD is to produce an open source NILM package.  Which I'd certainly hope to make compatible with the OEM software.

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

I don't understand what Paul's concerns are with measuring voltage, once it has been calibrated - this technique is usual at high voltages ( I'm not sure at what voltage it starts to get used, Alstom and ABB both advertise units for 72 kV upwards).

http://en.wikipedia.org/wiki/Capacitor_voltage_transformer

"If I can use the capacitive pickup in the consumer box to get phase angle, and an AC-AC adapter on the base station to measure RMS voltage then I should be good to go."
I'm not sure how you'd marry those two things to accurately calculate real power and apparent power - the real mains isn't a sine wave!  (Read AC Power Theory - Arduino maths if you don't understand what I'm inferring there).

[I've fixed the circuit diagram link in the post above. Note: the component values need changing for the emonTx, which requires a 1 V rms input centred at 1.65 V:  R1 & R2 should both be 820 k, and C2 can be reduced to 3n9 ]

PaulOckenden's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Robert, my comment was because there IS no calibration with the Eco Eye (which it what I was talking about). You just slap a bit of foil round the wire and that's it.

I'm assuming it's only used for phase angle. I suppose they could 'guess' at 240V on first contact, and try to measure variance, but I think that would be highly dubious given the nature of the sensor.

P.

 

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Ah, I understand. I think Jack thought - as I did - that "it" referred to the capacitive p.t. in principle, not the Eco-Eye. The capacitive p.t. is used to measure voltage for metering and protection in power systems, which tends to suggest that properly constructed it will be accurate.

But I can see how "slapping a bit of foil" would easily lead to a 50% or more variation in the value of the resulting capacitor. If the value you end up with is close to my estimate, then the calibration constant should take care of it. Otherwise, it's either start again with a longer piece of foil, or cut some off, of change the 'bottom' capacitor so as to bring the voltage within a sensible range. As long as the 'top' capacitor is stable in value (i.e. it doesn't move and nobody puts anything close to it), I don't see a problem.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Thanks for your replies.  Very interesting stuff.

If I understand it, a strategy is starting to form:

  1. Use a bit of foil wrapped around a mains cable, as per the Eco-Eye.  This will give us phase angle and, once calibrated, voltage.
  2. Use an AC-AC adapter on the base station to provide regular voltage calibration updates.

One thing is slightly worrying me though: would the voltage-step-down-capacitor introduce any latencies?  Would we also have to calibrate phase angle?

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

I think you'd need to check this, but I don't see a need for what amounts to regular checks on the value of the home-made capacitor.  If everything is solid and there's no relative movement, the value should be stable. Simulation shows that the phase angle is quite possibly better than the AC-AC adapter - certainly it doesn't change with the applied voltage, and there's a phase angle calibration built in to the standard software. So there's probably no need for the ac adapter at the base station.

I don't understand what you mean by "latencies". Can you elaborate?

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

OK, that's great news that the capacitor should be stable.  I still want to build an automated calibration system though (using an AC-AC adapter at the base) because my students will need to install this kit and they wont have much time to tinker.

Will changes in humidity affect the calibration of the capacitor?

I don't understand what you mean by "latencies". Can you elaborate?

Sorry, you're right; I wasn't very clear.  I meant: will the waveform reported by the capacitor be precisely in sync with the true voltage in the cable?  Will the measured and the actual waveforms be precisely in sync or will there by a phase-shift?  (I think you've already answered this question by saying that "phase angle is quite possibly better than the AC-AC adapter - certainly it doesn't change with the applied voltage".

Thanks again.  I should actually start building this stuff within the next few days.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

By the way, which op-amp would you recommend?  A bit of Googling suggests the LMC662 has a very high input impedance. Input bias current is 2 femto amps!  Does that sound about right?

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Humidity? I don't think the cable insulation will absorb moisture, so unless it is condensing, I can't see it making much difference.

LM662? Not really - it requires a 5 V supply and the emonTx runs off 3.3 V. So even if you do have 5 V available, you need to clamp the output to 3.3 V or you risk damaging the input of the A-D converter. I usually suggest one of the LMV321 family, which are good down to 2.7 V. The only problem is they are surface mount packages.

I don't think there's a need to go overboard on input impedance. By all means keep it as high as is sensible, you can quite easily check the effect of whatever impedance you think you might have with a simulation program.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

LM662? Not really - it requires a 5 V supply and the emonTx runs off 3.3 V

Good catch!  Thanks!

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Maybe a MCP6043 op-amp would be a good choice?

  • Power supply: 1.4-6 volts, 0.6 micro amps
  • 1pA input bias current
  • 5 microVolts input voltage noise
  • DIP
Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

That one looks a possibility. Read section 4.4 of the data sheet though, as although the capacitor that it's driving - the sample & hold capacitor - is very small, if you get any instability you know what to do. The feedback bootstrap capacitor should not have much effect as it already has loads of series resistance associated with it.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

thank you so much for your amazing attention to detail!  I must admit I hadn't read past page 3 of the data sheet!

arvidb's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

I've just bought 10 pcs of MCP6002 to use with emonTX. I thought I had made a nice find, and then you link to MCP604x family! Nice quiescent current on those!

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

But you'll notice that it's at the expense if the gain-bandwidth product. But it's enough for a unity gain buffer at 50 Hz not to suffer slew rate limiting!

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

A tiny bit of progress to report...

Robert's circuit diagram calls for a 15pF capacitor on the mains cable.

I splashed out on a capacitance meter (which I'll almost certainly sell after this project is over!) and a 16mm diameter meter tail kit.  To create my capacitor, I used aluminium tape (the sort used to tape the gaps between insulation).  It turns out that a 35mm stretch of tape gives a capacitance of 15pF.  This value wobbles up and down depending on a number of things (like how close your hand is to the setup) so I can't be precise.  The meter has an accuracy of +/- 2pF.

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

I was aiming for a length of around that (I'd done the maths, not spent money!), but not exceeding about 50 mm. You could of course have more capacitance there and increase the bottom capacitor pro rata.

What I don't think I've mentioned: You can connect using screened cable, the cable capacitance will form part of that bottom capacitor and so the physical one may, depending on the cable you choose and the length, need to be reduced (or the top capacitor increased) to suit.

As I said earlier, it's important that, once installed and calibrated, there's no physical movement nearby.

PaulOckenden's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Length looks similarish to the eco-eye setup, which you can see bottom right in this photo:

 

http://www.eco-eye.com/graphics/ecoeyesmartPV.jpg

 

P.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

BTW, just to be sure: there's absolutely no risk of getting a electric shock from the "mains capacitor" is there?  I assume that even if the "aluminium tape" plate of the capacitor does reach a dangerous potential difference, it will store so little charge that it poses no risk.  (sorry, I know this is a dumb question)

PaulOckenden's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

No risk at all. 

If you want to double check, just grip one of your meter tails in your hand. 

P.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

ok, that's good news - thanks.  (I must admit that I had tried testing the voltage produced by the alumium plate using my multimeter and then tried touching it... but I just wanted to double-check!).

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

If you are in any doubt, do the maths. You will have more current flowing through your body when you use a neon screwdriver.

Do you really think I would have suggested this if there was the slightest risk to anyone?

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Thinking about your capacitive v.t, you could minimise the external influences by screening it. The capacitance between the pickup foil and the (earthed) screen would - like the cable capacitance - need to be subtracted from the 'bottom' capacitor.

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Thinking about your capacitive v.t, you could minimise the external influences by screening it

Great tip, thank you.  Should I worry about the impedance of the screened cable?  Would 50 ohms be OK?

Robert Wall's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

How long? You're not going to be using >0.1 wavelengths, are you? [Hint: One wavelength at 50 Hz = 6000 km ! ! !] Capacitance is more of an issue, but as I said, it just adds to the 'bottom' capacitor so you reduce that to suit. TV aerial downlead, single-core audio screened cable would be fine.

 

 

jack_kelly's picture

Re: Measuring real and reactive power WITHOUT measuring voltage on EmonTX

Great, thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.