Introduction: Control Your LEDs With Your TV Remote?! || Arduino IR Tutorial

In this project I will show you how I repurposed the useless buttons on my TV remote to control the LEDs behind my TV. You can also use this technique to control all sorts of things with a bit of code editing. I will also talk a bit about the theory of how an infrared transmitter and an infrared receiver communicates with each other. Let's get started.

Step 1: Watch the Video!

The video gives you all the info you need about the theory of this project and the practical implementation. So watch carefully.

But in the following steps I will also present you my parts list with example sellers and the schematic, code,.... to make your life easier if you want to build this.

Step 2: Order Your Parts!

Here you can find most of the parts that you will need to complete this buid.

Ebay:

1x Arduino Nano:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x 10k Resistor:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 100µF Capacitor:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x DC Jack:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x IRLZ44N N-channel MOSFET:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x IR Receiver (TSOP4838):http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x Veroboard:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

RGB LED strip (common anode):http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

Power Supply (12V 3A):http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

Amazon.de:

1x Arduino Nano:http://amzn.to/1tgG8ux

2x 10k Resistor:http://amzn.to/1zknpuw

1x 100µF Capacitor:http://amzn.to/1wnBpS0

1x DC Jack:http://amzn.to/1x5ReSt

1x IRLZ44N N-channel MOSFET:http://amzn.to/1tgGBgl

1x IR Receiver (TSOP4838):http://amzn.to/1rkolRN

1x Veroboard:http://amzn.to/1rkoswO

RGB LED strip (common anode):http://amzn.to/1A9iSPM

Power Supply (12V 3A):http://amzn.to/1rkrmSn

Amazon.com:

1x Arduino Nano:http://amzn.to/1xkMTNb

2x 10k Resistor:http://amzn.to/1A9l0H7

1x 100µF Capacitor: http://amzn.to/13xShyw

1x DC Jack:http://amzn.to/1rkq49Y

1x IRLZ44N N-channel MOSFET:http://amzn.to/1CQkAFh

1x IR Receiver (TSOP4838):http://amzn.to/13xSD8C

1x Veroboard:http://amzn.to/1AN5kJQ

RGB LED strip (common anode):http://amzn.to/13xSXE8

Power Supply (12V 3A): http://amzn.to/1xgDwuY

Step 3: Build the Circuit!

Here you can find the schematic for the circuit. You can make your own board layout for this but you can also just use mine instead. It should work without any problems

Step 4: Program the Arduino Nano!

Here you can find the code/sketch for the Arduino Nano. Make sure you upload it before you start testing.

And don't forget to download the IR library for the Arduino: https://github.com/shirriff/Arduino-IRremote

Step 5: Success!

You did it. Now you can control everything with your TV remote and never have to get off your couch!

Feel free to check out my Youtube channel for more awesome projects:

http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Comments

author
Gabrielin (author)2017-04-11

Thank you Scott! Awesome project, useful guide as well! Had to use a 38KHz variant of the IR receiver because it's the one that they had at the local store (TSOP343338), and the reception works flawlessly with my One For All XSight Plus TV remote. Nice project as always :) and thank you again

author
AaronL106 (author)2017-04-04

amazing! just subscribed!!

author
Knödelcrafter (author)2016-12-04

Awesome project Great Scott! But can someone help me, I have made all the connections and resistors. But my LED strip is only switching on and off. Even if i let the brightness step for step increase, aftersome time it is switching on and not getting brighter. The only difference is, I used IRFZ44N MOSFETs. Does someone know what the reason could be? Thank you in advance!

author

After one day of bugtesting i still dont have any idea. I can give you my results.

The Blue LED is actually dimming, as it is supposed to do. The other 2 Colors are on or off. In the images, you can see my schematic and measured Voltages at brightness levels from the arduino. If anyone has a clue why green and red are not getting darker/brighter let me know please.

project.jpgValues.png
author

Buy a prototyping board first,there is no pride taken in this project!!Great Scott has set such wonderful standards,you use a cardboard?

author

Okay I'm blind. Only pins

3, 5, 6, 9, 10, and 11

