The Queen's Solar Design Team, in collaboration with the Queens Applied Sustainability Group hopes to modify a typical consumer power meter to provide live internet monitoring and recording of residential power consumption.
Introduction[edit | edit source]
With today's rising prices in energy more attention has been towards energy conservation. Manufacturers are now trying to create green versions of their products that utilize less energy. Green options can sometimes be more expensive than their more energy hungry counterparts. Power monitors can help you reduce your energy consumption by identifying phantom loads, by helping you reduce your power consumption, and by helping quantify the savings you could make by upgrading to energy efficient devices. Commercial power monitors can cost upwards of 500 dollars. Fortunately a much cheaper alternative exists. Using a plug-in power meter such as a Kill-A-Watt, while less accurate than a commercial power monitor, can provide useful data at a reasonable cost. You can retrofit a Kill-A-Watt with a ZigBee wireless transmitter to create more functionality. For this we will be using Adafruit's Zigbee adapter receiver (not covered here please see  for more information ) and transmitter which uses the popular XBee module by Digi. You can look at the pachube page for this project @ http://web.archive.org/web/20120508020316/https://pachube.com/feeds/8383/.
Check out our live power feed from our office power meters at qsdt.org
Kill-A-Watt[edit | edit source]
In this demonstration we will be using a Kill-A-Watt meter. We will be receiving current and voltage data from the Kill-A-Watt's Op-Amp which will then be wirelessly transmitted using the Zigbee module. You can use other power meters but you cannot know if it will work unless you open it and examine it as the op-amp may be different. As an added justification for using the Kill-A-Watt, this particular power monitor's size is excellent to house the ZigBee unit.
The ZigBee RF chip has an embedded micro controller which allows you to do some simple operations without having to program a micro controller. The software provided by Digi X-CTU allows you to change variables such as sleep timer easily. Unfortunately, it also limits you, without a third party micro controller you can't insert nonvolatile memory. As a result if there is a power outage a portion of your data will be lost.
The XBee unit receives it's power from the Kill-A-Watt. Unfortunately the current received is lower than required to run the Xbee and as a result a large capacitor is used to account for the current needed. The C1 and C2 is to provide a constant voltage to the 3.3V regulator and C3 capacitor on the reset pin of the Xbee will help delay the transmitter to allow the other capacitors to charge up again. The voltage divisor is used to decrease the sensors inputs received from the Kill-A-Watt at 5V to 3.3V. The last resistor is used to power the LED.
In this demonstration we did not create our own circuit board but instead used one that was meant for the receiver. Creating your own transmitter circuit board will greatly increase the speed and simplicity of putting this together.
Parts List[edit | edit source]
|Material||Quantity||Approximate Cost ($ USD)|
|Xbee Chip (XB24-AWI-001 or XB24-ACI-001)||1||$20|
|3.3V linear voltage regulator, 250mA current (MCP1700-3302E/TO)||1||$0.415|
|220 uF capacitor||1||$0.189|
|100000 uF capacitor||1||$1.085|
|0.1 uF capacitor||1||$0.302|
|1/8" Heat Shrink||1||$1.62|
|PCB Board ||1||$5|
All resistors listed are 1/4W and 5%, the total cost is approximately $52 for one Kill-A-Watt.
Programming the XBee Unit[edit | edit source]
Using the host controller we programmed each XBee unit into a transmitting mode using the X-CTU software provided by Digi. You must change these options within the program:
1. MY address to 1 increment this with every transmitter added. 2. SM to 4 (Cyclic Sleep) 3. ST to 3 (3 milliseconds timer) 4. SP to C8 (Hexidecimal value for 2 seconds between transmits.) 5. ADC 4 D4 to 2 (Enable pin AD4) 6. ADC 0 D0 to 2 (Enable pin AD0) 7. Samples to TX IT to 13 8. Sample Rate IR to 1
Construction[edit | edit source]
I decided to use the PCB board created for the XBee host controller by adafruit this saved some time in creating a new PCB board and also using just a breadboard.
Program[edit | edit source]
Note: You can skip this entire section and use a third party program EnergyLogger (http://www.miloslick.com/EnergyLogger.html) It does have some limitations, such as that calibration is less accurate and does not have pachube support at this time. It can twitter the energy usage and also upload your data into a spreadsheet in google docs. I will not be covering how to use this program here.
You are able to use any almost any programming language to communicate with the Xbee unit. Most popular programming languages have third party APIs for the Xbee. I am going to be using the open source language python python, as the code is readily available, free and will save time. I added support for two meters to adafruit's original code  and Brian Naughton's modification for pachube . The modification will average the data received from both power meters into two separate variables and upload it to pachube. Without the modification the program would combine the average into one variable which I feel provides less useful information. In the following steps I will demonstrate how to modify the code for your own power meter.
You will have to install quite a bit of new software:
- python version 2.5 http://www.python.org/download/releases/2.5/,
- pyserial http://sourceforge.net/projects/pyserial/files/pyserial/2.4/,
- win32file http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063,
- simplejson http://pypi.python.org/pypi/simplejson,
- and the python code which includes the python-eeml needed by pachube http://www.2shared.com/file/VbPR3p89/Python_Power_Meter_Code.html
- (extract the files into a new easily accessible folder on your root C:/ folder or Desktop Note: If you only have one power meter hooked up use the original pachube-tweetawatt code from Brian Naughton you can find it here: http://web.archive.org/web/20130509103255/http://naughtorious.com/files/pachube-tweetawatt.py
Troubleshooting and problems encountered[edit | edit source]
Most of the design was straight forward but I did come across several problems when adding multiple Kill-A-Watts also the new Kill-A-Watt revision did not make things easy either.
Software[edit | edit source]
One of the problems I encountered with the software was to find a good website to host the data. Google powermeter was my first choice but it did not allow me to share the data publicly. Instead it required every person who wanted to see the data to be invited. The next website I found was Pachube, it was a very straight forward website and allowed me to publicly share the data. Problems did arise when multiple power meters were added. The original program was written for only one power meter. The modification above was necessary to account for this challenge.
The new Kill-A-Watt revision did not allow a simple way to route the wiring around to the other side. A notch was needed to be made on the PCB which was risky as a wrong move could break a connection. Another problem that I came across was calibration. It appeared that the Kill-a-Watt's ampdata reference numbers were drifting with time. I came to the conclusion that it was due to the wiring onto the Op-Amp and it was creating a connection with something it shouldn't of. It was also very hard to fix the problem as the Op-Amp was surface mounted onto the PCB board.