Instructables
loading
loading

How to Use IR Remotes with Arduino (Current and Updated)

Picture of How to Use IR Remotes with Arduino (Current and Updated)

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 [ 03/31/2015 ]


Now I've never tested this process on a windows but I know
that it works on a mac. It should be the same for windows, just delete any mac content in the zip.

IMPORTANT NOTICE:

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 file called "RobotIRemote". This file will be in the Arduino program.

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

 
Remove these adsRemove these ads by Signing Up

Step 1: Ingredients:

Electronics:

  • Arduino
  • Any IR remote
  • IR receiver
  • Breadboard
  • Jumper Cables
  • LED


And here is the Make-To-Learn contest questions! - don't forget to vote!

What did you make?
Well I didn't make anything specific in this instructable but it is more of a guide to how to make your other projects 'wireless'.
My projects works by taking TV remotes and other remotes, converting their signals to numbers, and using them.
How did you make it?
I've been working on trying to use IR remotes. All the tutorials I found didn't really put the all the bits and pieces together for me. My main goal was to make an easy tutorial for others to follow.
Where did you make it?
At my computer. I am now able to control my robots and other stuff, like lights and lighting. For instance, I could make it so that whenever I hit the play button on my DVD player remote, the lights in the room dim, or go out.
What did you learn?
My biggest challenge was finding a IR decoder that worked, and then finding installing the proper library.

1-40 of 174Next »
UrbanErosion made it!1 month ago

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.

IMG_20150224_102731.jpg
FoamboardRC (author)  UrbanErosion24 days ago
NP awesome! Good luck with the project!
nreahal made it!11 months ago

Sir,

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 "led control using ir remote", 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.
Thank you once again,
regards

Nishant(INDIA)

:)

20140524_213404.jpg20140524_213431.jpg20140524_213441.jpg20140524_213913.jpg20140524_213922.jpg
FoamboardRC (author)  nreahal7 months ago

Sweet man! Good job! Keep up the good work!

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 :)

FoamboardRC (author)  nreahal7 months ago

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!

THIS IS WHAT IM GETTING. PLEASE HELP.

Decode_IR.cpp.o: In function `_GLOBAL__sub_I_IRpin':
/usr/share/arduino/Decode_IR.ino:28: undefined reference to `IRrecv::enableIRIn()'
/usr/share/arduino/Decode_IR.ino:28: undefined reference to `IRrecv::decode(decode_results*)'
/usr/share/arduino/Decode_IR.ino:28: undefined reference to `IRrecv::resume()'
/usr/share/arduino/Decode_IR.ino:28: undefined reference to `IRrecv::IRrecv(int)'
collect2: error: ld returned 1 exit status

FoamboardRC (author)  universallvr12 days ago

http://forum.arduino.cc/index.php?board=4.0

After uploading your ir signal code on my arduino 1.0.6

got an error

'TKD2' was not declared in this scope

how to solve this problem ?

FoamboardRC (author)  kartik.arora.967824 days ago

Stephen Lowry (http://www.instructables.com/member/stephen+lowry/ ) said,

"hi i found this

I had the same issue! There is a conflict with the new(?) RobotIRremote-Library of Arduino IDE 1.0.6.
My solution was to take RobotIRremote out of the Arduino-libraries folder and everything worked again.

hope it helps

stephen "

Try that. Thanks Stephen.

Otherwise chat it up on the Arduino forums.

ecleary761 month ago

Good tutorial :)

the line of code; if (irrecv.decode(&results)) im unsure of the irrecv.decode(&results) part what exactly are we testing for with this?

FoamboardRC (author)  ecleary7624 days ago
You'd have to open up the IR library and see what all those values mean.
Thanks, the starting point of project for my wife.
Sonehiw i really dont know how i fix the problem with irremotetools.h

i have this problema when i try to upload the code

C:\Program Files\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
^
Error de compilación

what can i do? i have the same problema with all the codes i tryed but dont work, i also have a poblem with my bluetooth shield but i guess y try with the ir first and see if it Works,

thanks so much for your help, if you can email me will be wonderfull

b_playa1@hotmail.com

hi i found this

I had the same issue! There is a conflict with the new(?) RobotIRremote-Library of Arduino IDE 1.0.6.
My solution was to take RobotIRremote out of the Arduino-libraries folder and everything worked again.

hope it helps

stephen

Thanks for your help i toke and example from youtube video and then i just change almost everything but as long as it accept my ir remote its ok niw i hve my car runnig lol. But i have another issue i need to turn and led with blueetooth android and i donnt kniw how u can paire my cell with the bluetooth shiel but it wint sen the data ti the arduino. If you have any ideas in how i can fix these will be great. Thank you so much i will post some pics of my little project
chickenwing23 months ago
Can you help me with the errors i keep getting Like tkd2 was not declared?

rename files downloaded IRremote.h and IRremoteInt.h with another name, if you dont replace file has conflict with default libraries in Arduino (Arduino/libraries/RobotIRremote/IRremote.h

thats works for me

Sorry now its say stuff like no classname, im getting really close to giving up.
FoamboardRC (author)  chickenwing22 months ago

Post it on the Arduino forum. . . I can't help.

This is just superb! Great tutorial. It served as my very first mini project. Now this can be taken to a greater level. Kudos to you!

FoamboardRC (author)  pratik.kulkarni.1082 months ago
Thanks! Glad I could help!
alexlribeiro2 months ago

friend'm new here on your blog, how to light the lamp of the fan and the fan, using his remote control and the IR for Arduino.

Example = pick up the remote fan, tighten to the IR, record and then use IR light to light and turn on the fan using the notebook and also via bluetooth.

thank you

FoamboardRC (author)  alexlribeiro2 months ago
That's for a future instructble. Stay subscribed :D
vinay07452 months ago

I have install the library but the examples in that library show "error compling" when uploaded.

FoamboardRC (author)  vinay07452 months ago
That's all it says? What's the specific error?

IRtest.cpp.o: In function `__static_initialization_and_destruction_0':

