Home automation from 50 miles away – with a Raspberry Pi

Simon Maple and Andy Stanford-Clark, Friends of Pi from IBM, have been having a lot of fun with Andy’s house, which is networked and monitored up to the rafters. They’ve added a Raspberry Pi, IBM’s Liberty Profile, and Really Small Message Broker for sending telemetry-type data using MQTT. The result is a great little tech demo where Simon turns Andy’s pond fountain and heated towel rail on and off remotely from his own house 50 miles and a stretch of sea away, watching energy usage fluctuate in real time; he can even check the levels in Andy’s oil tank. This is brilliant: lightweight software running on lightweight hardware, doing some really useful stuff.

I do not think I’ve ever found a towel rail so interesting; I love seeing demos like this with so many real-world applications.

Massive thanks to Simon and Andy for all their work on this (there’s more on Simon’s blog), and especially to Simon for being such a fantastic pi-vangelist. Everybody else: if you’re reading this and have come up with a Raspberry Pi demo you think we’d be interested in, please email me (my details are available on the Contacts page). We’re always looking for new projects to feature here on the blog.


Richard Clark avatar

Looks great, i am looking at building a Solar Water controller which will read several temperature sensors and turn on a pump while powering a webpage with the data in real time and showing a historical record.
I still need to find a sensor to read the pressure inside the system though !!

Wombat avatar

Richard, when you find a water preasure sensor let me know, I need on as we have had several big leaks and the only way i can detect them is taking daily water preasure readings (we have a 1/2 mile private pipe run from the mains). I have been looking for one for several years, so far the cheapest one is in the order of 200 squid!

NB I currently use a Arduino to do the job you are planning to use the Pi for.

Richard Clark avatar

I have been using my Arduino for my little robit platform but studdy has got i the way of Arduino play. A cheap water pressure sensor is my current quest as i sometimes loose pressure and having the capability for the RasPi to send an alert via the internet etc would be great.

Lars T. Hansen avatar

I had found some pressure transducers here:

For the interested reader:
You will need to understand how to build analogue electronics to interface with the sensor. That amplified analogue output signal goes to an A/D converter. The A/D converter is usually build into a micro-controller.

Note that you cannot do real-time computing out-of-the-box with the Pi, so you will need an inexpensive(1) micro-controller to do the real-time stuff.

fx. an Atmel AVR ATtiny 2313A-PU http://uk.rs-online.com/web/p/mikrokontroller/7194058/ costs £1.54 / qty 2

Wombat avatar

not sure how to connect that to a water pipe, Im looking to replace the analoge heating system preasure meter that i conect to my outdoor tap to check for preasure loss and hence a leak on the long run from the main.

Richard Clark avatar

I think this unit will be the right one and only £40 not the normal USD 500 ish

http://www.omega.co.uk/ppt/pptsc.asp?ref=PX40 model PX40-15G5V

Interested to know if anyone has experiance with these units.

Mark avatar

I’ve measured water pressure using a cheap (<£10) sensor without problems.

Any pressure sensor (such as the ones above) should work. In order to work properly the sensor must be sealed so liquid would only compress the air in the connecting pipe, not travel up it into the sensor.

Physical connection is just a matter of plumbing but RS and Farnell stock literally thousands of suitable parts.

You may even be able to read it direct from the RasPi since you just need a compatible interface; i.e. 40mA analogue or some kind of digital. Speed is not an issue since you are unlikely to want to take a reading more than once a second. (Probably a lot less than that unless you want to run out of storage quickly!)

Peter avatar

you could put a air pressure gauge in a balloon, fill it up with air, put it in the tank of water and the wight and pressure of the water will press down on the balloon, causing it to shrink and pressurize the air then use a calculator to convert the psi of the balloon to the psi of the water

Matt avatar

This is really slick, kind of the thing i’m hoping to do.

Wombat avatar

Has any one got any plans to make a PI a Arduino ethernet shield with a whole lot more……

Given that in the UK the Pi is cheaper than most resellers are selling standard Arduino Ethernet Shields.

Clifford avatar

To use a 700MHz ARM11 as a mere peripheral to an Atmel AVR is perhaps probably the wrong way around.

Simon avatar

Reminds me of the story I heard of (from Camb Uni I think) of a camera being pointed towards a coffee pot on another floor to see if there was still coffee in, so the person in need of coffee could see whether it wouldn’t be a wasted walk.

liz avatar

The Trojan Room coffee pot! I believe it was the thing the world’s first webcam was pointed at in around 1990 – it was at the Cambridge University Computer Lab back in its old site in the town centre. When I was at the university in 97, it was still going; they turned it off in 2001 when the Lab moved to its current building on the West Cambridge site (where a fair bit of the development on the Raspberry Pi is taking place).

http://www.cl.cam.ac.uk/coffee/qsf/coffee.html <- Some info about the pot from back in the day, by our friend Quentin Stafford-Fraser. http://en.wikipedia.org/wiki/Trojan_Room_coffee_pot <- The pot actually has its own Wikipedia page.

yetihehe avatar

I had the most laughs during implementing some rest server when I discovered Hyper Text Cofee Pot Control Protocol (http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol). The best thing is Error 418: I’m a teapot

Wombat avatar

it beats doing what a lot of users do and use a PC as a web server to process arduino events etcs at least the PI uses under 5% of the power a pc uses as allows for some very easy to develope and powerful uses of the system.

