Arduino Ir Remote Control

Hello
Today i've re build my old project.
Here is the schematic :
You can use any type of ir receiver with your arduino, i've use an old ir receiver form my brooked tv.
after Wiring up all upload this code into your Arduino:


/* 5 Channel ir remote control
Created by Asghar Furqan
A fully open-sourse program!

---------------------------------------------------------
circuit:
ir module connected to pin 2(Digital)
led 1-2-3-4-5 connected to pin 3-4-5-6-7
*/



#include

int RECV_PIN = 2;
int led1 = 7;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int led5 = 6;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the ir receiver
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
}

void loop() {


if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);


if(results.value == 16705559) //if you want to configure with your remote controll change the results.value
digitalWrite(led1, HIGH); // set the LED on
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
if(results.value == 16656599)
digitalWrite(led1, LOW); // set the LED off

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

if(results.value == 16672919)
digitalWrite(led2, HIGH); // set the LED on
if(results.value == 16697399)
digitalWrite(led2, LOW); // set the LED off

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

if(results.value == 16689239)
digitalWrite(led3, HIGH); // set the LED on
if(results.value == 16664759)
digitalWrite(led3, LOW); // set the LED off

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

if(results.value == 16668839)
digitalWrite(led4, HIGH); // set the LED on
if(results.value == 16676999)
digitalWrite(led4, LOW); // set the LED off

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

if(results.value == 16674959)
digitalWrite(led5, HIGH); // set the LED on
if(results.value == 16650479)
digitalWrite(led5, LOW); // set the LED off

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

}

}
}

 


These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

12 Responses to this post

  1. Anonymous on December 25, 2012 at 10:50 AM

    will all this work for an arduino uno r3 as well?

  2. Anonymous on February 6, 2014 at 9:14 AM

    NO WORKING PROGRAM

  3. Anonymous on February 23, 2014 at 3:50 AM

    If you want to help then appears a program that works .. not this shit

  4. Anonymous on February 24, 2014 at 2:00 PM

    Program is working just need install libraries https://github.com/shirriff/Arduino-IRremote

  5. Anonymous on February 24, 2014 at 11:36 PM

    ok .. my apologies for the last comment .. usually has a lot of similar programs that work or do not work either ... but the program does not work .. I have installed the library. A fault occurs when compiled.
    at thy video clip works .. ok. it does not matter, mainly my remote works but with another program. in a way that I wanted .. It is a Sony remote control,, ok, once again, my apologies.
    best regards

  6. Anonymous on February 25, 2014 at 1:35 AM

    hi
    that replenished itself .. your right to post what you want, my big mistake that I was tired of studying the remotes, so I wrote what in any case I could not write. Again, I tried your code in Arduino version, 0022,1,0 and 1,0,4 .. not a compilation, as well as the same one I wrote above. but ok, and that your code was ok, would not help me. I've reviewed many, many, video clips, tutorials, and in the end I wrote my code, of course, was my most difficult start - defining pins etc.., but I managed and doing what I need for my project. need to work as a TV, I do not like about you on / off. My code has the power - on / off, volume control, channel up / down, etc. .. ok .. that's all.

  7. Başarist on March 13, 2014 at 3:26 PM

    Its working but you must change this line : #include

    This type : #include

  8. Başarist on March 13, 2014 at 3:33 PM

    This web page is, hide some codes.

    use this line: #include yIRremote.hx
    But change x to >
    and change y to <

  9. Unknown on June 7, 2014 at 12:59 AM

    Its not working in Freeduino uno 1.0.......its shows error in (IRrecv does not name a type)...i installed library ir remote..but still not working..plz help to fix this problem...

  10. Anonymous on December 21, 2014 at 1:40 PM

    Codes and Frequenzy of IR Sensor needs to match values from IR transmitter- than it should work...

  11. Anonymous on February 11, 2015 at 10:23 PM

    Hi, results.value == 16705559) //if you want to configure with your remote controll change the results.value. Where we get these value.

  12. Anonymous on February 19, 2015 at 1:02 PM

    could also connect each LED with a pushbutton?

Leave a comment