Compared to other controllers, Interfacing LCD with Arduino is very easy. In in other microcontrollers, one should write the complete code for the working of LCD where as arduino provides a very good platform for non-programmers. Let us see the interfacing clearly.

16X2 LCD is the most commonly used LCD Display.16X2 indicates that it can display 32 characters in 2 lines. It has 16 pins. They are shown below.

LCD Pin Configuration

Pin Description

Data Pins: Pin7 to Pin14 are data Pins. Vss: It is the Ground Pin of the module. Vdd : It is the supply pin of the module. VEE : Pin3 is used for controlling the brightness of the LCD. Normal setting of this pin is between 0.4V to 0.9V.A 10 k pot is connected to adjust the brightness of the screen. Register Select : RS pin is used to select the register. There are two registers in this LCD. They are data register data   instruction register. Data register sends data to the screen while instruction register sends Commands to LCD’s controller, which controls the instructions. Logic High (1) – Activates Data register. Logic Low (0) – Activates  Instruction register. RW selects either read or write mode. In this this pin is connected to ground. Logic High (1) – Activates Read mode. Logic Low (0) – Activates Write mode. Enable: E enables the LCD module. LCD can be used either in 4-bit mode or 8-bit mode. In 4-bit mode it requires 7 IO pins of the Arduino. In 8 bit mode 11 IO pins required from arduino. In order to understand the interfacing let us see examples. Project Example:

Components:

16X2 LCD Arduino Connecting wires.

Circuit Diagram:

Circuit Connections

The four data Pins D4 to D7 are connected to the four  pins (0 to 3) of the arduino. Rs (register select) and E (Enable) pins are connected to the pin4 and pin5 of the arduino. VSS pin of the LCD is connected to the ground while VDD is connected to the power supply. V EE of  LCD is connected to the potentiometer in order to vary the  brightness of the LCD. RW pin is connected to ground.

Code (Sketch)

The above program shows the  LCD displaying  Electronicshub and  16X2 LCD  strings. Arduino provides an in built  library for LCD. Header file is Liquid Crystal.h is declared in order to fetch all the functions from the library. This can support 8-bit mode or 4-bit mode of operation. Next line “ Liquid Crystal lcd(RS,E,D4,D5,D6,D7) “defines the pins of arduino that are interfaced to LCD. For example in our circuit RS pin of  LCD is connected to pin5 of  the  arduino. 5 is written in place of RS. In setup ( ) function LCD initialization is done.AS the initialization of LCD is done only once it is declared in Setup( ) function. Void indicates no return values. Next line of code is “lcd.begin(16×2)”.16 x 2 indicates the number of rows and columns of  the LCD. Void loop( ) indicates the continuous execution of the statement. The instruction in this loop are repeated until the controller resets. Lcd.setCursor (columns, rows) sets the cursor point. Remember that there are only 2 rows and 16 columns in the LCD. Lcd.print(“ ”) prints the string written to it. Thus the above sketch simply displays the String on the LCD.In order to scroll the display, below code can be used. void loop() { for( int i=0; i<2; i++) { lcd.scrollDisplayLeft();    //scrolls display left by two positions } delay(500);              //sets the speed at which display moves } For this print the string in  Void setup ( ) function. just a note for us newbies!!! Comment * Name * Email * Website

Δ

Interfacing LCD with Arduino - 59Interfacing LCD with Arduino - 39Interfacing LCD with Arduino - 96Interfacing LCD with Arduino - 73Interfacing LCD with Arduino - 19Interfacing LCD with Arduino - 99Interfacing LCD with Arduino - 87Interfacing LCD with Arduino - 94