3 Phase whole house, PV and heat pump monitoring required

That is correct. They should not be there. The sketch is not a library.

Please go back and very carefully read the document I sent you -“Installing Libraries”, because you still do not have the correct structure. I will try to spell it out for you once again.

You have a directory called “Software”. You must tell the IDE that this is your “Sketchbook”. Do that with File > Preferences > Settings and enter the path in “Sketchbook location”.

Under that directory you must have at least two sub-directories: one for your sketch and one called “libraries”. You have those.

Under the “libraries” directory you must have ALL - not some, ALL - of your libraries. Look at the picture on the 3rd page of the file that I sent you. Move all the libraries (I can see ArduinoTemperature…, jeelib, OneWire, RFujeelib) into that “libraries” directory.

Ok I think I understand.

So reading from both of the comments above, ArduinoTemperature, EonLib, jeelib, OneWire, RFujeelib all go in the ‘libraries’ folder as they do not contain sketches, apart from examples which are ok. The emonTx3PhaseVoltage must go under ‘software’ as this does contain a .ino file, a ‘proper’ sketch.

I don’t think I understood the difference between the library directory (ArduinoTemperature…, jeelib, OneWire, RFujeelib) which can contain example ‘sketches’ and the actual ‘sketch’ folders (eMonTxV3_4_3Phase) which contain the relevant sketch you are working on.

So far, when I compile, no errors. Thanks guys, really appreciate all of your help :slightly_smiling_face:

Now I can finally get on with the actual task in hand!

At last! Had you edited you sketch without trying this first, the task would have been a lot harder.

No I left it as is, just loaded it via File>Sketchbook>emonTx3PhaseVoltage and then Sketch>verify/compile.

Starting to update it now so will see how I get on!

Do I need to do this procedure with the EmonPi as well? I assume I do.

What do you want to change in the emonPi?

The first emonTx should be received automatically - everything is already set up.
The second one must have a different NodeID, and you’ll need to make this node 12 in the sketch. There’s already an entry for this node in emonhub.conf, so that too should be received automatically.

I see what confused you. The examples bundled with the library inside the library directory are just that, and you need to move/copy them from there and into their own directory under “Software” to run them. They are put there by the creators/maintainers of the libraries, and there’s nothing we can do about that.

I wasnt sure if the emonPi needed the three phase sketch also?

I will make one node 11 and the other node 12.

This seems to be the only section that really needs tweaking;

// Calibration coefficients for emonTx V3
// These need to be set in order to obtain accurate results
double Vcal = 276.9; // Calibration constant for voltage input
double Ical1 = 90.9; // Calibration constant for current transformer 1
double Ical2 = 90.9; // Calibration constant for current transformer 2
double Ical3 = 90.9; // Calibration constant for current transformer 3
double Ical4 = 16.6; // Calibration constant for current transformer 4
#endif

#ifdef EMONTX_SHIELD

#define SUPPLYVOLTAGE 5000 // Normally 5.0 V for the emonTx Shield = operating voltage of Arduino

// Calibration coefficients for emonTx Shield
// These need to be set in order to obtain accurate results
double Vcal = 234.2; // Calibration constant for voltage input
double Ical1 = 60.6; // Calibration constant for current transformer 1
double Ical2 = 60.6; // Calibration constant for current transformer 2
double Ical3 = 60.6; // Calibration constant for current transformer 3
double Ical4 = 16.6; // Calibration constant for current transformer 4
#endif

// Calibration coefficients common to all versions - see comments above
double Phasecal1 = 1.00; // Calibration constant for phase shift L1
double Phasecal2 = 0.60; // Calibration constant for phase shift L2
double Phasecal3 = 0.08; // Calibration constant for phase shift L3
double Phasecal4 = 1.10; // Calibration constant for phase shift CT 4

I am not using CT4.

So I need to measure the voltage on L1, L2 and L3 using a multi meter in the socket and adjust the voltage to match in the sketch? It says they need to be set but no specifics in the sketch as to the physical measuring. Is there an idiots guide to this procedure…?? :relaxed:

You cannot use the emonPi for a 3-phase supply because it has only two current inputs. This is why I proposed what I did.
From post no.8:

The calibration page in ‘Learn’ gives you detailed instructions for the standard sketch. Follow those in general, but do the measurements in the order given in the comments of the 3-phase sketch.
(The method in the note for setting PHASECAL is probably the easiest and most accurate.)

Yes I remember the post now. I was thinking to use the emonPi on L1, 1 x emonTx on L2 and 1 x emonTx on L3, hence asking if I need to add the 3 phase sketch to the emonPi also.

However, re-reading your post it would probably make much more sense to use 2 x emonTx to measure the 3 phase circuits and PV in the garage and the emonPi to measure something in the house. The only problem is the emon’s cannot pick up wifi from the house to garage. I have 2 x CAT6 cables in the garage which are on the house network, only connected to the emonPi at present. I could connect these to a network switch and then to each emonTx for connectivity. Although would they still connect to the emonPi (assuming it is on the same network)?

Alternatively I could use the emonPi (L1)+ 1 x emonTx (L2, L3) in the garage and the other emonTx in the house allowing me to measure 4 circuits in the house??

The emonTx’s don’t have any network ports. The RJ45 port on them is only for the I/O expander (generally for temperature sensors). Don’t plug it into a network switch.

They communicate with the EmonPi over 433 MHz RF radios, not over your network at all. Are you sure they do not work from the garage to the house? They probably have greater range than WiFi would.

The emonTx does not use WiFi, unless you add the ESP8266 module. I suspect you mean the inbuilt radios, not WiFi. Have you tried to receive the emonTx on the emonPi in the house? They work on a much lower frequency, so no WiFi is not a guarantee of no 433 MHz.

It was the emonPi that I could not get a wifi signal from the garage, so could not connect to it but sorted this with a newtwork cable.

I installed the emonPi with the other network equipment in the house (20 meters away from the garage, through two 300mm walls, foil back plasterboard and inside a metal cabinet…) and the 2 x emonTx in the garage and it does pick up the emonTx so that is good news!

So would I need to add the 3 phase sketch to each emonTx or just the one measuring 2 of the 3 phases? Presumably the emonPi stays as is?

There isn’t a 3-phase (and especially not a cut-down 2-phase) sketch for the emonPi, though no doubt it could be written. You cannot use the 3-phase sketch as it stands, because you would lose the display and pushbutton functionality.

If you want to measure real power with your emonTx, and more than one phase is concerned, then you need the 3-phase sketch. If you only want apparent power, or you only want to measure current, or only one phase is concerned, then you should not load the 3-phase sketch, but use the standard single-phase one.

Perfect, that sounds even easier!

So I can leave the emonPi as is and could connect CT1 and CT2 to the ASHP indoor and outdoor unit. Use 1 x emonTx on L1 as it is and put the remaining emonTx on L2 and L3 using the 3 phase sketch. So I would only need to calibrate Voltage and Current for L2 and L3 then.

Does that sound about right?

In fact, you should use c.t’s 1 & 2 on L2 & L3 respectively, for better accuracy. At least then, L2’s power calculation will be using the correct voltage. L3 will calculate its power using L2’s voltage, but delayed to suit. You can always call c.t.1 “L2” and c.t.2 “L3”.

I can’t say what is right for you. You are the one who must decide what you want to know. I can only advise you on how to achieve that.

If I set the system up like this;

EmonPi in the garage measuring L1 usage (CT1) and L1 PV generation (CT2) with AC-AC plugged in on L1.
EmonTx in the garage measuring L2 usage (CT1) and L2 PV generation (CT2) with AC-AC plugged in on L2.
EmonTx in the garage measuring L3 usage (CT1) and L3 PV generation (CT2) with AC-AC plugged in on L3.

Am I right in thinking I wouldnt need to change the standard sketch on any of the units? Also, would I need to calibrate them unless I saw I vast difference in the meter reading vs emon readings over time?

Correct.

That depends on the level of accuracy that you’re content with. In ‘Learn’, there’s an analysis of the error you can expect under the worst case conditions. Normally, you can expect better, often much better. In your case, what I’d be tempted to do is put all the c.t’s and a.c adapters onto the same phase, and at least record, ideally adjust, all the calibrations so that all 3 voltages and all currents/powers on all 6 channels read the same. You’d then have a starting point and if you found after everything was installed and 6 months down the line (say) that you were reading 3% low against your meter, then adjusting everything up by 3% in emonhub.conf would be a lot easier than trying to figure out which channel on which emonTx was at fault.

All set up as per my last post. emonPi and 1 x emonTx are both working ok.

At some point during my ‘playing’ I must have uploaded a semi finished 3 phase sketch as it wasn’t work at all. I found the correct sketch and up loaded it and it appears to be working, well the red LED is flashing every 10 secs or so. All powered via the AC-AC adaptor.

This emonTx already had D8 switched on so that it would display along side the other Tx so I did not change this. However, it is not being picked up by the emonPi. I have just tried switching D8 back and restarted the emonPi but still no luck.

Should I try setting the dip switch back again on D8 and reset the emonPi or is there something I am missing?

Are you talking about a 3-phase sketch? If so, from memory, that doesn’t read the DIP switches, so you’ll need to change the NodeID in the sketch. You can easily add that if you like, but it’s unnecessary complication as you must reload the sketch anyway to have the 3-phase version. The DIP switch is really there only to save getting a programmer if you have two standard factory-loaded emonTx’s.

No, I have uploaded the single phase sketch back onto the emonTx in question from here;

So each unit will monitor a phase. 1 x EmonTx on L1, 1 x EmonTx on L2 and emonPi on L3 so no 3 phase sketch required.

When I originally set them up (using a unit for each phase) I couldn’t see the second emonTx so changed the DIP switch D8 to ON and could then see it in the input list. After moving the DIP switch a few times and resetting I still cannot see it this time around. The only thing that has changed is the sketch I uploaded so I am guessing something is wrong here, I didn’t change anything on the sketch, just uploaded it as it was.