0% found this document useful (0 votes)
38 views13 pages

Keypad Interfacing

This document describes how to interface a 16x2 LCD display with an Arduino. It includes the circuit connection details and code to display "Hello World!" on the LCD. The circuit connects the LCD pins to specific Arduino pins like RS, Enable and data lines. The code uses the LiquidCrystal library to initialize the LCD in 4-bit or 8-bit mode and print text to the display.

Uploaded by

Prabal Rawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views13 pages

Keypad Interfacing

This document describes how to interface a 16x2 LCD display with an Arduino. It includes the circuit connection details and code to display "Hello World!" on the LCD. The circuit connects the LCD pins to specific Arduino pins like RS, Enable and data lines. The code uses the LiquidCrystal library to initialize the LCD in 4-bit or 8-bit mode and print text to the display.

Uploaded by

Prabal Rawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Keypad Interfacing

Circuit Connection
Program
Interfacing of 16x2 LCD (Liquid Crystal Display)
with Arduino

Pin 1

Pin 16
Display 32 Characters
#include <LiquidCrystal.h>

The library works with in


either 4- bit or 8-bit mode
(i.e. using 4 or 8 data lines
in addition to the rs,
enable, and, optionally, the
r/w control lines).
Circuit Connection
Circuit Connection
LCD Interfacing Program
Demonstrates the use a 16x2 LCD display. The LiquidCrystal library works with all LCD displays that are
compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them
by the 16-pin interface. This sketch prints "Hello World!" to the LCD and shows the time.
The circuit:

* LCD RS pin to digital pin 12


* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
LCD Interfacing Program
Demonstrates the use a 16x2 LCD display. The LiquidCrystal library works with all LCD displays that are
compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them
by the 16-pin interface. This sketch prints "Hello World!" to the LCD and shows the time.
The circuit:

* LCD RS pin to digital pin 12


* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
// include the library code: void loop()
#include <LiquidCrystal.h> {
// set the cursor to column 0, line 1
// initialize the library with the numbers
// (note: line 1 is the second row, since
of the interface pins
counting begins with 0):

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); lcd.setCursor(0, 1);

void setup() { // print the number of seconds since


reset:
// set up the LCD's number of columns
and rows:
lcd.print(millis() / 1000);
}
lcd.begin(16, 2);

// Print a message to the LCD.


lcd.print("hello, world!");
}

You might also like