Sample Experiment Format
Sample Experiment Format
:
Date:
Connection Diagram:
Connection Procedure:
1. Connect Arduino pin 0,1,2,3 with D7, D6, D5, D4 pins of LCD display.
2. Connect 4th pin of Arduino with E pin of LCD display.
3. Connect 5th pin of Arduino with RS pin of LCD display.
4. Connect RW, Vss pin of LCD display with ground pin of Arduino.
5. Connect Vcc Pin of LCD display with 5V supply.
6. Connect middle wire of potentiometer with V0. Other two ends of potentiometer are
connected to Vcc and Ground.
7. Anode of LCD display is connected to +5V through 330 Ω resistor and cathode is
connected to Ground
Specification
The name and functions of each pin of the 16×2 LCD module is given below.
Pin1(Vss):Ground pin of the LCD module.
Pin2(Vcc): Power to LCD module (+5V supply is given to this pin)
Pin3(V0):Contrast adjustment pin. This is done by connecting the ends of a 10K
potentimeter to +5V and ground and then connecting the slider pin to the VEE pin. The
voltage at the VEE pin defines the contrast. The normal setting is between 0.4 and 0.9V.
Pin4(RS):Register select pin. The JHD162A has two registers namely command
register and data register. Logic HIGH at RS pin selects data register and logic LOW
at RS pin selects command register. If we make the RS pin HIGH and feed an input to
the data lines (DB0 to DB7), this input will be treated as data to display on LCD screen.
If we make the RS pin LOW and feed an input to the data lines, then this will be treated
as a command ( a command to be written to LCD controller – like positioning cursor or
clear screen or scroll).
Pin5(R/W): Read/Write modes. This pin is used for selecting between read and write
modes. Logic HIGH at this pin activates read mode and logic LOW at this pin activates
write mode.
Pin6(E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at
this pin will enable the module.
Pin7(DB0) to Pin14(DB7): These are data pins. The commands and data are fed to the
LCD module though these pins.
Pin15(LED+): Anode of the back light LED. When operated on 5V, a 330 ohm resistor
should be connected in series to this pin.
Pin16(LED-): Cathode of the back light LED.
Program:
#include<LiquidCrystal.h>
LiquidCrystal lcd (5, 4, 3, 2, 1, 0); // sets the interfacing pins
void setup ()
{
lcd.begin(16, 2); // initializes the 16x2 LCD
}
void loop ()
{
lcd.setCursor (0, 0); //sets the cursor at row 0 column 0
lcd.print ("Amrita Vishwa"); // prints 16x2 LCD MODULE
lcd.setCursor (0,1); //sets the cursor at row 0 column 1
lcd.print ("Vidyapeetham,NGL");
}
Experiment Output
Result:
The LCD display was successfully interfaced with the Arduino, and it displayed the
programmed text messages as expected.