I'm tired of these complicated tutorials on how to use certain things. I like simple, easy to understand, step by step instructions. My biggest problem was with IR and POV*. I've finally mastered how to control my project with any TV remote in a few minutes. In this i'ble I'm going to show you simple, step by step instructions on how to control just about anything with your IR remote.

By the way this tutorial is new and updated and works! Last update [ 10/12/2015 ]


With the latest release of the Arduino IDE there is a conflicting library that renders this tutorial void. If you'd still like to use this tutorial delete the library called "RobotIRemote". This file will be in the Arduino program. Instructions for deleting this file is in step 3.

This library is for a specific robot that Arduino/venders sell. Unless you intend on buying that shield you can delete that folder and continue with this set of instructions. You can always download it again later!

Step 1: Ingredients:


  • Arduino
  • Any IR remote
  • IR receiver
  • Breadboard
  • Jumper Cables
  • LED
<p>JUST PERFECT!!!</p><p>Best Arduino related tutorial and &quot;instructable&quot; that I read so far, (and I assure you I read a lot).</p><p>Well organized, simple, straight forward, contains all what is required and with a light touch of humor.</p>
Thanks! I'm glad to help where I can!
<p>You are amazing, made my work so easy. Thanks alot :)</p>
<p>This was SOO much better than Adafruits tutorial that has massive arrays you have to capture and then use for each button. Normally they have the BEST stuff for easy understanding. HOWEVER this was by FAR the easiest for my remotes!! The library is about twice the size of the ada one BUT this is so much better I will take the loss on Flash for this ease!! :) <br>I only have one small glitch and it may just have to do with the remote I'm using BUT, if you click the remote too fast the read code loops forever. So the led just flashes all on it's own, until you do a long press on the remote. Again not sure if this is all remotes or just the one I chose. But I plan on adding this to my daughters Tiara project seen below. I want to cram a small tiny remote into a cheap wand, so the wand will control the Crown / Tiara.. Thanks AGAIN!! ~Steve~<iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/qCLX8vt_f0o" width="500"></iframe></p>
Hey thanks so much! I'm really glad that I was able to help you out!<br><br>Yeah actually it does the same thing for everyone. That was the main complaint I got because of the looping- it's not my library!<br><br>The fix is really simple, after the if statement {<br> if (results.value == X) }<br>add a small delay, like { delay(25); }. <br><br>This worked for me to keep it out of the loop, but don't put the delay too high. I forgot the actual milliseconds I used to fix it. If you go too high then sometimes when you press the button at the same time the arduino is frozen because of the delay. If you go too low then it doesn't fix the loop problem. Experiment, you'll get it. <br><br>And very nice project BTW! <br><br>Instead of cramming a remote into a wand you should just send a signal using an ATtiny85/45/44/24/ and the send feature of IR library. <br><br>I'm still here if you need any help with the IR part. . . :D
<p>hi i used:</p><p>results.value=0;</p><p>on the beginning of the void loop... fixed it for me :)</p>
<p>After beating my head against the wall for 20 mins trying to solve the flashing with the delay (Which I could not get to work) I found the PERFECT solution that works 100% everytime Change this line to:</p><p>if (results.value == 16236607) {results.value = 0; //Do something here}<br>By resetting the &quot;results&quot; back to 0 it cures the looping, because it can't &quot;see&quot; the correct value again until it gets the real code again from the sensor.<br>Thanks again you may want to update the code you shared with this correction and the problem is gone for good :) </p>
<p>Duuude of course! I can't believe I didn't think of that! I never actually used the code (like in a project) other than testing it briefly for the i'ble. I'll go back and change it. Thanks! You could get really fancy and go with an ATtiny13-20SU. I just got a shipment of 20 in the mail! :D</p>
<p>Awesome thanks for the hints!! <br>Yeah no clue why I didn't think of just using the ATTiny!?!?!?! Perfect Idea!!!</p>
<p>Really Good Tutorial here bro. Finally made the IR sensor work! :D</p><p>But for some reasons, many of the links are not working properly. If would be awesome if you could fix those. </p><p>Anyway, Thanks for this! Really appreciate it as a beginner with Arduino! :)</p>
Thanks! I'm not sure what you are talking about the links though. I just went through and checked all of them and they are all working. Maybe you might just have to copy the address and paste it in your browser's address bar.
<p>Thanks for the Instructable! I want to turn my amp on and off when my Arduino senses signal from my Sonos. Needed the codes from my remote as I couldn't find them elsewhere. </p>
NP awesome! Good luck with the project!
<p>Sir,</p><p>I am very thankful for your help by these tutorials. I have just received my Arduino NANO in the afternoon and at 9 i have completed my very first Arduino project &quot;led control using ir remote&quot;, thanks to your amazing tutorial. In the following images i have been trying to show that when i press volume up it will switch ' on ' the right LED and when i press the volume down button it will switch ' off ' the LED and same has been done to the right one using program up and down of the ir remote.<br>Thank you once again,<br>regards </p><p>Nishant(INDIA)</p><p>:)</p>
<p>Sweet man! Good job! Keep up the good work!</p>
<p>I have made my mom's room room automated. Now its time for the other room you are awesome ;) :) :). Blessings from my mom too. you are awesome :)</p>
<p>Wow thanks! That is soo cool! I keep on telling myself that I should hook up my light and my fan and outlets to IR, but I'm too lazy to get around to it! Good luck!</p>
<p>really thank you, you absolutely saved me :-)</p>
<p>I am trying to get an IR receiver to work on the Digistump Oak, which is an ESP8286. When trying to run your code (after downloading your files) I get the error:</p><p>avr/interrupt.h: No such file or directory</p><p>Thoughts on how to get this to work?</p>
<p>Long delays (over 8000ms) were causing the loop to start and repeat without any remote inputs. Breaking the delay into eight segments of 1000ms fixed this problem, no idea why. The loop would also repeat if I pressed a button too long but adding {results.value = 0;} after the if statement fixed this issue.</p>
<p>Hey man trying to set this up (plz dont grill im a NOOB) but every time I open the Serial Monitor to try and set up the button values it just spits a bunch of random numbers. Any Idea why ? </p>
Hmm, not sure. Just random numbers or also characters?
<p>What happens is, when i press the same button 3 times in a row ( dont why its 3) the LED will just keep flashing for a while and then stop. No idea why :/</p>
<p>Increase all the delays a little.</p>
<p>you made it incredibly simple!!!</p>
<p>it works :D</p>
<p>pasenme el zelda, no soy pro :'v</p>
<p>This is an excellent project Works great with LED. However, small motor creates problem. Cannot turn off. I see suggestions of others but I am not sure where to insert it in the code (i.e, delay(25); or results.value=0; Please, help!</p>
So. . . what are you trying to do? Add a delay or change results.value?
Change code to stop a flickering LED and also allow the motor to be turned off. It is as if the LED is oscillating between the on-off state. And the switches on but not off. Whatever works...delay or results.value modification. Some of the people following ur project suggested it.
<p>Try changing all the delays to 250-1000ms</p>
<p>Show!!! Simples e objetivo.</p>
<p>Hi I would like to know how can I control my arduino based car so when I maintain the button presed it will move forwad and when I take my finger from it to stop the car.</p><p>I have tryed many ways but none of them good....the only result it was that after presing the button the car would go ahead and wouldn't stop just if I reset the board.</p>
<p>I am not getting the same results after repeating a button even if I press another one and go back to the one I pressed originally</p>
You have to use a different remote then
<p>Hi,</p><p>Nice tutorial. However, I have a problem on which I can't find anything on internet. </p><p>When I press the same button several times, I get different numbers. There is one number that comes more often than the rest, but for some buttons there can be like maybe ten different numbers... How can I solve this problem? Does it have to do with the compatibility of the remote and the sensor? </p>
Get a different remote, like this http://www.ebay.com/itm/1Pcs-Infrared-IR-Wireless-Remote-Control-Module-Kits-for-Arduino-NEW-/400985211071?hash=item5d5c94c0bf:g:CiAAAOSw-7RVC3ii
No it just has to do with your remote, you probably aren't in the US. Different countries don't have the same encoding etc.
<p>I got below error...</p><p>C:\Arduino\hardware\tools\avr/bin/avr-ar: unable to rename 'core\core.a'; reason: Permission denied</p><p>exit status 1</p><p>Error compiling.</p><p>I am using windows7 laptop, How can i solve this issue.</p>
IDK check the Arduino Forums<br>
<p>Hiya, Great instructable, got it working first time. Question I'd like to ask is....I have a project running on a Arduino nano and I would like to control it using a remote instead of keep switching it off by the plug switch, can I incorporate this into controlling the nano by switching it off and on using the remote. Or would I need to use a relay. Basically I want to turn the nano off but keep power to the receiver so when I press the power button it turns on the nano, </p>
The nano itself has to be constantly running. You can put the sleep to chip though to save energy, see Kevin Darrah's tutorials on youtube about that.
<p>C:\Program Files\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope</p><p> int RECV_PIN = TKD2; // the pin the IR receiver is connected to</p><p> ^</p><p>exit status 1</p><p>Error compiling.</p>
You didn't remove the conflicting library. Read the instructions over again.
Yes, I found out after I post it. Sorry for trouble. :)
<p>Hi FoamboardRC</p><p>First thanks for the very fine toturial - I got it wirking right away.</p><p>But.. I hope you can help.</p><p>Most remote controllers use 38kHz as carrier, but b&amp;o uses 455kHz.</p><p>When using a TSOP7000 (455kHz IR reciever) I get no other output in the serial monitor as: 632192736 no mather what button I press.</p><p>So, is the frequency defined in the software (library) somewhere?</p><p>Do you have any idea ?</p>
I don't I'm sorry! I didn't even know about the frequencies. Good luck!
<p>Hi there, nice tutorial indeed. Thanks.</p><p>I can read codes and with some modifications to repeat the code when the button is held down.</p><p>What I am trying to do is to automate a CNC machine which accepts keyboard shortcuts. So I am using IR decoder and USB HID KEYBOARD library. For single commands it works very nice, but for repetitive like moving X, Y or Z axis there is a lag.</p><p>When a button is pressed I get the corresponding code and can send it with: <strong>Keyboard.press(KEY_UP);</strong></p><p><em>My question: Is there a way to get when the button is released so I can send: <strong>Keyboard.releaseAll();</strong></em></p>
I have no clue :D Good luck!
<p>Very simple to understand. thanks for ur efforts :)</p>

About This Instructable




Bio: ¿Qué tal? I'm 16 and enjoy learning about electronics. I am self-taught. I love programming my Arduino and soldering circuits. My newest hobby is ... More »
More by HavocRC:DIY FPV Antenna Protector Case Control Your RC Plane With Your Phone's Acclerometer DIY Receiver Controlled Switch (Cheap and Easy) 
Add instructable to: