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:

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

Wire Strippers
Soldering Iron and Solder
Drill and Bit Set
Sharp Knife
Hot Glue Gun
1-40 of 71Next »

Sir can i use a relay module shield without an optocoupler?

Yes. You will just need to use really low power relay (less than 40 mA) or a power transistor because the Arduino is not able to output more than 40 mA through the output pins.

Hi sir, how do i know if a relay works on below 40mA? thanks for the help..

we have here a 12v 10a relay.. got trouble looking for the relay to use..

The relay will often say on the packaging what that coil requires to activate. If the relay coil requires 12 volts, it can not be activated directly from the Arduino. The Arduino can only output 5 volts. When in doubt be safe and use a power transistor to turn the relay on and off.

thank you sir.. i'll be using a 2n2222 npn transistor

shinystuff1 month ago

Very nice instructable! Worked the first time I tried it. But I have a found a serious flaw. If you disconnect the power it loses the memory of the selected button. I will try to make one of two things. Either I will simply look up the remote signature, or I will retweak the code to save the values in the EEPROM(but looking at the values I get from the remote, a simple 512 byte EEPROM won't handle the pressure :D ) Otherwise, yeah great instructable!

dj505Gaming2 months ago

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

Using Arduino 1.5.4 with an Arduino Nano, wiring is correct. Any help?

Try renaming the IRREMOTE library. The newest Arduino has a built in IRRemote library so the name has two locations and it doesn't know where to go.

paceship292 months ago

Im a complete newbie here. I've got the circuit completed and the program copied into the sketch, but i can't verify or upload due to persistent errors that are obviously due to a problem with the library. The Arduino-IRremote-master2 downloaded and in the library, i can open the files and read them so i know they're there, but there's got to be a problem with the path, Im using a mac, it would be really helpful if I could get very specific advice on how to name the libraries and what to put in the "include" commands in order to fix this.


Never mind, I figured it out, I was using the new library with the old IDE, I deleted the newer one and reloaded and it works like a charm, thanks

gabby.batucan3 months ago

hi, what's the substitute for the TSOP 4838? can you give some list? thanks

I don't know exactly what to substitute, but it needs to have a digital output that outputs a HIGH or LOW when it detects IR. It can't just be a phototransistor.

got it working thanks anyways , more powers :D

gabby.batucan3 months ago

i have 2 ir receiver from a broken cd player and electric fan. i don't know it's TSOP series. i made the circuit just like in the diagram and the red LED lights on when i click the pushbutton but it doesn't turns off after i click the remote control. any idea?

The remote which will be used, is a special type or a common remote also be used?

please help!! thanks!

Most remotes will work. It can be a generic universal remote or a name brand remote. It shouldn't matter.

Got it to work with stand-alone atmega 328p. I had to run power to AVCC.

Thanks for your help.

Works great with arduino uno 3 .Tried to make with stand-alone atmega 328p.

But it won't work.Is there a way to make it work?

Try giving enough voltage to your circuit (5 V).

Sorry, I can't help you there.
kimg35 months ago

do you have the block diagram of this project?

DIY Hacks and How Tos (author)  kimg35 months ago
Not at the moment. But you should be able to make one fairly easily.
loveangel90j6 months ago

It is really very good project, inspired me to do many things.

But if you change the initial value of "RecordState from 0 to 1"

that will solve the reprogramming problem

(int RecordState = 1; // is the reciever in record mode )

can i control different output using different remote keys ?

press "1" at remote = run o/p1

Press "2" at remote = run o/p2.

Fioulmaster6 months ago

Good project! I will use it for power On/Off my Home cinema Subwoofer with the Amplifier remote. When I will turn On my Amp, it's turn On too my Sub.

JasonC26 months ago

Can anyone tell me what relay and diode you used?

jorgez661 JasonC26 months ago

Here's the schematic I used based on the one included in this guide.

jorgez661 JasonC26 months ago

This is the relay I used however you might need a transistor to get it to work

And pretty much any diode will do, I used this one

jorgez661 made it!7 months 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

Made two final modifcations, replaced the arduino with a barebones arduino that I made using another instructable, and replaced the end of the extension cord with two separate plug-ins mounted on the side of the case. Each of the plug-ins is wired to its own relay so basically it can remote control two outlets. Thanks again to the DIY Hacks and How for this great Instructable!

2014-08-10 13.04.05-1.jpg2014-08-01 16.54.53.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.

cnguyen377 months ago

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

DIY Hacks and How Tos (author)  cnguyen377 months ago

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.


Sorry, here's a better picture

DIY Hacks and How Tos (author)  cnguyen377 months ago

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

DIY Hacks and How Tos (author)  cnguyen377 months ago

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

jhong23888 months ago

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

DIY Hacks and How Tos (author)  jhong23888 months ago

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?

1-40 of 71Next »