support PWM


author

You obviously using an Arduino nano which now is blown due to incorrect wiring .

author
bkeskin (author)2017-02-22

could you please explain me what is the capacitor for in this circuit?

author
hoosenzahed (author)bkeskin2017-03-05

Would it kill You to just use it.The video gives detailed information on why you need the capacitor.I watched video 10 times plus,and got it working with one go.

author
MiguelH45 (author)2017-01-31

i made it, but cant post image, so yea.

author
AryV made it! (author)2017-01-21

Thanks.
It was easy to make and works great.
For begginers like me, it is awesome to learn.

4278abcf-5786-4e65-a080-4f93eee2ad41.jpeg
author
hardik vagadiya (author)2017-01-05

Controlyour LEDs with your tv Remot || Arduino IR Tutorial diagram plz

author
DardanB (author)2016-09-03

can someone help me, I have done all the connections as in the diagram and I have tested it with a LED,it works but when I connect the mosfet to switch on the LED strip it always stays on ,it doesn't switch-off or dim the LED strip,is it something wrong with the mosfet or what is it?

author
thenewtrilogy2. (author)DardanB2016-12-02

your mosfets are okay, i had the same problem and the easy fix was resistors... how obvious ^^

author
LucasA49 made it! (author)2016-05-15

Thanks GreatScott =]

IMG_20160515_160757115.jpgIMG_20160515_153455612.jpg
author

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

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

^

Multiple libraries were found for "IRremote.h"

Used: C:\Program Files (x86)\Arduino\libraries\RobotIRremote

Not used: C:\Users\Gabri\Documents\Arduino\libraries\Arduino-IRremote-master

exit status 1

help plz

author
gabriel.lim_2015 (author)2016-10-25

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

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

^

Multiple libraries were found for "IRremote.h"

Used: C:\Program Files (x86)\Arduino\libraries\RobotIRremote

Not used: C:\Users\Gabri\Documents\Arduino\libraries\Arduino-IRremote-master

exit status 1

scott, do something scrub

author
Klitzzz0932 (author)2016-07-10

Can I Supply This Project with a 12v 3A Lead Acid Rechargeable Battery?

author
milindm5 (author)Klitzzz09322016-08-08

Yes of course it will work but be careful arduino only processes 700maH

author
tychobot (author)2016-03-19

thanks for the great instruction! is it also possible to control it with an ATtiny85? because I have some left from the clap switch thing.

author
iLive2Ride76 (author)tychobot2016-07-07

Im wondering this too. Tried but did get som errors. The problem seems to be TIMER-related. Anyone knows if/how to fix this?

author
AdnanH15 (author)2016-05-26

how to fix this error

Arduino: 1.6.9 Hourly Build 2016/04/28 04:33 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\good\AppData\Local\Temp\arduino_modified_sketch_627326\IRrecvDemo.ino: In function 'void loop()':

IRrecvDemo:23: error: unable to find numeric literal operator 'operator"" FF8877'

