loading
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.

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
 
1-40 of 114Next »

Sir Good day! Can i use any TV or DVD remote Control? Tnx in advance :)

Any system with a standard IR protocol should work.
yaser ha1 month ago

can i add more ? how can i do this?

DIY Hacks and How Tos (author)  yaser ha1 month ago

I am not really sure what you are asking.

maitrteya1 month ago

For some unknown reason to me, it is trying to read from the RobotIRlibrary when i try and compile it. These are the errors I am getting:

Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno"

Build options changed, rebuilding all

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:1: error: missing terminating " character

int RECV_PIN = TDK2"; // the pin the IR receiver is connected to

^

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TDK2' was not declared in this scope

int RECV_PIN = TDK2"; // the pin the IR receiver is connected to

^

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp: In function 'void beginIRremote()':

sir the same problem is occuring to me

what to do please suggest

Use the library folder that I have attached in the the instructable.
maitrteya1 month ago

when i bulid the circuit and pressed the remote keys

nothing appears in the serial display on my pc

now what to do please suggest

makeosaurus1 month ago

For some unknown reason to me, it is trying to read from the RobotIRlibrary when i try and compile it. These are the errors I am getting:

Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno"

Build options changed, rebuilding all

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:1: error: missing terminating " character

int RECV_PIN = TDK2"; // the pin the IR receiver is connected to

^

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TDK2' was not declared in this scope

int RECV_PIN = TDK2"; // the pin the IR receiver is connected to

^

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp: In function 'void beginIRremote()':

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:10:2: error: 'irrecv' was not declared in this scope

irrecv.enableIRIn(); // Start the receiver

^

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp: In function 'bool IRrecived()':

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:14:9: error: 'irrecv' was not declared in this scope

return irrecv.decode(&results);

^

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp: In function 'void resumeIRremote()':

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:18:5: error: 'irrecv' was not declared in this scope

irrecv.resume(); // resume receiver

^

Error compiling.

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

This problem is caused by there being two library files with the same name (see step 2). You can solve this by renaming one of the folders and changing the library call command. You can download the attached zip file for an example.

Thank you for your quick reply but what do you mean by changing the library call command?

Thanks,

Make-o-Saurus

This project uses the IR Remote library listed above. In a recent update to the Arduino software, they introduced different library with the same name. You can't have two libraries with the same name or you will have lots of problems when you try to use a library in a program. So you need to change the name of one of them so that they program can know which one to reference when you use the "include" command.

KiranR32 months ago

How can i use it for long time , i mean how to store the remote code permanently?

DIY Hacks and How Tos (author)  KiranR32 months ago
The easiest way to make the code permanent is to manually write it into the code. That way it will always be there even after the power is disconnected.

Is there is any other idea to store IR code in an EEPROM?

DIY Hacks and How Tos (author)  KiranR32 months ago

Sorry, but I don't really know how you would do that.

nikv12 months ago
How can I control multiple relays with multiple buttons? Also, how can I add a servo instead of a relay?
DIY Hacks and How Tos (author)  nikv12 months ago

You would need to change the code to set up a second array to store the second code. A servo could work just the same way. You just need to change the code to output a servo signal. You can find more information about that hereLhttp://www.arduino.cc/en/Reference/Servo

Thanks for such a quick reply, i guess i have some homework to do ;)

PiRaspBerry3 months ago
would it possible to have more outputs with more buttons on the remote?
Yes. You could set it to control as many appliances as you want.
thnx iam gonna make this tot control my hole room
midoaboud3 months ago

How can I simulate it on https://123d.circuits.io/ because i had some errors in code during simulation

DIY Hacks and How Tos (author)  midoaboud3 months ago
Sorry. I am not familiar with 123d circuits

may you give me a useful link or similar simulation program to use it for arduino because such programs needs licence and for VBB it is hard to find serial number?....thanks in advance

https://123d.circuits.io/circuits/822112-the-unnamed-circuit/edit#breadboard

zain siddiqui3 months ago
Sir what would be the output for appliance? THANKS for your help
zain siddiqui3 months ago
Sir could you guide me where to attach the extention cord? Thx

Take the extension cord. In the center cut the insulated strip that is holding the two wires together. Then cut one of the wires and strip the insulation off both of the cut ends. Solder these two wire ends to the relay on the circuit board. When the relay is turned on it will complete the circuit and turn on the appliance.

zain siddiqui3 months ago
Is relay necassary If i just use it for 1 appliance ? Thankyou

Yes The relay is necessary because you are switching an AC appliance on and off.
zain siddiqui3 months ago
Is relay necassary If i just use it for 1 appliance ? Thankyou

redatime4 months ago
In your picture with the breadboard which component is the black square at the top?
DIY Hacks and How Tos (author)  redatime4 months ago

That is a momentary switch. I use that switch with the breadboard because it was easier to connect that the switch that I used is the finished project.

redatime5 months ago

what arduino should be used?

DIY Hacks and How Tos (author)  redatime5 months ago
I used Arduino Uno but any board should work.

thanks a lot !

dath5 months ago

hii could you tell me how to connect the relay ,...

tanx,....:)

DIY Hacks and How Tos (author)  dath5 months ago

Take a power cord and cut one of the two wires. Strip the insulation on each side of the cut wire. Then connect these wires to relay's common and normally open terminals.

spike19985 months ago

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\IRremoteTools.cpp:5: error: 'TKD2' was not declared in this scope

what do i need to do about it

DIY Hacks and How Tos (author)  spike19985 months ago
At the bottom of step 2, I describe how to rename the library if this error occurs.
1-40 of 114Next »