Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO IR Remote-Controlled LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO IR Remote-Controlled LCD Display

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller interfaced with a VS1838B IR Receiver and a 16x2 I2C LCD screen. The IR receiver captures signals from an HX1838 Infrared Remote Control, and the received IR codes are displayed on the LCD screen. The Arduino UNO processes the IR signals and controls the LCD display.

Component List

Arduino UNO

HX1838 Infrared IR Wireless Remote Control

VS1838B IR Receiver

LCD Screen 16x2 I2C

Wiring Details

Arduino UNO

VS1838B IR Receiver

LCD Screen 16x2 I2C

Code Documentation

Code Overview

The provided code initializes the IR receiver and the LCD screen. It reads IR signals from the remote control and displays the received IR codes on the LCD screen.

Code

#include <IRremote.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

const int RECV_PIN = 2; // Pin connected to the IR receiver OUT pin (D2)
IRrecv irrecv(RECV_PIN);
decode_results results;

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(9600); // Initialize serial communication
  irrecv.enableIRIn(); // Start the IR receiver

  // Initialize the LCD
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("IR Code: ");
}

void loop() {
  if (irrecv.decode()) {
    unsigned long irCode = irrecv.decodedIRData.decodedRawData;
    Serial.print("IR Code: ");
    Serial.println(irCode, HEX); // Print the received IR code in HEX

    // Display the IR code on the LCD
    lcd.setCursor(0, 1);
    lcd.print("                "); // Clear the previous code
    lcd.setCursor(0, 1);
    lcd.print(irCode, HEX);

    irrecv.resume(); // Receive the next value
  }
}

Code Explanation