Arduino IR Code Reader Remote Control Decoder

Introduction

in this tutorial, we will learn how Arduino IR Code Reader Remote Control Decoder Circuit, Infrared (IR) communication is a popular and simple method of wireless communication used in various electronic devices. In this tutorial, we will learn how to decode the signals from any remote control using an IR receiver module and Arduino, and how to use those signals to control Arduino wirelessly.

Hardware Required

Now you will need the following compounds for making the Arduino IR Code Reader Remote Control Decoder project.

Components#Buy From Amazon
Arduino UNO1Buy Now
TSOP1738 IR receiver module1Buy Now
TV remote control1Buy Now
LED 5mm1Buy Now
Resistors 220Ω1Buy Now
Jumper WiresBuy Now
Breadboard1Buy Now

What is TSOP1738 IR Receiver

The TSOP1738 is a type of infrared (IR) receiver module that is commonly used in remote control applications. It is designed to detect IR signals transmitted by remote control and convert them into electrical signals that can be interpreted by a microcontroller or other device.

The TSOP1738 is a compact module that includes an IR sensor, a demodulator circuit, and a preamplifier. It is sensitive to IR signals with a frequency of 38 kHz, which is commonly used in most remote control applications. When an IR signal is received, the module outputs a digital signal that corresponds to the binary code of the received data.

The TSOP1738 is commonly used in various applications, such as controlling electronic devices with a remote control, security systems that use IR sensors for motion detection, and robotics projects that require IR communication. Its compact size, low cost, and ease of use make it a popular choice for hobbyists and professionals alike.

Pinout of TSOP1738

TSOP1738-IR-receiver-pinout

Pin Configuration of TSOP1738

Pin NameDescription
GroundConnected to the Ground of circuit
VccTypically connect to +5V, maximum of 6V can be given
SignalThe signal pin gives out the sequence based on the IR signal detected

Characteristics of TSOP1738

  1. Minimum and Maximum Input Voltage is -0.3 and 5V respectively. Typically +5V is used.
  2. Can detect IR signals from Remotes (38kHz)
  3. Operating current: 5mA
  4. High Range and wide coverage area.
  5. Will respond only to IR signals, due to high immunity against ambient light
  6. Low power consumption
  7. Has in-built pre amplifier
  8. TTL and CMOS compatible

Working Explanations

The IR receiver module is used to receive the signals from any remote control, and it decodes the signals using the TSOP1738 IC. The decoded signals are then sent to the Arduino Uno board using a digital input pin. Once the signals are received by the Arduino board, they can be used to control various electronic devices such as LEDs, motors, and relays.

In the transmitter part, we use the same remote control to send the signals to the Arduino board through an IR LED. When a button on the remote control is pressed, it sends a signal to the Arduino board, and the Arduino can use that signal to control various electronic devices.

Circuit Diagram

The following circuit shows you the connection to Arduino IR Code Reader Remote Control Decoder Please make the connection carefully

Arduino-IR-code-reader-remote-control-decoder-circuit

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Installing Libraries

Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow

Code

We will first decode the signals from the remote control using this sketch

//For more Projects: www.arduinocircuit.com

#include <IRremoteInt.h>

#include <IRremote.h> // use the library
int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results;

void setup()
{
  Serial.begin(9600); // for serial monitor output
  irrecv.enableIRIn(); // Start the receiver
  pinMode(9, OUTPUT); // Pin 9 output
}
void loop()
{
  if (irrecv.decode(&results)) // have we received an IR signal?
  {
    Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal
    irrecv.resume();// receive the next value
  }
   
}

Serial Monitor

first step)

  • We open the serial monitor;

second step)

  • Press a button on the remote control and read the value that appears on the serial monitor window (I pressed the 6 key and the window shows 406 or 10406):
Arduino-IR-code-reader-and-transmitter-Serial-Monitor

To use the values ​​written in the serial monitor just add 0x before the symbol of the value in the sketch. In this case, we will make Arduino perform a function, such as making a LED light up.

Here is the Code

//For more Projects: www.arduinocircuit.com

#include <IRremoteInt.h>

#include <IRremote.h> // use the library
int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results;

void setup()
{
  Serial.begin(9600); // for serial monitor output
  irrecv.enableIRIn(); // Start the receiver
  pinMode(9, OUTPUT); // Pin 9 output
}
void loop()
{
  if (irrecv.decode(&results)) // have we received an IR signal?
  {
    Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal
    irrecv.resume();// receive the next value
  }
 
  if ( results.value == 0x406 ||  results.value == 0x10406 ){ //tasto 6 sul telecomando
    digitalWrite(9, HIGH);   // set the LED on
  } 
 if ( results.value == 0x404 ||  results.value == 0x10404 ){ //tasto 4 sul telecomando
    digitalWrite(9, LOW);   // set the LED 0ff
  }  
}

And with this, I’m done, I hope I was helpful.
To download the sketches just click below.
Happy designing!!!

Note

I report a problem common to many, if when checking the IDE the error  TKD2 was not declared in this scope appears, don’t worry. To solve it just go to C: > Program Files (x86) > Arduino > libraries and delete the RobotIrRemote folder.

Applications

  1. Wireless control of home appliances using a remote control
  2. Controlling a robot wirelessly using a remote control
  3. Home automation systems
  4. Controlling LEDs and other lighting systems using a remote control
  5. Security systems using infrared sensors and remotes

Conclusion

Using an IR receiver and transmitter, we can easily control electronic devices wirelessly using a remote control. It is a simple and cost-effective way to implement wireless communication in various electronic projects.

Leave a Comment


error: