Diversion of Surplus 3-phase Power

During the last couple of years, several forms of my single-phase "Mk2" surplus power diverter have appeared on this forum.  This code can be run on various standard platforms such as the Arduino Uno or the emonTx.  More recently, I have developed my own PCB-based hardware which is available via my website at www.mk2pvrouter.co.uk

I have also developed a PCB which allows full monitoring of energy flow within a 3-phase environment.  In a 3-phase environment, the user is generally charged for their net consumption across all three phases.  By having just one processor which knows about the flow of energy on all of the phases, any surplus power can be accurately assessed and diverted for some useful on-site purpose.

3-phase diverter code of this type has been successfully running in the field for some months.  From today, that code is available via the Downloads page of my website, and a copy is attached to this post.

This code is intended to be run on my 3-phase PCB, details of which can be found on the 3-phase page of my website.  With a separate dual-secondary mains transformer for each phase, this PCB avoids the need for any extra adapters.  A circuit diagram for this PCB is attached. 

This 3-phase code could also be run on any Arduino-type platform which provides access to all six of the analog ports on the Atmega 328 processor.  Because the emonTx only has a single sensor for AC voltage, this code is not suitable for that platform.

My 3-phase diverter code has its roots in various single-phase "Mk2" sketches.  The 6-way sampling sequence is an extension of the 3-way one that's in Mk2i_rev6 where an extra analog channel was used to measure the amount of current that has been diverted.  The ability to control multiple loads has been taken from Mk2i_rev5 including the single-threshold AF algorithm which is well suited to a multi-load environment.  The RF datalogging mechanism is similar to that in Mk2i_rev6.  Average power and Vrms data for each phase is regularly sent to the Serial monitor, but is only transmitted by RF if the literal RF_PRESENT is included.

This code is based on the premise that 3-phase users are charged according to their net use of power across all three phases.  As with its single-phase equivalent, the 3-phase diverter relies on there being a small range (aka "sweet-zone") where energy can move to and fro across the supply meter without penalty.