How to Decode any IR remote ( TV,DVD,AC any other)


Decoding IR remote



Using this tutorial you can decode any Ir remote Hex code.and we can apply it our project also like home automation,robot control etc.

You need-

Arduino Uno or any other arduino board

TSOP 1738 or 1838

small bread board

jumper wire

& for test a LED


At first you have to add a library ( Download from here)


after download unzip it & paste folder to arduino library folder




connect IR sensor to arduino like above  Schematic


Now upload first code to arduino

First code--

#include <IRremote.h>

int IRpin = 8;
IRrecv irrecv(IRpin);
decode_results results;


void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}  
void loop() 

{   
  if (irrecv.decode(&results)) 
    {
     Serial.println(results.value); // Print the Serial 'results.value'
      delay(10);

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



After this press any key on remote ,Hex code will show on serial monitor

copy hex code of any key in your choice


Now upload second code to arduino

Second code--




#include <IRremote.h>


int IRpin = 8;
IRrecv irrecv(IRpin);
decode_results results;


void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn();
  pinMode(13,OUTPUT);

}

  
void loop() 

{   
  if (irrecv.decode(&results)) 
    {
     Serial.println(results.value);
      delay(10);
      if(results.value==Your remote hex value)
      digitalWrite(13,HIGH); 
      delay(500);
      digitalWrite(13,LOW);
     irrecv.resume(); 
    }
}    


Put your coped hex code to hex value


and insert a LED to digital pin 13 of arduino like bellow  Schematic


 Now press key of your remote LED will blink







Comments

  1. WHERE IS THE ZIP FILE i cant find that

    ReplyDelete
  2. SORRY BUT ANYTHING HAPPENED I RETRIED THIS 2 TIMES

    ReplyDelete
  3. Is there a way to use that code we received and repeat it to the TV for example so i can use it like a remote control if i add some buttons ?

    ReplyDelete
  4. Doesn't record the the IR. Followed the diagram, Installed the arduino instructions, downloaded and extracted files as directed, bought all the parts, got the arduino fired off (after lots of headaches since it wouldn't work for some reason... then it did.. go figure, and nothing shows up on the serial monitor. Tried several remotes, changed out breadboard, changed out wires, changed out TSOP 1838. bypassed breadboard... Nothing. I'm at a lost being so new to this. What could I possibly be missing. I am watching the youtube video as I do this and don't see what I could have possibly missed. Any Ideas? I'm sure its something I missed or I am doing wrong. Really want to build a universal remote so I can put away all these remotes and just use a tablet. Hard for one of those to get lost lol.

    Thank you for sharing your project. Once I get it working it will be Awesome!

    ReplyDelete
    Replies
    1. This actually works as it should. I had a feeling it was something I was doing wrong. ID10T error. I had the wrong part installed lol. I can't believe I did that. Just wasted 3 hours to realize this.... I can't wait to figure this out. Looking forward to figuring out how to use these codes with another project I am following. Between these I should be able to pack up all of my remotes and just use my phone or a tablet to control everything.

      Delete
    2. if ur using tsop 1838 then the vcc n output is switch. And it only works with some remotes

      Delete
  5. Does uploading your IRremote.h override the official one?? Why not rename it to something that does'nt interfere.

    ReplyDelete

Post a Comment

Popular posts from this blog

how to make 4x4x4 led cube using arduino

Connection & wiring of 24 v electric bi -cycle By Techno review 85

Raspberry pi 3.5 inch LCD screen setup & install driver