[Dave’s] been elbow-deep in mains voltage while building this home energy monitoring rig. He started with an approach that is different from most we’ve seen before. He wanted a system that could make a linear measurement to keep the accuracy as high as possible. His first thought was to use a opto-isolated linear amplifier to measure voltage, but ended up altering that plan since he’s looking for digital values when all is said and done.
He’s using an ADC on the mains side of the interface board, then sending the digital values to an Arduino with opto-isolators to keep the high voltage separate from the low. This does complicate things a little bit, as he has low voltage rails on either side; 0V and 5V to run the ADC on the mains side, and separate 0V and 5V to run the Arduino. To solve the problem of accurate current measurement over the full range a house uses he opted for a Programmable Gain Amplifier. It’s addressed via SPI and allows him to adjust resolution to facilitate accurate measurement of very small currents. We think anyone who has tried to measure small appliances (like an alarm clock) with a Kill-A-Watt and gets a zero reading will appreciate this.
The Arduino sends data via a serial connection, which [Dave] is currently graphing using his laptop. It would be nice to see a simple web-server using the Ethernet shield (or a different board like the RPi) so you could log in from the couch and see what’s been going on with your home grid.