YAEULS - Yet Another Electricity Usage Logging System

After a few relatively high electricity bills I wanted to get a bit of a grip on my electron usage.

My electricity meter has a LED that blinks every Watt.Hour.  At a use of 3600W it will give one blink/second.
The highest possible usage is about 8000W  based on a main-fuse of 35A@230Vac.

I'm using arduino as a solution, maybe in the future I will switch to a Raspberry-PI.

I used the following parts :
-  Arduino Ethernet
-  Photodiode sensor PCB. (dealextreme)

With the above setup I can Log measurements to a memory card, or send the data to a PHP/MySQL system using ethernet.


 Ethernet Shield with Wiznet W5100 Ethernet Chip / TF Slot  
1-Channel Photo Diode Sensor Module for Arduino - Blue
  
led setup on energy meter


Relevant Arduino Libraries :   Ethernet                          http://arduino.cc/en/Reference/Ethernet
For timing we can start with using :    millis()                 http://arduino.cc/en/Reference/Millis
Relevant Arduino Functions:
We will use interupts for reading the pulses from the photodiode :
attachInterrupt()      http://arduino.cc/en/Reference/AttachInterrupt
interrupts()             http://arduino.cc/en/Reference/Interrupts


Internet of things logging provider Cosm:
To store the measurement results it seems to be quickest to use one of the many 'internet of things' logging servers.
I started with Cosm (pachube) for which you can see the results below.



After a few days you can clearly see your fridges, coffeemachine, cooking, TV, computers, etc
But I must say that the functionality quickly becomes limited at Cosm if you want to do something more with your data.

Internet of things logging provider Cosm:
I'm checking out other providers like sen.se.
They seem to have way more features but limitations become clear after a while.
SenseBoard at Sen.se



Arduino Sketch for use with COSM : (discontinued)
Rev 1000
I've been the code below now for a few months,  https://cosm.com/feeds/83680
It has some jitter on the measurements.
Rev 1001  - 19Jan'13
Fixed jitter in the measurement results, was due to sometimes getting an interupt on the low->high flank of the signal.
Added a simple check in the interupt routine which seems to solve the problem.
The code has been tested with a pulsegenerator.
Rev1002  20Feb13  : Added second datastream , keeping track of cumulative kwh
                               Stream is called : kwh_stream,      renamed YAEULS to: watt_stream
Rev1003  21Feb13  : Content-Length +=2 chars for newln in wattdata stream




Arduino Sketch for use with Sen.se :
Rev 1001  Todo List
  - It would be better not to send the kwh stream every minute, since graphs on sen.se are limited, change code only to upload when new kwh point available.
Rev 1000  First version
http://open.sen.se/sensemeters/tab/3868/






... Updated on 12Apr13,   added sen.se   .... 

Keywords: arduino power electricity usage photodiode logging Cosm
https://sites.google.com/site/arduinodueatmelstudio/home
https://sites.google.com/site/arduinofocus/home
https://sites.google.com/site/taiglathe/
https://sites.google.com/site/openlogicsniffer/home/arduino_spi_frame