Clifford avatar

As an embedded systems engineer, I can’t really agree with the term “lightweight” to describe anything that runs on Linux and needs >30 seconds to boot. Lightweight perhaps only in the incremental sense; i.e. on top of the huge amount of existing software, this application is tiny. Nonetheless interesting and cool.

I would however be very wary of remote control of electrical equipment. If you can’t see it, it may not be intrinsically safe to switch it on – especially anything that moves or gets hot!

Morgaine avatar

I agree entirely with Clifford.

Although there is nothing wrong with giving your professional middleware a fun application, in the context of Raspberry Pi it’s not so much “impressive” as “Heath Robinson” and over-bloated.. IBM WebSphere Application Server, Liberty Profile and message brokers to turn switches on and off? Really? We’ve been doing that with X10 since the 70’s and it’s very effective. And I noticed in the message log that Andy’s house uses X10 too, which proves my point.

In part this is a problem of context. The appropriate context for WebSphere is complex commercial enterprises in which proprietary software and professional support services may be worth the expenditure and the consequent loss of independence. In the context of personal home automation and Raspberry Pi though, none of that applies. Wrong context.

Incidentally, I think home automation has a glorious future in Raspberry Pi, because the board is cheap enough to dedicate one to each room in the house or even to each function. But you don’t need massive commercial application frameworks to achieve that. With plummeting cost and miniaturization comes inversion of control too, because you can put the intelligence down at the device end. And that is very very good, because centralization is the enemy of reliability, and you want your house to be reliable.

To IBM’s “friends of Pi”: I realize that you were just having a spot of fun there, but it may be sending the wrong message about what makes sense and what doesn’t.


Lee avatar

Kind’ve interesting. I’ve just managed to get DomotiGa (http://www.domotiga.nl/) running on my Raspberry Pi: http://tickett.wordpress.com/2012/06/05/raspberry-pi-domotiga-jeenode/ (currently receiving energy/power consumption data from various sensors) as well as environment (temprature, light, humidity) from a number of jeenods (http://www.jeelabs.org)- still tons more i want to link it in with! Checkout http://www.bwired.nl for some true inspiration!

Wombat avatar

I love the start of the artical “After my breakthrough earlier getting gambas2 working in debian on one of my Raspberry Pis” on worldpress.com.

Some of us are waiting for our first slice of a Pi and you have multiple :(.

Lee avatar

Unfortunately i was so desperate i had to resort to eBay. In fairness they are going for £50 which is only £15 above the price from the shops.
I disagree with the people making money out of them (although i guess after eBay fees & postage they’re making about 50p anyway)

Tom avatar

Excellent! This does part of what I’d like to do with my amateur radio station. I need to deal with remote signals for control, audio, video, and Morse signalling. RSMB appears to be part of the solution.

Dimitre avatar

Eben and Liz, sorry for the off-topic, but could you guys possibly use your influence with RS Components to have them provide some update for the USA ? I placed an order March 2nd, and 3 months later- nothing. Not even an estimate. This is getting really frustrating. If not shipment, lets at least get an update what their projections are.
Thanks in advance,

Jake avatar

ha, in the last month I’ve been working on a very basic DIY (hacked) version of this and I use my Raspberry Pi as the central server that sends control signals and serves up the UI through the webserver.

I’ve two tutorials on how to do it on my website:

I too can control the lights in my room from anywhere I can get an internet connection :)

You can also check out my Lego case

subin avatar

Hi is it actually possible to use raspberry pi to monitor and control the power at home e.g. turn lights off, heater off , i have an interest in doing this but have no idea how to start

Paul Fisher avatar

Very impressive! There are no details on what hardware is needed to actually control the light etc. Can someone please elaborate?

Gergmchairy avatar

Start by googling X10 or Zwave.. X10 send signals through your mains wiring to turn things on/off etc.. Zwave is similar but via RF and quicker. also sends a reply to confim it’s done it – where X10 is press and prey! Both systems have controllers with serial ports or usb available – it’s a case of writing the software to integrate them !

Thomas Loughlin avatar

I have a z-wave set up with my pi. Mashed together a little tcp server and now my web ui can talk to zwave freely. Total cost for Aeon labs S2 Zstick and two controllers was under $100.

Mark Raybould avatar

Great demo and application of process control. Which OS has been used in the Pi and the size of the SD card to support Liberty, MQTT and RSMB? Many thanks.

Christoph avatar

Nice video.
You did not talk about security concerns. Acoording to the MQTT FAQ, SSL is possible. However, I would not be amused if somone could play with my electical heat or whatever. (Which does not sound very unlikely according to my 3minutes-google-knowledge)
You also did not talk about the sensors being used. I guess like me, many are interested in the actual sensor devices.

I think this is really nice if it “just works” as plug and play (or install and run). If it doesn’t I guess many peope are capable of writing something similar whith reasonable time-effort.

UkDodo avatar

I was looking a using pressure sensors in my car to measure and log the air intake pressure losses at various points. The Honeywell series avaliable from Mouser have sensors that can measure liquids, have pressure ranges of 60mbar to 10Bar and have absolute, gauge, and differential types. They are SMT or DIP and you interface with them using I2C. Plus they are about £20-40 depending on the sensor which is quite affordable.

Here are some links:


Oh and I’ve been reading this site for over a year but this is the first time I thought I could say something useful so first post!

Comments are closed