C:\Program Files (x86)\Arduino/IRtest.ino:59: undefined reference to `IRrecv::IRrecv(int)'

IRtest.cpp.o: In function `IRsendDummy::useDummyBuf()':

C:\Program Files (x86)\Arduino/IRtest.ino:87: undefined reference to `irparams'

C:\Program Files (x86)\Arduino/IRtest.ino:88: undefined reference to `irparams'

C:\Program Files (x86)\Arduino/IRtest.ino:93: undefined reference to `irparams'

C:\Program Files (x86)\Arduino/IRtest.ino:93: undefined reference to `irparams'

C:\Program Files (x86)\Arduino/IRtest.ino:93: undefined reference to `irparams'

IRtest.cpp.o:C:\Program Files (x86)\Arduino/IRtest.ino:93: more undefined references to `irparams' follow

IRtest.cpp.o: In function `verify(unsigned long, int, int)':

C:\Program Files (x86)\Arduino/IRtest.ino:123: undefined reference to `IRrecv::decode(decode_results*)'

IRtest.cpp.o: In function `testRC6(unsigned long, int)':

C:\Program Files (x86)\Arduino/IRtest.ino:152: undefined reference to `IRsend::sendRC6(unsigned long, int)'

IRtest.cpp.o: In function `testRC5(unsigned long, int)':

C:\Program Files (x86)\Arduino/IRtest.ino:147: undefined reference to `IRsend::sendRC5(unsigned long, int)'

IRtest.cpp.o: In function `testSony(unsigned long, int)':

C:\Program Files (x86)\Arduino/IRtest.ino:142: undefined reference to `IRsend::sendSony(unsigned long, int)'

IRtest.cpp.o: In function `testNEC(unsigned long, int)':

C:\Program Files (x86)\Arduino/IRtest.ino:137: undefined reference to `IRsend::sendNEC(unsigned long, int)'

MaheeG vinay07452 months ago

hey I found a solution for this.

go to Documents\Arduino\libraries\IRremote and right click on "IRremoteInt.h" and select edit. then it open change "#include <WProgram.h>" to #include <Arduino.h>. Worked for me. I hope it'll work for you.

FoamboardRC (author)  vinay07452 months ago

Ok so it's not recognizing the library. First of all make sure that you've included the library in your sketch, and then make sure you have the library installed in the correct place. If you changed the name of library it wouldn't work. Otherwise try redownloading it, or try it directly from ken shirrif's page,

https://github.com/shirriff/Arduino-IRremote

If it still doesn't work post on the Arduino Forums.

chickenwing23 months ago
Can you help me with the errors i keep getting Like tkd2 was not declared?
FoamboardRC (author)  chickenwing23 months ago
Post it on the Arduino forum. . . I can't help.
Araonp3 months ago

do you know how to use codes in hex format?

FoamboardRC (author)  Araonp3 months ago
No.

thx anyway

Hi, great tutorial, got the IR remote working straight away, thanks. A quick question, if I want to manage multiple operations with the remote but leave them on while doing another operation how would I go about it. What I want to do is control some LEDs on a model, switch engines on half brightness, then full, also fire guns and start and stop flashing. Hope that makes sense! All the tutorials appear to be for single action remote. Thanks.

FoamboardRC (author)  warren.monks.33 months ago

Look at the switch case example.

naminshah4 months ago

whenever i try to compile the decoder sketch it gives me an error compiling message with n reason why ..,... could u provide me with some insight

FoamboardRC (author)  naminshah4 months ago

There's always a reason for the error. What board are you trying to upload it to?

1-40 of 174Next »