if (results.value == 20FF8877){

^

IRrecvDemo:33: error: expected '}' at end of input

irrecv.resume(); // Receive the next value

^

IRrecvDemo:33: error: expected '}' at end of input

Multiple libraries were found for "IRremote.h"

Used: D:\Adnan\program\arduino-nightly\libraries\IRremote-

Not used: D:\Adnan\program\arduino-nightly\libraries\RobotIRremote

exit status 1

unable to find numeric literal operator 'operator"" FF8877'

Invalid library found in C:\Users\good\Documents\Arduino\libraries\prject1: C:\Users\good\Documents\Arduino\libraries\prject1

Invalid library found in C:\Users\good\Documents\Arduino\libraries\prject1: C:\Users\good\Documents\Arduino\libraries\prject1

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

author
pradyumna s nadig (author)2016-04-29

it is showing Error what shall i do?plz reply

q.png
author

There are some preinstalled libraries like Robot_Test of something similar. Delete those 3 libraries that solved the problem. Delete all the libraries that has the word "Robot" in it. I think there are 3 in total.

author
maeruf omer made it! (author)2016-04-29

thanks great scott, and it was so simple, i'm gonna use it for my another project

ir.PNGMOV03806.AVI
author
maeruf omer made it! (author)2016-04-29

thanks great scott, and it was so simple, i'm gonna use it for my another project

ir.PNGMOV03806.AVI
author
wzdl (author)2016-04-27

programmer says Redefinition of void setup.

What shall l do?

Thankyou

author
Guransh Singh (author)2016-04-12

So can I use arduino uno with same pins and connections

author
Guransh Singh (author)2016-04-11

When I use 12 v adapter to arduino nano it cause burning sensation.. please tell me solution of this problem as soon as possible.

author

There could be dozens of problems. How should I know what you did wrong?

author
Guransh Singh (author)2016-04-05

Can I program arduino nano on pcb circuit

author
Tech Works (author)2016-02-05

Tha's is a great DIY project. I am following you on Instructables as well as on youtube. But I just want to know why you have added 100uf Capacitor with +ve and -ve terminals of IR receiver. That will be a great help.

author
LucasA49 (author)Tech Works2016-03-09

You can find it on datasheet, page 2. "The external components R1 and C1 are optional
to improve the robustness against electrical overstress
(typical values are R1 = 100 Ω, C1 = 0.1 µF)". I hope I've helped.

Capturar.JPG
author
Tech Works (author)LucasA492016-03-09

yes you helped a lot

author
JSWheeler (author)2015-01-12

How much more work is it going to be to change the colors of your RGB LED strip?

author
GreatScottLab (author)JSWheeler2015-01-12

Instead of one MOSFET you will need three of those. 4 more Resistors and maybe 5 minutes of code editing.

author
JohanM19 (author)GreatScottLab2016-02-02

How should that look? Can i maybe get some help to that?

author
JSWheeler (author)GreatScottLab2015-01-12

Instead of connecting all 3 you would give each one it's own MOSFET and resistor?

author
Spokehedz (author)JSWheeler2015-01-13

Yes, exactly.

author
SoosA made it! (author)2016-01-21

For IKEA led tube control. Great.

20151115_165940.jpg20151115_165859.jpg20151108_224628.jpg
author
LogeshP (author)2015-12-31

Great one! Worked well. But i used only one led... On, off works well. Decrease t brightness works well. But increasing is not workin... Can anyone able to give suggestion

author
mouseybrown (author)LogeshP2016-01-15

this happened to me and I had the the codes for up and down crossed over as yo read the code down I expected the first value to be the "up" but its the other way round if you see what I mean ! I guess what I am trying to say is walk away for an hour then come back and work through the code slowly

author
ArsyadK1 (author)LogeshP2016-01-01

Ever try to look the serial monitor while increasing brightness? Sometimes, the signal somehow changed even with the same button.

author
mouseybrown (author)2016-01-15

needed a bit of thought to debug but very educational for me (a newbie!)

author
LogeshP made it! (author)2015-12-31

Mine,

1451580019821-412204648.jpg1451580042144-104178600.jpg14515800731342002109661.jpg
author
AlexandreB33 (author)2015-12-23

I have a doubt , i ve seen the data sheet of the ir receiver and it says that it only stands a 5 mA current . However arduino is supllying more current in the pin that you ve selected . And the ir supports 2.5 to 5 volts so it will also support 20mA ?

author

It draws around 5mA at the given voltage. It is a constant voltage component, not constant current.

author

now I get it dude that information of supllying 5 mA is for a given voltage that goes to say if it supports 5 volts that means that the ir can handle with the current that is correspondend to 5 volts ?

author
dartfrogdk (author)2015-12-29

what other transistors could you use, i got some TIP120 would they work?

author
AndreaG62 made it! (author)2015-12-03

Thank you a lot GreatScott! I used this instructables to make a relay switch ir-controlled.

photo.png

About This Instructable

93,493views

755favorites

License:

Bio: Awesome Electronics Tutorials, Projects and How To´s
More by GreatScottLab:Make Your Own ESCDIY Short Circuit (Overcurrent) ProtectionMake Your Own Photovoltaic Off-Grid System
Add instructable to: