Thom Nichols


Technology is evolution outside the gene pool

Home automation with is a demo I created that parallels in many ways the work I do during my day job: push-based device control and telemetry. a web app and client software that let you monitor environmental sensors (in this case temperature, light and occupancy) and also allows toggling relays.  It also uses technology that is accessible to the average joe: Google AppEngine for the UI, the Raspberry Pi as the hardware gateway and the Arduino for the low-level sensor control. (I am tempted to also add XBee support for multiple sensor clusters but that will wait for now.)

There are two particularly interesting things about this project: (1) the main UI runs in the cloud, which makes it easily accessible without static IPs, firewall rules and NAT traversal, that you would typically need if you ran a UI directly on the Raspberry Pi, and (2) it is entirely push-based, from cloud to device and vice-versa.

Here's a block diagram of the system:

There are a couple technologies that I'm leveraging to accomplish the "push" features of the application.  First, AppEngine's Channel API allows me to send real-time telemetry from the cloud to the client.  Second, I'm using AppEngine's XMPP support to allow the cloud app to push commands to the Raspberry Pi without it needing to poll the server.  When I click to toggle one of the relay buttons, the response is nearly instantaneous.  And if I cover the ambient light sensor or wave my hand in front of the PIR, it updates on the client UI immediately. 

Finally, the app also takes advantage of Google's built-in authentication.  So the account you login to on is the same account that would use for the Google Talk (XMPP) credentials on the Raspberry Pi, which makes setup considerably easier.  Conceivably, anyone could use the actual app running at since they will only see their own devices.  In practice though, I don't really expect that to happen long term since AppEngine's resource limits for their free tier aren't tremendously high :)

Check out the code, including schematics for the Arduino sensors on Github!

(Comments are closed)


  1. avatar Re: Home automation with April 12, 2013 Luis

    Hello Thom,
    Thanks for sharing such a great project.
    I have a very small "weather station" (uploading to in which I am using the RFM12b tranceiver for communications between the remote sensors and the Arduino. These transceivers are cheaper than XBee and allow me to run the remote sensors for over 6 months with only 2 AA batteries.
    Theoretically, I am thinking in a platform like this for some time now, but didn't know where to start. It would allow me to learn Python and GAE, technologies that I want to learn.
    Thanks for sharing!
  2. avatar Re: RFM12b May 2, 2013 Thom

    That's awesome!  I'd love to build on the idea and use XBees or RFBees to extend the Raspberry Pi as a base station to pull in remote sensors as well.  Somewhat inspired by OpenEnergyMonitor but admittedly I don't like that their front-end is all PHP :)

    Coolest thing about the RFBee is, if you already have a regulated power source, you could re-use the ATMega uC on the RFBee for both the data collection and transmission.  But the RFM12b is a great low-cost option when paired with a 'duino.  Actually I'm a bit surprised nobody has made a custom Arduino with a drop-in slot for an rfm12b (similar to this.)
  3. avatar Re: Re: RFM12b May 7, 2013 Luís

    You're completely right.
    The rfm12b 'duino integration should be greater!
    Fortunately, there are fellows like Nathan, that designed an awesome breakout board for that matter, and I personally can attest that they fit like a glove.
  4. avatar Re: Home automation with May 16, 2013 Joachim Lindborg

    Very interesting if you could add a standard XMPP server between the App Engine and the aurduino and implemented the IOT xeps just published you would have a very generic visualisation tool to any IoT sensor on any domain.