energymonitor
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | energymonitor [2016/04/08 09:25] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== House Energy Monitor ====== | ||
+ | |||
+ | ===== Hardware ===== | ||
+ | |||
+ | |||
+ | This topic details a mini project using the [[http:// | ||
+ | |||
+ | {{05072008.jpg? | ||
+ | |||
+ | EON have being given them away " | ||
+ | |||
+ | I noticed that on the bottom was an RJ45 connector, after a bit of Googling, I found [[http:// | ||
+ | |||
+ | So using Chris Hand's infomation, the interface on the RJ45 is: | ||
+ | |||
+ | * orange/ | ||
+ | * orange | ||
+ | * green/white (pin 7, data in to CurrentCost) | ||
+ | * blue (pin 4, ground) | ||
+ | * blue/white | ||
+ | * green | ||
+ | * brown/white | ||
+ | * brown (pin 8, data out from CurrentCost) | ||
+ | |||
+ | The level is 3.3v TTL so cannot be connected directly to an RS232 port, however I don't have one of them free anyway, so I used a USB to TTL 3.3v [[http:// | ||
+ | |||
+ | Using an old Ethernet cable for an RJ45, connecting the USB to serial convert to the RJ45 connector was easy: | ||
+ | |||
+ | {{05072008_003_.jpg? | ||
+ | |||
+ | |||
+ | Just connect the pin 4 (blue) of the RJ45 to pin 1 (black) on the TTL-232R-3V3 and connect pin 8 (brown) of the RJ45 to pin 5 (yellow) on the TTL-232R-3V3. If I get time I will make a better cable, but for now this works. | ||
+ | |||
+ | |||
+ | ===== Software ===== | ||
+ | |||
+ | When the hardware connected, I used Minicom to check that it was working. There are two version of currrentCost available, one that runs at 2400 baud, and one that runs at 9600. Mine was a 9600. | ||
+ | |||
+ | The device spits out XML data every 6 seconds. You do not need to request data. | ||
+ | |||
+ | I wrote a simple c program to read the XML stream and convert into a CSV file that gnuplot can understand. | ||
+ | |||
+ | The code can be found {{energymonitor.tar.gz|here}} | ||
+ | |||
+ | This application runs on my Linux server and reads and converts the XML stream into the CSV file, I also have a cgi script to convert the CSV file into a picture. | ||
+ | |||
+ | * {{powergraph.cgi.txt| Plotter Script }} | ||
+ | |||
+ | This is an example plot: | ||
+ | |||
+ | {{powergraph.cgi.png? | ||
+ | |||
+ | |||
+ | [[LatestReadings]] | ||
+ | |||
energymonitor.txt · Last modified: 2016/04/08 09:25 by 127.0.0.1