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 193Next »
tnowroz21 days ago

Really Good Tutorial here bro. Finally made the IR sensor work! :D

But for some reasons, many of the links are not working properly. If would be awesome if you could fix those.

Anyway, Thanks for this! Really appreciate it as a beginner with Arduino! :)

FoamboardRC (author)  tnowroz20 days ago
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.
UrbanErosion made it!2 months 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)  UrbanErosion1 month ago
NP awesome! Good luck with the project!
nreahal made it!1 year 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)  nreahal8 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)  nreahal8 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!

WilliamM204 days ago

Great tutorial,

only problem is that the arduino does not register the IR while battery powered, only while it's connected to the pc. Any tips?

FoamboardRC (author)  WilliamM204 days ago
uh what kind of battery are you using?

I'm using a 6V battery pack, I read that the ideal input voltage is 9-12V but will it effect the arduino so much?

FoamboardRC (author)  WilliamM204 days ago

No it shouldn't. I'm not sure. What do you mean by it's not registering IR

Since I can't use the serial monitor while battery powered I do not know if it is registering the IR signals or not. But if it would it should work fine

FoamboardRC (author)  WilliamM204 days ago

One more thing you can try. Take out the servo. Sometimes they can draw too much power and cause the system to keep restarting. So try the code with the servo totally unplugged. Let me know how that goes

Sadly taking out the servo didn't help

FoamboardRC (author)  WilliamM204 days ago

Low voltage isn't a problem because a USB port is only 5 volts whereas you said you were giving it 6. I'd just completely start over with your project. Maybe your Arduino is broken. Sorry I can't help anymore!

I started over and now it works :)

Thanks, I will try to fix it :)

Maybe the low input voltage is my only problem

The program is not working at all while using battery power, but when I plug it in to the pc it works fine

FoamboardRC (author)  WilliamM204 days ago

Now I'm clueless. All Serial Monitor does is show data that's already been gathered. Can I see your code?

Here it is, sorry if I made a lot of misstakes. Very new to this:)

#include <Servo.h>

#include <IRremote.h>

int IRpin = 11; // pin for the IR sensor

int LED = 13; // LED pin

IRrecv irrecv(IRpin);

decode_results results;

Servo myServo;

boolean LEDon = true; // initializing LEDon as true

void setup()

{

irrecv.enableIRIn(); // Start the receiver

pinMode(LED, OUTPUT);

myServo.attach(6);

}

void loop()

{

if (irrecv.decode(&results))

{

Serial.println(results.value, DEC);

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

}

switch(results.value)

{

case 01: //Blink LED if button 1 is pressed

digitalWrite(LED, HIGH);

delay(100);

digitalWrite(LED, LOW);

delay(100);

break;

case 02: //Light LED if button 2 is pressed

digitalWrite(LED, HIGH);

break;

case 03: //Start servo if button 3 is pressed

myServo.write(0);

delay(1000);

myServo.write(180);

delay(1000);

break;

default: //Default if no button is pressed

digitalWrite(LED, LOW);

myServo.write(84);

}

}

JelleK12 days ago
JelleK12 days ago
SarthakS416 days ago

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)  universallvr1 month 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.96781 month 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.

ecleary762 months 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)  ecleary761 month ago
You'd have to open up the IR library and see what all those values mean.
doug.atwood.52 months ago
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)  chickenwing23 months ago

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

1-40 of 193Next »