Finding the IR Codes of Any IR Remote Using Arduino © GPL3+

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

  • 1,486 views
  • 0 comments
  • 19 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
IR receiver (generic)
×1
IR Remote
Anyone or the one which you want to use in your project.
×1

Apps and online services

About this project

Introduction

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.

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.

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

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.

Hookup

Follow the steps:

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

Uploading and Testing

Remember to install the IRremote.h library from here.

  • Copy or download the code attached with the project.
  • Hit upload and open serial monitor.
  • Take any remote you want to use or you want the codes off it and press any button.
  • Now, see in the serial monitor. You will see a code of the corresponding button you pressed.
  • 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.

Schematics

capture_CQhcYyINfc.PNG
Capture cqhcyyinfc

Code

Code for finding the IR codesC/C++
Remember to install the IRremote library.
#include <IRremote.h>      //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("*****************");
  		}
}

Comments

Similar projects you might like

Using 9 Axes Motion Shield with Arduino

by Techduino

  • 45 views
  • 0 comments
  • 3 respects

Guess the Number With Arduino KeyPad

Project tutorial by Giovanni Gentile

  • 103 views
  • 2 comments
  • 3 respects

LED Roulette Game

Project tutorial by Arduino “having11” Guy

  • 48 views
  • 0 comments
  • 2 respects

Know the Temp of Your Home From Anywhere with Arduino Cloud!

Project tutorial by Isaac100

  • 2,066 views
  • 2 comments
  • 11 respects

Control a 7 Segment Display with a keypad!

Project tutorial by Isaac100

  • 162 views
  • 2 comments
  • 2 respects

Launch Pad Count Down Sequence Display

Project in progress by Douglas Frey

  • 97 views
  • 0 comments
  • 2 respects
Add projectSign up / Login