Mains AC: invasive method electronics
Caution: The circuitry below involves wiring up to high voltage mains electricity. Improper care could result in a potentially fatal electrical shock. When working on this circuit make sure the device is unplugged from the mains socket. The design is distributed in the hope that it will be useful. I take no responsibility for any damage to equipment or injury or death caused by following the information here. If you accept, great! please continue.
Note: I have recently had a bit of trouble with the hcpl-7520 optoisolators blowing, not sure why yet, it could possibly be a recent change of power supplies. Ive created a discussion page here detailing my attempts to find out why.

Hardware Design Considerations
To calculate power using the invasive method we need to first measure the voltage and current in the mains supply, to read more on how power is calculated have a look at the Measuring Power page.
Voltage Sensing
Using a voltage divider connected directly between the live and neutral wires to measure voltage.
Current Sensing
Using a current sensing resistor to measure the current flowing in the mains supply.
Isolation
For safety we isolate the electronics connected directly to the mains wiring from the Arduino and computer.
Arduino
Details of how we connect the above to the Arduino and the firmware required for processing.
Bill Of Materials
Bill of Materials is available as a published google documents spreadsheet here.