I should start off saying this project has been so fun to do, and it has had some really positive outcomes so far. That said, I still have a way to go to get the system where I’d like it. Partly that is due to me wanting to fiddle with everything, but partly to simplify things. So far I have setup a system to monitor 3 phase usage, as well as 3 phase solar generation. I made some minor wiring changes so that everything in the house goes through a central fuse box, and have mounted an Emon box next to it. The emon box contains 3 x EmonTX v3 – one for each phase. So, each card has a clamp for use, a clamp for solar, and an AC adapter for voltage. They all wirelessly connect to a raspberry Pi in the same box, which is setup to use a USB HDD. This was all pretty straight forward, with the only drama being broken aerials at the solder joint, which are a pain to resolder (a spot of hot glue keeps the aerials in place). The EmonCMS system was easy to setup, with dashboard showing everything to an accuracy of 1% (compared to the solar inverter after several weeks). The only other item I’d add in the dashboard is variable time tariffs, to be able to calculate costs. In Australia we currently sell for 8c and purchase at a variable rate between 17 and 33c, depending on time.
Unfortunately the system stopped receiving data after about 4 weeks, with the only solution to repower everything (every few hours). I am presuming it is the receiver on the Pi, as the Pi is still downloading weather data from the web and working normally, and all 3 emonTx’s (plus a remote) can’t have failed at once. This has started me down the 2nd phase of the project – getting the Emontx’s hard wired to each other and the Pi. As they are all in the same box, they don’t need wireless. The plan was to use Martin’s idea of connecting the TX’s with I2C, and then connect the master to the Pi via serial, either by RX/TX to GPIO via a logic level converter, or uART to USB to Python Link. I am now a bit stuck. I2C uses 2 ports, one being SCL which is D19 or A5, which is on the terminal header, and easily connected to stacked emontx’s.
However, I can’t find the SDA connection, which is D18 or A4 – does anyone know how to connect this to stacked boards?
Also, I have been fiddling with the arduino program, and have a pretty good idea how to manage the I2C data thanks to Martin’s examples. However, on the master that will talk to the Pi via serial, I am trying to replace the RF section with serial outputs, and am just ending up with hieroglyphics, although the existing serial debug prints still work okay. Any code example to show this serial comms would be helpful.
Thanks
Re: 3 Phase plus solar, want to hard wire
On the v3 SDA is used for the 4th CT channel
http://wiki.openenergymonitor.org/index.php?title=File:EmonTx_V3.2_PortMap.png.
I've been experimenting with I2C recently, I'm using the raspberry pi as the master running a python script which polls the boards and forwards the data to Jerome's oem_gateway via a socket (work in progress).
If you are using the oem_gateway you should be able to just edit the existing serial output in the sketch to send a string starting with your node id followed by each value variable eg
Serial.print(node_id); //create a variable or hard-code
Serial.print(" ");
Serial.print(val_1)
Serial.print(" ")
Serial.Print(val_2)
etc etc and the gateway should do the rest
http://openenergymonitor.blogspot.co.uk/2014/01/oem-gateway-serial-port-emoncms-link.html
Also you shouldn't need a level converter to connect to gpio as emontx's actually operate at 3.3v despite being supplied with 5v. having said that if you leave the serial lines connected to the gpio and then connect a 5v ftdi programmer you could have trouble.