Adding a 3rd CT on the emonPi?

I have an emonPi, but would like 1 more CT. Where I am in Australia, we have two power meters - peak (CT1) and controlled load (off-peak), and I have solar (CT2). So I’d like to be able to accurately measure my off-peak circuit using an extra CT.

I bought all the parts to use an ESP8266, but I’ve never programmed any of them and I haven’t had the time to learn. I also don’t understand how it would send it’s results to the emonPi, since the documentation suggests it goes out the serial port.

I’ve got all the electronics to connect it up, but I was wondering if I can use ADC6 to connect up an extra CT directly onto the emonPi. I’d put a burden resistor circuit between the RJ45 connectors on pin 8 of the emonPi.

Am I missing something? What would I need to do software-wise to get this to work?

Edit: The only thing I’ve been able to find is this page. The diagram it links to is a broken link, but can be found here.

I think the ESP has a not brilliant ADC, so you’re probably better to convert your emonPi.

Nothing significant has changed hardware-wise that I know of, so what I wrote there is probably still accurate.

The hard part will be finding room for the connector and the parts inside the case. (That’s why it only has 2 channels.)

But software-wise, you have a problem. You will need a custom sketch in the “emon” part of your emonPi, and when you update the emonPi, that will get overwritten by the default sketch. It can be overcome, and as the sketch is in any case a cut-down version of the emonTx software, it’s not difficult to add the extra channel. Then you’d need a small change in emonHub.conf to accept the extra data - that’s simple.

Thanks Robert. Space isn’t really an issue - I was planning on using an RJ45 breakout and just putting the electronics in a jiffy box or similar.
If the ESP8266 is no good, I also bought an Arduino Uno and the (RFM69W?) RF module for it, and a USB-to-TTL adapter. Would the Arduino be easier? I can probably figure out how to load the Arduino (following this guide), but I’m a little hazy on how to interface it into the emonPi. I’m trying to avoid using RF/Wifi for various reasons, but I’m not sure what the easiest way would be.

If you don’t want to use the analogue input of the emonPi, you have a created a problem with measuring power. You cannot have real power (W), only apparent power (VA). To get real power, you also need to monitor the voltage and do the P = V × I calculation on a per sample basis, then average to get real power. You can have apparent power with separate measurements of rms voltage and rms current, which is all you could do with a single channel current-only measurement in a Uno, taking the emonPi’s voltage measurement and doing the multiplication in emonCMS.

The RF route:
If you look at one of our ‘standard’ sketches, you should see how we package up the data to send, using the RFM69CW and Jeelib, the data to emonHub. That is the software running in the emonPi that receives the data from the ‘emon’ part of the emonPi and from emonTHs and emonTx’s.

Alternatively, not using RF, you can use a 3-wire serial connection from the FTDI interface on the Uno to the GPIO of your emonPi: EmonTx V3.4 - OpenEnergyMonitor Wiki
That shows an emonTx, which runs at 3.3 V but the I/O is otherwise the same. The RPi cannot accept the 5 V which I presume the Uno will be outputting, so you will need a simple voltage divider to step the voltage down to 3.3 V.

Thanks Robert, I think I’ll try and get that direct connection set up.

As for voltage measurement, I’m certainly no expert, but it’s sort of academic, isn’t it? ie. if you measure current on the Uno every 10 seconds, then multiply it by the voltage reading on the RPi, then it would only be out by however much the voltage has changed in the time between the two measurements. I would assume the voltage would change by maximum 5V on a 230/240V system, so ~2%. I can live with 2% inaccuracy - or have I misunderstood?

I see the Uno has 6 analogue inputs. Could I use that to measure voltage and eliminate the above issues? And can I use it to measure more (4 or 5) CT’s?

I think so. You’re assuming a power factor of 1.0 for that approximation to be valid. If the off-peak load is purely resistive (water or space heating), then it is probably quite close to that. If it has motors and pumps and things like that, it’s even more inaccurate than you think.

Overnight and daytime when I’m using little electricity, my power factor is between 0.7 and 0.8, so my 50 - 150 W would be measured as 70 - 190 VA. (When you measure voltage and current independently, and it’s not a purely resistive load, the answer is in Volt-Amperes – VA.)

Yes to both. EmonLib has all the maths to do the calculations, all you need is the sketch. If you’re happy working with sketches, I’d advise converting one of the emonTx V3.4 sketches to suit the Uno, rather than using the Arduino demo sketch. The former is “fully engineered” - and it’s easier to take stuff out that you haven’t got (like DIP switches and tests for connected sensors).

Thanks again Robert. It’s just a mains-pressure hot water system, so would be close to PF=1. But I may as well get it right (especially if I want to measure other circuits), so I’ll try and connect up the voltage measuring circuit as well.

When I get the time, I’ll setup the Arduino. Some googling suggests that I can use a USB cable for the serial comms. That would be a lot easier, since the EmonPi is bolted on to the asbestos-filled meter board.

If I ever do get it going, I’ll post a how-to.

We do know how to do it using the GPIO, and we know that works.