Android/Arduino RF Outlets Selector

Overview

Here’s a great little project I implemented with Arduino and Android – switching outlets from my smart phone!

 

 

I started with off the shelf RF Wireless Outlets. At $6 per outlet, they are a complete steal. I got lucky and found all 4 channels of these wireless/RF outlets at a local Big Lots:
Big Lots Outlets

Parts List:

Similar outlets on Amazon
And/Or here is an update, found the exact outlets at Home Depot: the indoor ones and also here are the indoor/outdoor ones. (Thanks Mr_Quagmire)

Compare that pricing to one unit of the Belkin WeMo Switch

Here’s a 315MHz Android-compatible transmitter/receiver on Amazon: SMAKN 315Mhz Rf Transmitter and Receiver Kit

All the code is on Bitbucket. That includes a simple remote control Android application (as seen in video).

And the brain it runs on (I used the Arduino Ethernet model, there may be better choices now…): Arduino Ethernets on Amazon

This is what the circuit looks like… very simple, just hook up the 4 pins of the transmitter to the correct place and you will be ready to load the code onto the Arduino!
Completed Circuit

The Arduino can hook up to your router via the Ethernet shield, and when it’s turned on will be running a web server at the URL: {IP address}/outlet?outlet={outlet}&channel={channel}&state={state}

And of course the Android comes in with a basic UI over top of those URL permutations, so you can click a toggle button for all the outlets, rename them, etc.

I based the code on a cool outlet project that was pretty mature, called RC Switch, but in Europe the RF protocols and outlets are a bit different. There was also a reference from Instructables, but those RF on/off timings didn’t match my outlets. If you don’t have luck with my code as-is, modify the pulse length timings to match what is found here. There may be more variants that look the same, as a lot of these outlet modules look the same but are rebranded.

Reverse Engineering / Troubleshooting

Hopefully during the project you can implement it in a straight-forward way, but if the same protocol does not control the relays, read on to how I troubleshot this project originally…
To figure out the problem above, I used the Arduino as a logic analyzer to figure out what exactly wasn’t working, and that was probably the most fun part of the project. I soldered leads onto the stock wireless remote to spy on the signal that was being transmitted, and saw the digital signal graph on my TV screen. Amazing! As a programmer, I forget sometimes that there is electricity flowing through everything and changing direction every few nanoseconds.

This Arduino logic analyzer is a great open-source code project, and saved me big time here. It has 500 kHz max resolution, but since there is only 1kb of RAM, you’re limited to 1024 samples. That resolution was actually so good, that the first few times I thought it wasn’t working… I was zoomed in too far and didn’t see any transitions. As soon as I zoomed out to 1 kHz, I saw everything! And 20 kHz was finally the sweet spot to measure the timings accurately.

This is how I instrumented the remote control for use with the logic analyzer. I soldered many jumpers onto the circuit — only 2 carried the signal I wanted. The orange wire, and the right-most white wire both had the correct waveform — though the white one was inverted. I also provided power from the Arduino, since the remote had a 12V battery, some traces might have been carrying too much juice for the Arduino!
Wireless Remote instrumented

Feel free to provide critique or suggestions!

6 Responses to “Android/Arduino RF Outlets Selector”

  1. Sean Ferguson says:

    Is it possible to change the colour of the blinking LED with this interface? I would like to have the LED start white and then flash orange when connecting and then burn steady pink when connected and flash blue if the Arduino detects a change in the incoming voltage.

  2. [...] interface with it? A quick search on a hackaday lead me to others who have done similar, such as this and this. It was possible and not too [...]

  3. [...] Visit his website to learn more and for all the code. Andriod Arduino Ethernet W5100 2014-01-28 admin Share ! [...]

  4. Ok.. love your work first of all, second I have been using these remotes for several years and can help you with some more info and facts. first off they actually go from A – F for a total of 18 devices to control however, that’s not the case when you dig a bit further.. with a little modification you can actually control many more devices to the tune of 128 devices by my count, If your interested let me know I can send you photos of what I have learned and how tos.. and more info on these sweet remotes..

    Mark

    • Colby says:

      I would be really interested in knowing how you are able to expand this project out to control 128 outlets. I would like to hack these to wire them in as 3 way light switches across the house instead of just power outlets. Looks like it should be possible.

Leave a Response