Introduction: Finding the IR Codes of Any IR Remote Using Arduino

Picture of Finding the IR Codes of Any IR Remote Using Arduino

Most of the appliances from TV, DTH receiver , DVD Players to AC, etc are controlled wirelessly using IR remotes.

If you want to make an IR based project with a remote which you bought from the market or the remote of your AC, TV ,etc. then, you should be aware of the codes which are sent by the remote to the IR receiver in the appliance or device

We make several projects on various platforms and we always need the codes of any appliance, console, etc just by using an Arduino.

Step 1: THINGS USED IN THIS PROJECT

Hardware components:

  1. Arduino UNO
  2. IR receiver (generic)
  3. IR Remote (Anyone or the one which you want to use in your project)

Software apps and online services:

  1. Arduino IDE

Step 2: ​Working on Basics

Picture of ​Working on Basics

IR remote has a button and a microcontroller with IR LED attached. When a button is pressed, a microcontroller identified the button and sends the corresponding modulated signals (codes) to the IR LED. Then, the IR LED sends it to the IR receiver in the appliance.

System in the appliance demodulate the signals(codes) and the checks the function corresponding to it and executes it. Each function has a different code.

Every IR operated appliance has different codes for different function.

We can't see the infrared(IR) light because their wavelength is not in our spectrum.

Step 3: Hookup

Picture of Hookup

Follow the steps:

  1. Connect the first pin from left (OUT pin) with the pin 11 of Arduino.
  2. Hook the middle pin (GND pin) with the GND pin of the Arduino.
  3. Connect the third pin (VCC pin) with the 5 V pin of the Arduino.

Step 4: ​Code for Finding the IR Codes

Remember to install the IRremote library first

Click on download for .zip library file.

#include //including infrared remote header file
int RECV_PIN = 11; // the pin where you connect the output pin of IR sensor IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); } void loop() { if (irrecv.decode(&results)) { int value = results.value; Serial.println(" "); Serial.print("Code: "); Serial.println(results.value); //prints the value a a button press Serial.println(" "); irrecv.resume(); // Receive the next value Serial.println("*****************"); } }

Step 5: Uploading and Testing

  1. Copy or download the code attached with the project.
  2. Hit upload and open serial monitor.
  3. Take any remote you want to use or you want the codes off it and press any button.
  4. Now, see in the serial monitor. You will see a code of the corresponding button you pressed.
  5. Note the codes on a paper or copy them in a document file on PC.

You can also run the online simulator for further understanding by clicking here.

Comments

ajayt7 (author)2017-09-01

Wow

Matlek (author)2017-08-16

Great! I'll try this!

About This Instructable

1,531views

51favorites

Bio: Doing Computer Science and Engineering in SRM University. Expert in making projects on Arduino platform.
More by chauhannaman98:Sunflower - Arduino Solar TrackerHeart Rate Monitor on Thingspeak IoT PlatformIR Home Automation on DFRobot's Relay Shield
Add instructable to: