Here to learn TSOP1738 IR receiver to build an IR Remote Decoder using Arduino nano and LCD. The LCD to display the decoded code – the number for pressed button on IR remote. The hex code for every button will be logged to Microsoft Excel Sheet from the PLX-DAQ release 2.
Components required
TSOP 1738 IR receiver - 1no
Arduino Nano - 1 no
LCD1602 with I²C - 1no
Circuit diagram
TSOP1738(SM0038)
The TSOP sensor has the ability to read the output signals from home remotes like TV remote, Home theatre remote, AC remote etc. All these remotes will work with a frequency of 38kHz and this IC can pick up any IR signals process them and provide the output on pin 3. So if you are looking for a sensor to analyse, re-create or duplicate the functions of a remote then this IC will be the perfect choice for you.
Also keep in mind that this series TSOP-1738 will receive only 38Khz IR signals. All remotes in India will operate in 38Khz, kindly ensure if it is the same in your country.
The TSOP-1738 is an IR Receiver Sensor, which can be used to receive IR signals of 38Khz. The sensor operates on 5V and consumes around 5mA to operate. Normally the signal pin (pin 3) IC is connected to a microcontroller to analyse the IR signal received.
TSOP1738 Pin Configuration
Pin Number Pin Name Description
1 Ground Connected to the Ground of circuit
2 Vcc Typically connect to +5V, maximum of 6V can be given
3 Signal The signal pin gives out the sequence based on the IR
signal detected
Download DATASHEET
PLX-DAQ
PLX-DAQ is a Parallax microcontroller data acquisition add-on tool for Microsoft Excel and acquires up to 26 channels of data from any Parallax microcontrollers and drops the numbers into columns as they arrive. PLX-DAQ provides easy spreadsheet analysis of data collected in the field, laboratory analysis of sensors and real-time equipment monitoring. Any of microcontrollers connected to any sensor and the serial port of a PC can now send data directly into Excel. PLX-DAQ has the following features:
Plot or graph data as it arrives in real-time using Microsoft Excel
Record up to 26 columns of data
Mark data with real-time (hh:mm:ss) or seconds since reset
Read/Write any cell on a worksheet
Read/Set any of 4 checkboxes on control the interface
Example code for the BS2, SX (SX/B) and Propeller available
Baud rates up to 128K
Supports Com1-15
Download PLX-DAQ
Installing Library
Infrared receiver: you need to download and install the IR library.
LiquidCrystal_I2C.h : you need to Download and install the LiquidCrystal_I2C library.
Follow the next steps to install those libraries.
In your Arduino IDE, to install the libraries go to Sketch > Include Library > Add .ZIP library… and select the library you’ve just downloaded.
After installing the required libraries, copy the following code to your Arduino IDE.
Arduino Code
#include <IRremote.h>
int IRPIN = 2;
IRrecv irrecv(IRPIN);
decode_results result;
int RemoteButton = 0;
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn();
Serial.println("Enabled IRin");
Initialize_streamer();
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("INFRARED DECODER");
}
void loop()
{
if (irrecv.decode(&result))
{
RemoteButton = RemoteButton+1;
Serial.print("Value: ");
Serial.println(result.value, HEX);
lcd.setCursor(0,1);
lcd.print("Received: ");
lcd.setCursor(9,1);
lcd.print(result.value, HEX);
Write_streamer();
irrecv.resume();
}
delay(500);
}
void Initialize_streamer()
{
Serial.println("CLEARDATA"); //clears up any data left from previous projects
Serial.println("LABEL,Hex Code, RemoteButton"); //always write LABEL, to indicate it as first line
}
void Write_streamer()
{
Serial.print("DATA"); //always write "DATA" to Indicate the following as Data
Serial.print(","); //Move to next column using a ","
Serial.print(result.value, HEX); //Store date on Excel
Serial.print(","); //Move to next column using a ","
Serial.print(RemoteButton); //Store date on Excel
Serial.print(","); //Move to next column using a ","
Serial.println(); //End of Row move to next row
}
Now open the ‘PLX-DAQ spreadsheet’ file from the Desktop/Laptop. If macros are disabled on your Excel, then Click on Options->Enable the content -> Finish -> OK to Enable the Macros.
Demo
Comments