Experiment No 11 Student ID
Date Student Name
LCD Display Interfacing with Arduino
Aim/Objective:
The main objective of this experiment is to interface LCD to the Arduino Uno board and
display the messages.
Description:
LCD (Liquid Crystal Display) interfacing with Arduino refers to the process of connecting an
Arduino microcontroller to an LCD screen for the purpose of displaying information. An LCD
screen is a popular choice for visual output in Arduino projects due to its simplicity, low power
consumption, and ease of use.
Pre-Requisites:
1. Basics of Arduino Uno
2. Basics of LCD Display Interfacing
Pre-Lab:
1. What is the purpose of LCD display interfacing with Arduino?
The purpose of LCD display interfacing with Arduino is to connect an LCD screen to
an Arduino microcontroller in order to display information. It allows users to
visually present data, messages, and other relevant information in their Arduino
projects. By interfacing with an LCD display, users can create interactive and
informative user interfaces for their applications.
2. Which library is commonly used for LCD control in Arduino projects?
The "LiquidCrystal" library is commonly used for LCD control in Arduino projects.
This library provides convenient functions and methods to initialize and control the
LCD display, allowing users to easily write and display text on the screen, position
the cursor, and perform other operations for effective interaction with the LCD
module.
3. What are the essential connections required for interfacing an LCD display with
Arduino?
VCC: Connect the VCC pin of the LCD display to the 5V pin of the Arduino for power
supply.
GND: Connect the GND pin of the LCD display to the GND pin of the Arduino to
establish the common ground.
Contrast Control: Connect the contrast control pin (usually labeled as V0 or VO) of the
LCD display to a potentiometer or a voltage divider circuit to adjust the contrast of
the display.
RS (Register Select): Connect the RS pin of the LCD display to a digital pin of the
Arduino. This pin is used to select the register to write data (RS=HIGH) or command
(RS=LOW) to the LCD.
RW (Read/Write): Connect the RW pin of the LCD display to GND to set it in write
mode.
E (Enable): Connect the E pin of the LCD display to a digital pin of the Arduino. This
pin is used to enable the LCD for accepting commands or data.
Data Pins: Connect the data pins (D4, D5, D6, and D7) of the LCD display to any four
digital pins of the Arduino. These pins are used for sending data or commands to the
LCD.
In-Lab:
Program:
A. Display of Message using LCD
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("K L University");
lcd.setCursor(2,1);
lcd.print("FIS - 24EC1101");
}
Connections Diagram:
Circuit Diagram:
B. Display of Message using LCD_ I2C Module
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("An Example of");
lcd.setCursor(1,1);
lcd.print("Display Message");
}
void loop()
{
}
Connections Diagram:
Procedure:
1. Give the connections to the Arduino board as shown in the connection diagram.
2. Open Arduino IDE in the computer
3. Create new file File_--→ New
4. Type your program and Save it in appropriate location in your computer.
5. Compile your program by clicking Verify option in the menu.
6. Once the program compiled successfully, connect the Arduino board to the computer using
USB cable. After connecting, go to Tools ----→ Board ---→ Select Arduino/Genuino
Uno option.
7. After selecting board, go to Tools ----→ Port ---→ Select Arduino Uno COM port 3
(name may appear differently for other computers).
**Note that this port option will be displayed only when board is connected to computer
8. Now upload the program to the Arduino board by clicking Upload option.
9. Once the program uploaded successfully, observe the output on LCD.
Data and Results:
Analysis and Inferences:
Sample VIVA-VOCE Questions (In-Lab):
1.
2.
1. What is the purpose of LCD display interfacing with Arduino?
a.
b. The purpose of LCD display interfacing with Arduino is to connect and control an LCD
screen using Arduino to display information or create interactive user interfaces in Arduino
projects.
c.
d.
e. 2. Which library is commonly used for LCD control in Arduino projects?
f.
g. The commonly used library for LCD control in Arduino projects is the "LiquidCrystal" library.
h.
i. 3. What are the essential connections required for interfacing an LCD display with Arduino?
j.
k. The essential connections include VCC (power supply), GND (ground), RS (Register Select),
RW (Read/Write), E (Enable), and data pins (D4-D7) for communication between Arduino
and the LCD display.
l.
m. 4. How can you control the contrast of the LCD display?
n.
o. The contrast of the LCD display can be controlled by connecting the contrast control pin (V0
or VO) of the LCD to a potentiometer or a voltage divider circuit.
p.
q. 5. How do you initialize the LCD display in Arduino code?
r.
s. To initialize the LCD display in Arduino code, you use the "LiquidCrystal" library's
"begin()" function, specifying the number of columns and rows of the LCD display.
Post-Lab:
Write a Program to display two messages 1. KL University 2. IoT & Sensors
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
lcd.setCursor(0,0);
lcd.print(" KL University");
lcd.setCursor(2,1);
lcd.print(" IoT & Sensors");
}
**Connections are as per Inlab : A circuit
Evaluator Remark (if Any):
Marks Secured _____ out of 50
Signature of the Evaluator with Date