Instructables

Control Any Circuit With a TV Remote (and an Arduino)

Featured
Picture of Control Any Circuit With a TV Remote (and an Arduino)

Most of the buttons on a remote control are never used. So why not use them to control appliances and other electronics around your house. In this project, I am going to show you how to use an Arduino to decode the signal from your remote and use it to make an outlet switch that can turn your electronics on and off.

When you are done, you will be able to control lights, fans and even your coffee maker with your TV remote.
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

Picture of Materials
Here are the materials and tools that you will need for this project:

Materials:
Arduino Microcontroller
AC Power Adapter For the Arduino
38 kHz Infrared Receiver Module  (Radio Shack part# 276-640)
Red LED
Green LED
Momentary Pushbutton Switch
Two 100 ohm Resistors
10 kohm Resistor
Diode
5V Relay or Relay Shield
Printed Circuit Board
Plastic Project Housing
Extension Cord

Tools:
Wire Strippers
Soldering Iron and Solder
Drill and Bit Set
Sharp Knife
Hot Glue Gun

Step 2: Download and Install the IR Remote Library

Picture of Download and Install the IR Remote Library
Image2.jpg
Image3.jpg
Image1.jpg
This project uses an IR remote library that was developed by Ken Shirriff. This library lets you decode the signal coming from your remote. You can check out his original project and setup here: http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html

The first thing that you need to do for this project is download the library zip file. You can find it here: https://github.com/shirriff/Arduino-IRremote

Click "Download ZIP" on the right side of the page and save the zip file. Then unzip it. Rename the folder "IRRemote" (unless that name is already being used).

Then copy the folder into your libraries directory. The libraries directory should contain the folder "IRremote." If for some reason you already have a folder with this name, then you may need to rename it. The IRremote folder should contain the files. A lot of problems experienced when uploaded in the code, are caused be the library not being loaded in the correct location.
1-40 of 43Next »
jorgez661 made it!14 days ago

Great project! I made one but I removed the button on the final case after modifying the code to work with the remote I wanted. I also added a second relay to which I plan on adding a second outlet later on!

2014-07-14 11.55.53.jpg2014-07-14 11.59.51.jpg

For anyone else making this project, I highly recommend PCB screw terminals to wire the extension cord into. It makes attaching the wires a lot easier that way.

cnguyen3721 days ago

For some reason, the red LED for me will not turn on when i press the button.

First make sure that the LED works and is the correct voltage. Then check to make sure that it is plugged into the correct pin. Then check all the other parts.

I'm pretty sure everything is ok. Here's a picture. I'm not the best with circuit diagrams so I'm not sure if anything needs a fix.

IMG_20140708_203615.jpgIMG_20140708_203607.jpg

Sorry, here's a better picture

IMG_20140708_203946.jpg

Your button doesn't appear to be connected to 5V. One side of the switch needs to be connected to 5V and the other side to the resistor and the input pin.

Now the LED turns on but not the green one. Do you know why? The button is connected to the 5V and the digital pin 6 and the resistor. But now the green LED won't turn on.i kept the wiring the same except I moved the button to the positive side, connecting to the 5V

The green light should come on when it recognizes the code from the remote. Try using a different remote.

jhong23881 month ago

5V Relay Module for Arduino
can i use this relay?

sku_149805_1.jpg

Yes. As long as the appliance is rated for less power than the relay is rated for.

does this relay need some circuit boarding or adding diode or somthing?

It appears to have the power transistor and the diode are already built it. You need to check to make sure that the power that is required by the relay is less that the max output for the Arduino pins. Otherwise you will need an external power source.

it is ok if i plug my uno overnight?

You can look up the power ratings for each board on the Arduino website

http://arduino.cc/en/Main/arduinoBoardUno

For an UNO it is 40mA per pin

Yes. It is ok to leave your Arduino plugged in over night.

if i add 2 servo for my curtain it is still ok to turn on 24/7

As long as you don't exceed the maximum output rating, it should be fine.

whats the maximum output rating?
how to know if i exceed?

Isanch993 months ago

What do you do if this pops up when you're uploading the code on the Arduino 'IRecv' does not name a type > DIY Hacks and How Tos

DIY Hacks and How Tos (author)  Isanch993 months ago
Check to make sure that the library is loaded properly.

I checked that the library was loaded correctly and it still can't verify it

DIY Hacks and How Tos (author)  Isanch993 months ago

Sorry. I don't know what is wrong then.

Carlitos3174 months ago
I have an arduino uno r3 smd edition with arduino 1.0.5-r2 and when I try to upload the code it says 'iRrecv' does not name a type and doesnt upload it plz help

Check to make sure that the IR remote library is loaded in the libraries directory correctly.

Image1.jpg
Isanch993 months ago

error: 'TKD2' was not declared in this scope It said this when I tried to upload the code to the Arduino? DIY Hacks and How Tos

Isanch993 months ago

error: 'TKD2' was not declared in this scope It said this when I tried to upload the code to the Arduino? DIY Hacks and How Tos

stumitch4 months ago

Nice, clear description of an idea that uses a remote that everyone will have somewhere in their house. If you want to, try http://teachables.org/arduino-without-the-board to build the project and not have to sacrifice an Uno. Thanks for such a great 'ible!

afioramanti4 months ago
awesome, Congrats. The IR need short distance is there a way to try with with ethernet shield?
toplak6664 months ago

Or use one of these: http://www.simerec.com/chips.html Cheaper and easier. No coding required. Still, good project though.

freakyfreak74 months ago

This looks like it could be adapted to control an entire room with one arduino.

Yes. You can control as many relay devices as you have digital output pins. Just remember to stay under the board's max output current.
steinie444 months ago

I made a remote control for my TV input for my DVR and Arduino TVout. It's about the same as yours only has RCA jacks in it. Works like a champ. Next I'll make one to control 4 inputs to the TV. I'll use a Arduino Pro Mini, only $5.00.

vroom3504 months ago

Great idea! But IR need sight short distance, rather use device socket plug CleverWatt 433Mhz rest no make, just Arduino with TX and RX 433Mhz module can scan remote, and still with IR stay with you use TV Remote area in like lounge room.

chuckvideo4 months ago

I now know how I'll be spending my day today, this project is both amazing and simple to build and set up! And I bet it'll work perfectly with the Power Tail AC switch I bought a while back but didn't know how to use until now. https://www.sparkfun.com/products/10747

DIY Hacks and How Tos (author)  chuckvideo4 months ago
That kind of switch should work perfectly.
danamoose4 months ago
Great project, nicely done!
samuraijack4 months ago

awesome.

ade angelis4 months ago

This is a really nice project, thanks for sharing. I have a problem though: I downloaded the library and copied the code as reported above, yet I get this error.

It'd be great if you could help! Thank you! :)

Senza titolo-1.jpg
There is a problem with how the library is set up.

Image1.jpg
1-40 of 43Next »