Being able to control everything from your pocket has long been a dream shared by many. Previously we've had universal remotes that can both control our TVs and radios, then we had wireless wall sockets. Both great things, but how likely is it that you're going to be carrying around those remotes with you everywhere you go? These days almost everyone has a smartphone in their pocket, so why not use that?

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
• Solder
• Wire cutters
• Wire strippers (although this could be done with a knife)
• Multimeter

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=

Skills required:
• Soldering
• How to avoid electrocuting yourself when sticking your fingers into exposed light switches

Got all that? Let's get cracking!

<p>Would this work on an Android device? I have a Nexus 5 and don't plan on using any IOS phone. As far as I have seen, there isn't TOO much that is iPhone specific, but just want to make sure.</p>
<p>Hi,</p><p>Sorry for the delay in replying. The only thing that is iPhone specific is the app. If you can get an android app which sends UDP messages then you can modify the code to work with a Nexus 5 easily. You will just need to match the UDP messages being sent from the phone to the triggers in the code.</p><p>Let me know how you get on!</p>
Hi, this is a great project and an excellent instructable. I'm planning implement this at home but I also want to be able to control the lights using the wall switch. Have you managed to get this part of the project working? If yes, can you give some details about your solution? thanks
<p>I just worked this out moments ago. This should work for single switch or three way. You can use the mains light switches in addition to the RF module if wiring them in parallel. I have made a sketch, using what i take for a somewhat typical UK light box wiring. This same concept would work in a switch box having both constant hot, switched hot and a neutral. For North American readers, Neutral is white or grey instead of blue and the hot is normally black, red or blue.</p>
Thank you! I really appreciate it. <br> <br>I'm going to be working on that functionality in the next couple of weeks (work is pretty crazy at the moment so I haven't really had a chance to sort it). As a heads up it will almost certainly involve an ATTiny chip of some description (probably the 45). <br> <br>I will update this instructable (or it might warrant a whole new instructable in itself) once I've got it sorted and have been able to write it up, and I'll reply again to your comment to make sure you get a notification. <br> <br>Let me know how it goes when you do implement it in your house, I'd love to see what you do with it!
Thanks for the response. Sounds interesting involving another micro controller chip in this project. Replying to my comment sounds great, I appreciate the effort. I'll also report once I get the chance to play with your solution here.
<p>So it seems like you should just be able to wire this up in a 3-way switch configuration where you could use the existing light switch and have this module be the second switch. Anyone see a reason why it wouldn't work. I think I will give this project a try. </p><p>This site has great US wiring diagrams for many configurations.</p><p>http://www.easy-do-it-yourself-home-improvements.com/3-way-switch-wiring-diagram.html</p>
<p>best ever creation...thumbs up...</p>
<p>I could study more about the RCswitch <br>collection and how it functions. I'm having problems knowing how you <br>handle to tell the distant which outlet to convert on in your code and <br>you give some details about this solution.</p><p>&lt;a href=&quot;http://cewqatar.com&quot;&gt;MEP Contractors in Doha&lt;/a&gt;</p>
<p>Hi,</p><p>I'm struggling slightly to work out exactly what it is you're asking but I think it might be a very similar question to that ikeet asked. If you look for his comment below and my reply see if that answers your question. If it doesn't then please let me know and I'll do my very best to answer your question!</p>
Hi mate, just want to start by saying this is a great project, thanks! I was wondering if you could recommend somewhere I could read more about the RCswitch library and how it operates. I'm having trouble understanding how you manage to tell the remote which socket to turn on in your code! <br>Cheers
Thanks man, I really appreciate it! This is a really good post by the guy that wrote the library, which describes the principles behind it: <br>http://blog.sui.li/2011/04/12/163/ <br> <br>If your confusion was more about where in my code the data is actually sent down the com wire to the hacked apart remote then that can be found in the method &quot;void (setOnOff)&quot;. The complex looking part of that method is simply dealing with a form of feeding back what's just been turned on/off (at the moment this is just for the serial monitor but it allows for expansion in the future). The bit that actually turns it on and off is just Switch1.switchOn(group, plug); (or Switch1.switchOff(group, plug); for turning a plug off) which uses the RCswitch library to send the data to &quot;Switch1&quot; (which is what the remote connected on pin 10 is called in the sketch due to these two lines of code: <br>RCSwitch Switch1 = RCSwitch(); <br>Switch1.enableTransmit(10);) telling it to turn on (or off) a plug socket that, if we were using an unmodified remote, would be set to receive signals from when the remote is set to a particular group when one of the buttons is pressed (here the &quot;button number&quot; is referred to as the plug number). <br> <br>I hope that helps, but if it didn't feel free to drop me a comment and I'll try and do a bit better!
That's exactly what I was looking for, thanks! I'm currently trying to design a home automation system and was really struggling to find a way to control the appliances remotely but so far your method looks great. Cheers for the quick response!
Sir I am 2nd year electronic and communication student can u give me small project ?
Hi Yasar. I'm afraid I think you've over estimated my abilities/seniority here. I'm only just starting my 3rd year of a degree course (that's not really related to this kind of stuff)! <br> <br>I'm not 100% sure what you mean by &quot;can u give me a small project&quot;. If you want to use this project as a starting block and then extend it please do! I'd be really excited to see what else you come up with! <br> <br>If you want me to give you an idea for a project then I'm afraid they'd all be related to this as all my tinkering and making stuff focus is currently on extending the capabilities of this instructable. <br> <br>If you think there is anything else I can help with just let me know!
This is really fantastic! You have explained this well.....I can't wait to try this out at home. I hope it's as easy as you make it sound.
Thanks man, that means a lot! Let me know how you get on; I'd love to see what other people do with it. If you have any problems just give me a shout and I'll do what I can to help!
Does anyone else think of naming it J.A.R.V.I.S? Lol
That was sort of where this idea started out (it'll feel a bit more like it when I put the voice control functionality in!) I decided that I didn't want to use JARVIS as his name and so, after a quick search of fictional butlers, I settled on everyone's favourite Bel Air butler!
Thanks! I had most of the materials myself before I started but if you can get an Arduino with an Ethernet Shield for around £50 then add around £20 per 3 sets of switches (I managed to purchase mine during a sale so it was only £15 for 3). Hope that helps
Yes it does thank you!
My pleasure! Let me know if you end up making your own, I'd love to see what other people are doing with it!
Nice job! Do you have an approximate amount of money that you spent creating your butler?

About This Instructable




Bio: I'm a sound engineer with a passion for making stuff! I'm a big fan of the arduino and I really enjoy learning new ... More »
More by willpow1993:Home Automation (or Robot Butler called Geoffrey) - iPhone controlled, arduino based 
Add instructable to: