Automating household devices with Google Calendar

[Shane] is building a new house and wants some, “subtle home automation” as he calls it. His first project is hooking up a small heater to the Internet, and judging from his demo video everything is going swimmingly.

[Shane]’s project is built around an mbed microcontroller that connects to the Internet via an Ethernet connection. The mbed has a temperature controller and a solid state relay to turn the heater on an off; simple enough, but we really like how easily [Shane] connected his project to Google Calendar.

After looking over the Google API, [Shane] was understandably overwhelmed. He figured out that by syncing the mbed’s clock to network time and sending a GET request for one minute in the future, the mbed would always know what was scheduled with a minimal delay.

Now, all [Shane] does to turn on his heater is schedule a time and temperature in Google Calendar. He can do this from across the globe or country and makes for a really slick part of a home automation system.

[youtube=http://www.youtube.com/watch?v=NlhNqCOUpZ4&w=470]

Comments

  1. jukus says:

    I really enjoy the simplicity of the user interaction for this

  2. jamen lang says:

    I would love to see the code he used for this, I use gcal that runs a cronjob to control my sprinkler system, I’d like to get it all running off of a microcontroller at some point, but I’m logging everything to a database and doing other things like checking temperature/forecast to see if it’s going to rain tomorrow as well. So I guess I’ll put that on the backburner.

    • fightcube says:

      Really good idea… wish I had a sprinkler system as well.

    • Shane says:

      Hey Jamen,

      I’ll post the code on the the blog in the next day or so, just need to tidy it up.

      Re: your sprinkler idea, I’ve already got an mbed doing this. It checks the forecasts and the local rainfall (from a neighbour’s web connected weather station up the road) and determines how long to run the sprinklers for. I was going to write that one up and submit it next week. Race ya! 😉
      One thing I wanted to add was to delay a watering if the wind speed is too high because it gets very windy here and the other day it turned on and washed my car rather than watered the garden.

      🙂

  3. fosselius says:

    “He figured out that by syncing the mbed’s clock to network time and sending a GET request for one minute in the future”

    That sounds “optimal”.. 1h buffer?

    • Shane says:

      2 reasons why I poll the API every 30 seconds rather than buffering it in blocks:
      1. I’m not a very good C programmer and this way is easier
      2. I wanted it to respond to changes of the temperature and schedule immediately.

  4. i really want to look at the code of this, i have a cortex-m4 development board with WLAN and Ethernet on it so i can do so many things with this board n google!
    please share the code.

  5. dopey says:

    I love the project, but this sadly falls into the category of ‘cloud based misadventure’ when it goes pear-shaped.

    Client-Server and Socket based remoting have been around for years, but are still dependent on the hosts lawyers, and the guy that fixes your cable or telephone jack for it’s reliability. Not where I’d be putting all my eggs.

    P.S I do the same thing – using an extra calendar on my Outlook client.

    For non-critical activities – like watering the garden on odd occasions or filling the dog bowl for a couple of days – fine, but remember the fundamentals behind ‘CLOUD’ ase ‘Centralized Lock On User Data’… and ‘SOCKETS’… ‘Some Other Controller Knows Every Thing Said’…

  6. Shane says:
  7. simonvpe says:

    I got inspired by this and made a google calendar based task scheduler. I published the source code on my webpage. Check it out @ http://simonslinuxworld.blogspot.se/2012/04/google-command-line-tools-google.html

    Simon

Speak Your Mind

*

Related Hacks in Microcontrollers

  • Morse Code interpreter
  • One wire reads the keypad from the APRS radio mic
  • Level conversion with plenty of options
  • Music visualization generator with a Propeller
  • Metal detection using an inductor instead of a clock crystal.