Modified Kill-a-Watt based on Lady Ada's Tweet-a-Watt with the addition of an Arduino Ethernet.

Download .zip Download .tar.gz View on GitHub


To set up the Xbee and Kill-a-Watt connection, I followed the instructions by Lady Ada exactly, using the kit from, except that instead of using analog inputs 0 and 4 on the transmitter, I used A0 and A1. However, because of the close proximity of the resistors going into one hole, I used A4, but then routed it to A1 using a jumper wire underneath. Also, on the receiver, I used vertical male headers, and only connected them to the pins I needed to connect to the Arduino, in order to make it easier to use female-to-male jumper wires for the connection.

To connect to the Arduino I hooked up the ground and 5V pins from the Xbee breakout board to the Arduino, and hooked up TX to a Software Serial pin (I used A0 because of physical location).

Download my Bill of Materials from here: Bill of Materials.
All the documentation and instructions for the original Tweet-a-Watt project can be found here.

Python Script Modification:

Before moving on to the Arduino part of my project I wanted to test the direct Xbee connection to the computer with Lady Ada's python scripts. After downloading Lady Ada's python scripts I found that it was rather difficult to get the Twitter libraries installed on Windows. In order to fix that problem, since I was not concerned with tweeting in my project I just deleted all the lines referencing that library.

Arduino Software:

I wrote code for the Arduino to receive data over Xbee, parse it, convert it to actual volts and amps, average it, and send it over Ethernet to a server. I used the website, formerly, which, with the help of some of the Arduino example code, graphs the real time and historical data online.

For the serial parser functions, the original python code was very helpful, as was the online manual to the Xbee (Xbee Manual), but when it came to actually calculating the voltage, current, and power from the raw ADC data, I used my own methods. It should be noted that the Xbee only sends data for the inputs that are active. So in this case, no digital data was sent, only 2 analog channels.

The ADC data coming from the Xbee are 10 bit numbers between 0 and 1024, where ideally 512 is equivalent to 0 volts/amps, but that is not always the case. After receiving the data and isolating the ADC values, which are what we care about, they need to be converted to volts and amps. To do so for both volts and amps, I first calculated the digital number which would correspond to zero, and subtracted that from each sample. Then using trial and error, I found a constant which I divided each value by (different for volts and amps). Then I used those samples to calculate the RMS voltage and current. To calculate apparent power I multiplied them, and to calculate real power, I multiplied each individual sample, and took the mean of that. I calculated a moving average for each of those to smooth out the data.

Lastly, the Arduino sends strings to which include a PUT request header, and the actual data in .csv format.

The real time graphs can be viewed at To view the most recent data please refresh the web page.

For the future:

In the future I plan to add support for multiple transmitters, try to make the data more accurate, calculate the checksum of the Xbee data, and also to write a program to download historical data from


I used the Arduino Ethernet, SPI, Software Serial, avr, and avr/wdt libraries. The hardware is based on the Tweet-a-Watt kit from The code is based on Lady Ada's python script but with some important modifications as explained above.


Feel free to contact me with any questions about the project and its setup or license by email at!
Videos and blog posts for the project can be found at the Blue Stamp Engineering Website.