LCD 16x2 Pinout, Commands, and Displaying Custom Character
LCD 16x2 Pinout, Commands, and Displaying Custom Character
- Advertisement -
We come across Liquid Crystal Display (LCD) displays everywhere around us. Computers, calculators, television
sets, mobile phones, and digital watches use some kind of display to display the time.
Table of Contents
16X2 LCD Display Pinout Diagram
RS (Register Select)
LCD 16×2
Pin Diagram
Pin No.
- Advertisement -
Function Name
RS
(Regis
4 Selects command register when low, and data register when high ter
Select
)
Read/
5 Low to write to the register; High to read from the register
write
Sends data to data pins when a high to low pulse is given; Extra voltage push is
required to execute the instruction and EN(enable) signal is used for this purpose.
6 Enable
Usually, we set en=0, when we want to execute the instruction we make it high en=1
for some milliseconds. After this we again make it ground that is, en=0.
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
RS (Register Select)
A 16X2 LCD has two registers, namely, command and data. The register select is used to switch from one
register to other. RS=0 for the command register, whereas RS=1 for the data register.
Command Register: The command register stores the command instructions given to the LCD. A command is an
instruction given to an LCD to do a predefined task. Examples like:
initializing it
Data Register: The data register stores the data to be displayed on the LCD. The data is the ASCII value of the
character to be displayed on the LCD. When we send data to LCD, it goes to the data register and is processed
there. When RS=1, the data register is selected.
2 02 Return home
CG-RAM is the main component in making custom characters. It stores the custom characters once declared in
the code. CG-RAM size is 64 bytes providing the option of creating eight characters at a time. Each character is
eight bytes in size.
CG-RAM address starts from 0x40 (Hexadecimal) or 64 in decimal. We can generate custom characters at these
addresses. Once we generate our characters at these addresses, we can print them by just sending commands
to the LCD. Character addresses and printing commands are below.
Table
In the table above you can see starting addresses for each character with their printing commands.
The first character is generated at addresses 0x40 to 0x47 and is printed on LCD by just sending a command 0.
The second character is generated at addresses 0x48 to 0x55 and is printed by sending a command 1.
Now create your character at this address. Send the ‘b’ character array values defined above one by one to the
data register of the LCD.
To print the generated character at 0x40. Send command 0 to the command register of LCD. The table below
would explain this more clearly-
CG-RAM Address Table
Any cost-effective Arduino board, a 16X2 character LCD display, jumper wires, and a breadboard are sufficient
enough to build the circuit.
Interfacing Circuit
For detailed explanation, you can check how to use LCD with Arduino.
LCD 16×2 Project Circuit
The detailed project is available at displaying the brightness of a LED on an LCD display.
A 16×2 LCD display is a liquid crystal display that can show 16 characters in each of its two rows, providing a
total of 32 characters of information. It’s commonly used to display alphanumeric information in various
electronic devices.
What kind of information can be displayed on a 16×2 LCD display?
A 16×2 LCD display can display a wide range of information, including text, numbers, symbols, and basic
graphics. It’s often used to display status information, menu options, sensor readings, and more.
This article was first published on 21 November 2016 and recently updated on August 2023.