DIY Inventor
Published

Arduino Text LCD Display & Receive Infrared Remote Code

Use LCD Screen to Display Received Code through Remote on LCD and assign Different Character

BeginnerProtip15,153
Arduino Text LCD Display & Receive Infrared Remote Code

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Infrared Receiver, Remote Control
Infrared Receiver, Remote Control
TSOP1738
×1
JustBoom IR Remote
JustBoom IR Remote
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

IRremote.h Library
LiquidCrystal.h Library

Story

Read more

Schematics

Circuit Diagram

Connection of TSOP1738

Connect the First pin from the left of TSOP1738 (OUT pin) with pin 6 of Arduino.
Hook the Middle pin (GND pin) with the GND pin of Arduino.
Connect the third and the last pin (VCC pin) with 5V pin of Arduino.


Connection of LCD

Connect the First pin from the left of LCD (GND pin) with GND pin of Arduino.
Connect the Second pin from the left of LCD (VCC pin) with VCC pin of Arduino.
Connect the Third pin from the left of LCD (V0 pin) with GND pin of Arduino.
Connect the Fourth pin from the left of LCD (RS pin) with 11 pin of Arduino.
Connect the Fifth pin from the left of LCD (R/W pin) with GND pin of Arduino.
Connect the Sixth pin from the left of LCD (E pin) with 10 pin of Arduino.
Connect the Eleventh pin from the left of LCD (D4 pin) with 5 pin of Arduino.
Connect the Twelveth pin from the left of LCD (D5 pin) with 4 pin of Arduino.
Connect the Thirteen pin from the left of LCD (D6 pin) with 3 pin of Arduino.
Connect the Fourteenth pin from the left of LCD (D7 pin) with 2 pin of Arduino.
Connect the Fifteenth pin from the left of LCD (5V pin) with 1 K Resistor with 2 pin of Arduino.
Connect the Last pin from the left of LCD (GND pin) with GND pin of Arduino.

Code

Code

C/C++
#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();
}
}

Credits

DIY Inventor

DIY Inventor

0 projects • 17 followers
Hello Guys, My name is Krishna Agarwal , and I'm passionate about Making DIY Projects. Here I make Arduino and Robotics related projects.

Comments