element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog RaspiWatt: discover power consumption using a Kill-A-Watt & Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fustini
  • Date Created: 5 Apr 2013 3:24 AM Date Created
  • Views 9999 views
  • Likes 2 likes
  • Comments 33 comments
Related
Recommended
  • rpiintermediate
  • hack
  • raspi
  • ladyada
  • raspberry_pi
  • rpi
  • adafruit

RaspiWatt: discover power consumption using a Kill-A-Watt & Pi

fustini
fustini
5 Apr 2013
imageWant to build this project?
View Parts

 

Say you want to know how much electricity an appliance like an air purifier is consuming?

image

You can hook it up to the nifty Kill-A-Watt power meter (aka KaW).  The KaW will keep track of and display the killowatt-hours, or kWh, used by the plugged in device.

imageimage

However, the total will be reset anytime the KaW is unplugged and loses power.  Limor Fried (aka ladyada) recognized this shortcoming and created the clever Tweet-A-Watt project back in 2009. She modded the KaW into a wireless data logger by soldering a XBee wireless module to the KaW's op-amp chip:

image

image

The XBee's built-in ADC reads the power sensor signals inside the KaW and transmits it to a receiver XBee module connected to a computer via USB.  This diagram by ladyada gives a good sense of the architecture:

image

(source: http://www.ladyada.net/make/tweetawatt/)

 

The Tweet-A-Watt (TaW) is an awesome project, but I felt it's requirement to have a computer receive the data was cumbersome and power hungry.  Thankfully, we now live in an world of powerful, tiny & cheap single board computers (SBCs) like the Raspberry Pi .  I decided to use the Pi in place of a traditional computer.  I also used the Adafruit LCD Pi Plate to display the power usage data. and the Adafruit Pi Box enclosure to protect the Pi (which has a convenient "convertible" mode to accommodate the LCD Pi Plate on top):

image

The receiver XBee module connects to the Pi via a FTDI USB-to-serial cable :

image

Ladyada used Google AppEngine for graphing the TaW data, but I decided to take advantage of the newer Cosm graphing service (formerly named Pachube).  Here is a screenshot of my RaspiWatt Cosm feed showing Watts, kWh, and USD$ (based on the cost of a kWh for my power company):

image

Here is the list of parts I used if you are interested in building your own "RaspiWatt":

 

SKU Qty NamePurpose

53W5739

1Adafruit Tweet-A-Watt starter pack Includes 2 XBee radio modules and adapter boards; components to mod the XBee transmitter; FTDI USB-to-serial cable

07P6545

1Kill-A-Watt P4400 power meter Power meter which the XBee transmitter taps into
44W34651Adafruit Pi Box enclosure Protects Pi and has 'convertible' mode to accommodate the LCD Pi Plate
52W90851Adafruit RGB LCD Pi Plate Displays current power usage; intend to use it's buttons to create simple UI

53W5726

1

Adafruit Stacking Header

to replace the header that comes with the above Plate, it allows the Cobbler to be used
44W34971

Adafruit Pi Cobbler

to connect additional sensors to log to Cosm like temperature, humidity, etc

56T0250

1Full-size breadboard to construct additional sensor circuits
43W53021Raspberry Pi Model B replaces the TaW "traditional" computer

 

You can Add to Cart on Newark element14 all of the above (excluding the Raspberry Pi Model B).

 

My Pi is currently running a Python program named wattcher_cosm.py which is based on ladyada's original TaW wattcher.py program.  bonnie555 has been a big help in developing it for the RaspiWatt project, and it incorporates code from Adafruit's Cosm tutorial and their LCD Pi Plate tutorial.  In future posts, I'll describe in more detail how I assembled the hardware and provide instructions for installing the software on the Pi.

 

Cheers,

Drew

http://twitter.com/pdp7

 

 

 

 

Product Name*DescriptionSupplier
Raspberry Pi Model B Raspberry Pi model BRaspberry Pi
Buy Now
Optical mouse Basic USB optical mouseIONE / Pro Signal
Buy Now
Raspberry Pi Power Supply 120-240v to 5V power supply with micro USB connectorRaspberry Pi
Buy Now
Keyboard Basic USB keyboardGear Head / A4 Tech
Buy Now
Pre-programmed 4GB SD card 4GB Class 4 SD card preloaded with Debian 6 LinuxSamsung
Buy Now
Adafruit Tweet-A-Watt starter pack Includes 2 XBee radio modules and adapter boards, components to mod the XBee transmitter and an FTDI USB-to-serial cableAdafruit
Buy Now
Kill-A-Watt P4400 power meter Power meter which the XBee transmitter taps intoP3 International
Buy Now
Adafruit Pi Box Enclosure Protects Pi and has 'convertible' mode to accommodate the LCD Pi PlateAdafruit
Buy Now
Adafruit RGB LCD Pi Plate Displays current power usage; Buttons can be used to create simple UIAdafruit
Buy Now
Adafruit Stacking Header Replaces the header that comes with the Pi Plate, and allows the Pi Cobbler to be usedAdafruit
Buy Now
Adafruit Pi Cobbler Allows for easy connection to the Pi's GPIO pinsAdafruit
Buy Now
Full-Size Breadboard Allows for easy construction of additional sensor circuitsTwin Industries
Buy Now

 

*Products and resources are listed to help members build their own Pi Projects. For substitutions of any parts, please login to post a question to the original author.

  • Sign in to reply

Top Comments

  • e14 Contributor
    e14 Contributor over 13 years ago in reply to e14 Contributor +1
    FYI, I found out the hard way that you DO need the adafruit xBee shield for programing.
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to fustini +1
    Me too. I was trying to avoid buying more than I needed, as I already had several SparkFun XBee Explorers. My guess is the FTDI vs USB cable. Have you or anyone else set up the COSM code for more than…
  • felixemman
    felixemman over 13 years ago +1
    Hye guys in my case the XBEE didn't work because it was drawing too much power from the KillAWatt and causing the screen to flicker and turn off. I created my own version of the Tweet A Watt using a Moteino…
  • e14 Contributor
    e14 Contributor over 13 years ago

    Excellent info Drew. Thank you again. One more request/suggestion: it would be great to a have link that showed the parts needed to add additional monitors. Is it just the Xbee and Kill-a-watt devices, or is that tweet-a-watt starter pack required for each additional monitor or set of monitors? If the latter, could 1 starter pack plus two kill-a-watts be used for adding two more transmitting monitors? I've been wanting to build something like this for my house for a while. I'm looking forward to getting a better idea of where all my energy usage is going.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fustini
    fustini over 13 years ago in reply to fustini
    # Install system packages
    cd ~/
    mkdir dev
    cd dev
    sudo apt-get install git python-dev python-setuptools python-smbus i2c-tools python-pip
    
    # Install RPi.GPIO module
    sudo easy_install -U distribute
    sudo pip install rpi.gpio
    
    # Install EEML module (for Cosm)
    wget -O geekman-python-eeml.tar.gz github.com/.../master
    cd geekman-python-eeml*
    sudo python setup.py install
    
    # Active kernel modules for i2c (for LCD Pi Plate)
    for Raspbian users, edit /etc/modules:
    sudo nano /etc/modules
    
    and add:
    i2c-bcm2708 
    i2c-dev
    
    sudo i2cdetect -y 0 (if you are using a version 1 Raspberry Pi)
    sudo i2cdetect -y 1 (if you are using a version 2 Raspberry Pi)      
    This will search /dev/i2c-0 or /dev/i2c-1 for all address, and if an Adafruit LCD Plate is connected, it should show up at 0x20
    
    # Install Adafruit library for LCD Pi Plate
    git clone github.com/.../Adafruit-Raspberry-Pi-Python-Code.git
    cd Adafruit-Raspberry-Pi-Python-Code
    cd Adafruit_CharLCDPlate
    sudo python Adafruit_CharLCDPlate.py
    --------------
    If you have a rev 2 (512MB) Pi, or if you're not getting anything displaying, it might be due to th I2C bus number change in the Pi hardware. Edit Adafruit_CharLCD.py using a command like "nano Adafruit_CharLCD.py" and change the line
    lcd = Adafruit_CharLCDPlate(busnum = 0)
    to
    lcd = Adafruit_CharLCDPlate(busnum = 1)
    --------------
    
    # Install Tweet-a-Watt code modified for the RaspiWatt project
    git clone github.com/.../Tweet-a-Watt.git
    cd Tweet-a-Watt
    PYTHON_PATH=$HOME/dev/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate sudo python wattcher_cosm.py
    
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fustini
    fustini over 13 years ago

    The following instructions to install the RaspiWatt software on the Raspberry Pi are based on these references:

     

    Send Raspberry Pi Data to COSM: Necessary Packages

    http://learn.adafruit.com/send-raspberry-pi-data-to-cosm/necessary-packages

     

    Adafruit 16x2 Character LCD + Keypad for Raspberry Pi: Usage

    http://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage

    Tweet-a-Watt software:

    http://www.ladyada.net/make/tweetawatt/software.html

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fustini
    fustini over 13 years ago in reply to e14 Contributor

    Yeah, it's just running ladyada's Tweet-A-Watt python code like the PC would have done in the original design.  It's been modified to do some new things like display data on the Pi Plate LCD.  The bigger change is going from ladyada's custom AppEngine webapp to Cosm for data logging and graphing.  The twitter code has also been removed since I didn't want it for this project (it could be added back in though based on ladyada's original code).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • e14 Contributor
    e14 Contributor over 13 years ago

    Awesome project. I'm interested in building this one. I already have a Pi and a Kill-a-Watt meter so I partway there. One question: is the Pi taking the place of the computer in Ladyada's schematic and able to receive info from multiple meters?

     

    Thanks for posting this. I'm looking forward to the more detailed how-to posts.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube