Receive Infrared Remote Code & Text LCD Display on Arduino Use the LCD screen to display the received code from the remote and assign different characters to the code.
Learn how to use Arduino to decode IR remote control signals from any remote and display the code on an LCD.
You may assign several remote buttons and display various characters on the LCD.
The remote controls we use in our homes, such as the TV remote, DVD remote, and Sound System remote, are all built of infrared emissions. However, because each key on the remote control has a distinct operation code in Hexadecimal format, these signals never interfere with one another. We can figure out what the key's unique code is by decoding these signals. Knowing the codes allows us to create many programmes that we can operate with the same remote.
Working on the Fundamentals
A button and a microcontroller with an IR LED are linked to the IR remote. When a button is pushed, a microcontroller recognises it and transmits the IR LED the relevant modulated signals (codes). The IR LED then delivers it to the appliance's IR receiver.
The system in the appliance demodulates the signals (codes) and checks and executes the function that corresponds to it. Each function is assigned a unique code.
Every IR-controlled device has a unique code for each function.
The project may be used in a variety of ways:
- If the IR Remote signal is not designated in the Program, you can decode it and show it on the LCD.
- By pressing a series of buttons, you may display any character on the LCD screen.
- By assigning in Program, you may also execute several functions.
TSOP1738 is connected.
- Connect pin 6 of Arduino to the first pin from the left of the TSOP1738 (OUT pin).
- Connect the Middle pin (GND pin) to the Arduino's GND pin.
- Connect the third and last pins (VCC pins) of the Arduino to the 5V pin.
LCD Connections:
- Connect the LCD's first pin from the left (GND pin) to the Arduino's GND pin.
- Connect the LCD's second pin from the left (VCC pin) to the Arduino's VCC pin.
- Connect the LCD's third pin from the left (V0 pin) to the Arduino's GND pin.
- Connect the LCD's fourth pin from the left (RS pin) to the Arduino's 11 pin.
- Connect the LCD's fifth pin from the left (R/W pin) to the Arduino's GND pin.
- Connect the LCD's sixth pin from the left (E pin) to the Arduino's 10 pin.
- Connect the 11th pin from the left of the LCD (D4 pin) to the Arduino's 5 pin.
- Connect the LCD's 12th pin from the left (D5 pin) to the Arduino's 4 pin.
- Connect the 13th pin from the left of the LCD (D6 pin) to the Arduino's 3rd pin.
- Connect the LCD's 14th pin from the left (D7 pin) to the Arduino's 2 pin.
- Connect the 15th pin from the left of the LCD (5V pin) to the 2pin of the Arduino with a 1 K Resistor.
- Connect the LCD's last pin from the left (GND pin) to the Arduino's GND pin.
Remember to download and install the IRremote.h and LiquidCrystal.h libraries from here.
- The project's code can be copied or downloaded.
- Look into the LCD after pressing the upload button.
- Press any button on any remote you wish to utilise or get the codes off of.
- Look at the LCD now. A code for the matching button you pushed will appear.
- You may also use the Remote to designate a function to the LCD display.
- Note the codes on a piece of paper or in a PC document file.
#include<LiquidCrystal.h> #include <IRremote.h> int RECV_PIN = 6; IRrecv irrecv(RECV_PIN); decode_results results; LiquidCrystal lcd(11, 10, 5, 4, 3, 2); int i=0; byte Heart[] = { B00000, B01010, B11111, B11111, B01110, B00100, B00000, B00000}; byte Z1[] = { B01111, B00001, B00010, B00100, B01000, B01111, B00000, B00000}; byte Z2[] = { B00000, B00000, B00000, B00111, B00001, B00010, B00100, B00111}; void setup() { lcd.createChar(1, Heart); lcd.createChar(2, Z1); lcd.createChar(3, Z2); Serial.begin (9600); irrecv.enableIRIn(); lcd.begin(16, 2); lcd.print("Starting System"); delay(2000); lcd.clear(); lcd.print("System on"); delay(1000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Press Button"); lcd.setCursor(0, 1); lcd.print("To Get Value"); } void loop(){ if (irrecv.decode(&results)){ switch(results.value) { case 0xF720DF://1 Button Serial.print("Button Pressed 1 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 1"); // Button 2 lcd.setCursor(0, 1); lcd.print("How Are You"); break; case 0xF7A05F://2 Button Serial.print("Button Pressed 2 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 2"); // Button 2 lcd.setCursor(0, 1); lcd.print("What to Do?"); break; case 0xF7609F://3 Button Serial.print("Button Pressed 3 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 3"); // Button 2 lcd.setCursor(0, 1); lcd.print("Good Morning"); break; case 0xF7E01F://4 Button Serial.print("Button Pressed 4 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 4"); // Button 2 lcd.setCursor(0, 1); lcd.print("Good Afternon"); break; case 0xF710EF://5 Button Serial.print("Button Pressed 5 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 5"); // Button 2 lcd.setCursor(0, 1); lcd.print("Custom Icon"); break; case 0xF7906f://6 Button Serial.print("Button Pressed 6 Passing Text to LCD"); lcd.begin(16, 2); lcd.print(" I "); lcd.write(1); lcd.print(" ARDUINO"); lcd.setCursor(0,1); lcd.print(" I sleep "); lcd.write(2); lcd.write(3); break; case 0xF7D028://5 Button Serial.print("Button Pressed 6 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 6"); // Button 2 lcd.setCursor(0, 1); lcd.print("Good Night"); break; case 0xF750AF://7 Button Serial.print("Button Pressed 7 Passing Text to LCD"); lcd.begin(16, 2); lcd.print("Button Press 7"); // Button 2 lcd.setCursor(0, 1); lcd.print("Animate Text"); break; case 0xF7D02F://8 Button Serial.print("BLinking"); lcd.begin(16, 2); lcd.print("BLinking"); // Button 2 lcd.setCursor(0, 1); lcd.print(" Text "); lcd.noBlink(); delay(2000); lcd.blink(); delay(2000); case 0xF730CF://9 Button Serial.print("Scroll"); lcd.setCursor(15,0); lcd.print("I LOVE"); delay(500); for(i=0;i<20;i++) { lcd.scrollDisplayLeft(); delay(150); } lcd.clear(); lcd.setCursor(15,0); lcd.print("ARDUINO"); delay(500); for(i=0;i<22;i++) { lcd.scrollDisplayLeft(); delay(150); } lcd.clear(); break; default: Serial.print("Undefined code received: 0x"); Serial.println(results.value, HEX); lcd.begin(16, 2); lcd.print("Undefined Button"); lcd.setCursor(0, 1); lcd.print(results.value, HEX); break; } irrecv.resume(); } }
0 Comments