Last week I was fortunate enough to pick up a Pebble watch – a neat smartwatch featuring a 1.26 ePaper display, a Cortex-M3 ARM microprocessor, 3-axis accelerometer and a bluetooth connection to iOS and Android devices.
I picked up a grey model for roughly £100 which isn’t a bad price in the grand scheme of things considering you can have multiple watch faces, receive notifications from your phone or even control your music – but the thing that got me the most intrigued is the ability to write your own Apps.
Immediately I thought that the Pebble would be great to remote control my central heating at home.
This isn’t something that is new in my house, I have been able to remotely turn on/off my heating since 2011 when I built a simple web application using an Arduino and an ethernet shield which controlled a relay – thus turning the heating on or off – great for when you’re on your way home from work (the the pub!) on a chilly night. The current system only works on a manual control – with no thermostat or schedules.
Making it so that my Pebble could control the system is something that I think is very cool – maybe gimmicky, but cool.
I first of all did some research online, and it didn’t take me long to find httpebble – an iPhone application which allowed your Pebble to make HTTP requests via your iPhone’s internet connection. All that seems nice and dandy, but I’ll just have to create a web interface that httpebble understands. But wait, that could be tricky using something like an Arduino – a device with just 32KB of ROM, with huge overheads for just running a web server. I needed something with the ability to provide GPIO, be low power, and cost effective. I immediately thought of the Raspberry Pi.
Now, if you haven’t heard of a Raspberry Pi before, I will assume you have been living under a rock for the last year – but let’s recap. It is a £28 computer featuring a low power 700MHz ARM11 processor with 512MB of ram, 8x GPIO and uses just 3.5W of power. Best of all, the Raspberry Pi can run Debian, meaning I can take full advantage of Apache, PHP and MySQL!
I have had a Raspberry Pi stuck in my drawer for a while, so I essentially had all the pieces required to get the project moving! I have now get the Pi setup running Raspian with LAMP (Linux, Apache, MySQL and PHP) and with the help of php-gpio, I can control the Pi’s GPIO pins securely via PHP!
Moving onto the Pebble side of things, I have managed to install the Pebble SDK, and started to think about how I want my Pebble application to look like – I came up with the following design using static data:
This interface was mostly based off the simple menu layer example provided in the SDK – the ‘Modify’ menu will allow you to turn the heating on/off for either 30 minutes or 1 hour. The ‘Refresh’ button will refresh the status.
So that’s where I’m up to, as of 22:45 on Sunday 8 Sept 2013. I’m hoping to get a lot more done in the next week – stay tuned for more updates!