Introduction: Control Your RF Outlets With LinkIt One

I recently purchased a set of outlet wall timers for some lights in my house. While having all the lights turn 'on' at a certain time is cool, I realized that there were quite a few drawbacks. First, while I woke up very early on the weekdays, I slept in on the weekends, so I didn't need my usual morning lights to go on at 6AM. I wanted a way to exert more control over my lighting system without having to tinker with every individual outlet every time.

In comes the LinkIt One. It's advance features allow me to hook up an RF Transmitter and control all of my outlets now with a cheap set of RF outlets I got online. Now I can simply code all the logic for all my lights on one device, and it will control all of them no matter how need I am!

Step 1: Requirements

Hardware Requirements

Software Requirements

Ensure that you have gathered all the Hardware and downloaded and installed all Software requirements.

Step 2: Wiring Up Your LinkIt ONE

First we will need to wire up the transmitter and receiver to your LinkIt ONE. RC-Switch already has some great diagrams on their wiki explaining this and I've reposted them above. Your transmitter and receiver might look a little different, and that is OK. Just make sure to look at the labels on the output pins and make sure they align.

While the images above specifically show an arduino, the pin layout is the same as a LinkIt ONE.

*Images from rc-switch wiki

Step 3: Get the RF Codes From Your Remote (Receiving)

First, we need to figure out the codes that the remote for your outlets is transmitting. There are several different RF outlets out there on the market, so it is very possible and likely that yours is different than mine. In order to do that, you should deploy the ReceiveDemo_Advanced project on rc-switch github. This will allow you to receive different RF codes from your remote.

Deploy this code to your device and hit one of the buttons on your remote. This should emit an RF signal that your Receiver will pick up and display. Hopefully it looks something like this:

Decimal: 3932352 (24Bit)
Binary: 110011010101010000000011
Tri-State: 011000001000
PulseLength: 168 microseconds
Protocol: 1

The 'Binary' string is what you are really after here. That is the binary form of the decimal code unique to the RF signal. You'll want to do this with each button on your remote to map out the RF signals coming out of each one.

Step 4: Transmitting RF Signals

Now that you have mapped out each signal, it is time to turn that around and use it to tell which signal to transmit and turn on your outlets individually.

An example:

#include rc-switch
RCSwitch mySwitch = RCSwitch();
void setup() {
  mySwitch.enableTransmit(10);  // Using Pin #10
}
void loop() {
  mySwitch.send("000000000001010100010001");
  delay(1000);  
}

Step 5: Control the Outlets According to DateTime

I used the LinkIt ONE's TimeAlarms library in order to control my outlets based pre-defined schedule. It is a built-in Arduino library, but not a built-in LinkIt ONE. You will have to download and install it in order to get this code up and running.

Step 6: Going Forward

Hopefully this guide has proved helpful in setting up a 433Mhz Transmitter and Receiver with your LinkIt ONE and showed you how to successfully control your outlets with more advanced logic than just a simple wall-timer. The possibilities for this project are immense. You could hook it up to an API on MediaTek's Cloud Sandbox and allow you to control your lights over the internet, or even set up geofencing so they automatically turn on when you go home.

Comments

author
DIY Hacks and How Tos (author)2015-10-24

Great application for a LinkIt One

author
jmdushi (author)2015-10-24

This is a very useful project, thank you for sharing. Controle your lights specially when you are on vacation will help to protect your home. And don't forget the fresh coffee when you are coming home.

About This Instructable

640views

11favorites

License:

More by jckelley:Push-Up CounterTimeout ChairLinkIT ONE Battery Tester
Add instructable to: