So that's what I did.
I can now control electrical sockets and the main lights in my house using my iPhone. It's all totally wireless and you can set up smart run-times within it (e.g. when you press the shower button it will turn on the boiler, the bathroom lights and the upstairs lights, after 1 minute it'll turn off any downstairs lights that are still on and then after two minutes it'll turn off the upstairs lights, and after 20 minutes it will turn off the bathroom lights).
By using basic electrical knowledge, taking apart some readily available items and writing some arduino code you to can make yourself a robot butler (mine's called Geoffrey).
Let's get started!
Step 1: What you'll need
Tools you will need:
• Knife or other flat blade
• Stanley knife
• Set of standard Phillips and crosshead screwdrivers
• Safety Torx T15 screwdriver (can be done with a standard Torx T15 but more faff and potential breaking of a flat head screwdriver may ensue)
• Soldering iron
• Wire cutters
• Wire strippers (although this could be done with a knife)
Materials you will need:
• An arduino (I’m using an Arduino Uno)
• An arduino Ethernet shield
• A RTC (real time clock) module. Adafruit do a very good kit that I'd highly reccomend (http://www.adafruit.com/products/264) but if you search for "New I2C RTC Real Time Clock Module DS1307 Arduino" on eBay you will probably find one for a fair bit cheaper (that's where I got mine)
• A set of RF plug sockets and remote. I used Maplin's Remote Controlled Mains Sockets (product code N79KA). The RF module used in these plugs is the only one I’ve coded for and as such the only one that this has been tested with. There are plenty of other brands that use the same chip (SC5262) but you will need to check this for your individual sockets. If you can’t get one with the same chip, the basic principle and the way the coding is done will still apply but you may need to do some more work to get your arduino to communicate with the sockets. You will only need one remote but you will require a plug socket for every electrical item or set of mains lights you want to control independently – (i.e. I only ever use my TV with my Xbox so when ever I turn on the one I will require the other too. This means that I only need one RF plug socket and a two way mains extension for them both to plug in to).
• Mains extensions
• Pattress block extenders (46mm depth recommended) – this is so the additional circuits will fit behind your standard light switch. One required for each set of light switches to be rewired. I bought mine at Maplin (http://www.maplin.co.uk/single-surface-pattresses-1286)
• 75mm electrical socket screws (2x pattress block extender)
• A router with at least one free Ethernet port that is also used for your WiFi network (you will also need to have access to the settings of this router)
• An iPhone or iPad (the app I’ve used and as such a fair proportion of the code is iPhone/iPad only. I’m sure there are android alternatives but you’d have to look around for them and change the code accordingly. I’ve tried to make the code as easy as possible to change the control method)
• Mains to USB power supply
• An ethernet cable
• A USB A to B cable
• Access to the mains breaker/fuse box for the building in which you’re installing this (if you don’t intend to do anything with the mains lights then you probably won’t need this)
Arduino libraries you will require:
• Adafruit’s modified RTC library (for interfacing with the clock module) – https://github.com/adafruit/RTClib
• RCSwitch library (this deals with the codes to be sent by the RF remote) – https://code.google.com/p/rc-switch/downloads/detail?name=RCswitch_2.51.zip&can=2&q=
• How to avoid electrocuting yourself when sticking your fingers into exposed light switches
Got all that? Let's get cracking!