LCD Display using Arduino

So, Are you done with the Basic Arduino Programs like “Blinking of LED“?

Did you like it ? Do you want to explore more on Arduino Board?

If your answer is yes, then go on further and enjoy this tutorial.

In this tutorial , I will explain how to connect an LCD with an Arduino Board and display the things on LCD, Scroll different characters on LCD or different sentences on LCD.

Before going further, make sure you have an Arduino Board, LCD display (2 x 16), 10 KΩ Potentiometer,  few jumper wires, breadbaord (If this is not available, then also it is fine :)) with you.

Before starting How to connection LCD with Arduino Board or How to Code on Arduino Software, Let us understand few things about LCD  2 x 16 Display.

Understanding LCD Display

LCD 2 x 16 Display is having total of 16 Pins. which are defined as follows.

lcd

A register select (RS) pin that controls where in the LCD’s memory you’re writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD’s controller looks for instructions on what to do next.

A Read/Write (RW) pin that selects reading mode or writing mode

An Enable pin(E) that enables writing to the registers

8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you’re writing to a register when you write, or the values you’re reading when you read.

The display contrast pin (V0), power supply pins (+5v and GND) and LED Backlight (A and K) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.

The process of controlling the display involves putting the data that form the image of what you want to display into the data registers, then putting instructions in the instruction register. But You do not have to worry at all about all these low level instructions at all. There is a LiquidCrystal Library which does this all for you.

Making Connection of LCD  with Arduino Board

Let us make Connection between LCD and Arduino Board.

LCD RS Pin (Pin 4) with Pin 7 of Arduino Board

LCD Enable Pin (Pin 6) with Pin 8 of Arduino Board

LCD D4 Pin (Pin 11) with Pin  9 of Arduino Board

LCD D5 Pin (Pin 12) with Pin  10 of Arduino Board

LCD D6 Pin (Pin 13) with Pin  11 of Arduino Board

LCD D7 Pin (Pin 14) with Pin  12 of Arduino Board

Add a 10 KΩ Pot to +5v (Pot Pin 1) and GND (Pot Pin 3), Connect Middle Pin of Pot (Pot Pin 2) to the LCD V0 Pin (Pin 3).

LCD VDD Pin (Pin 2) and LCD A Pin (Pin 15) with +5v on Arduino Board.

LCD VSS Pin (Pin 1) and LCD K Pin (Pin 16) with GND on Arduino Board.

Once you are ready with above connection. Open a new sketch on your Arduino and just start coding.

Program on Arduino Software

This is a very basic program on LCD display which will just print a statement on the LCD.

You can copy and paste whole program from here.

Compile it and Upload it on Arduino Board and observe the output on LCD.

// Program Starts here

#include

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(“Hello Puru:”);
}

void loop() {
// put your main code here, to run repeatedly:

}

// Program ends here

Explanation of Program

LiquidCrystal Library takes care of these functions.

First we define an LCD connection using LiquidCrsyatl lcd(RS, E, D4, D5, D6, D7).

In setup() function,

lcd.begins(16,2) defines that LCD is a 2 x 16 LCD Display.

lcd.clear() functions clears everything on the LCD if any thing is already existing on the LCD.

lcd.setCursor(0,1) puts the cursor on next line from where the print should happen.

lcd.print (“Hello Puru:”) just puts all these characters on second line.

Demo of Program

Here is how the final output looks.

img_20161214_193632

P.S. So, You have done all the stuffs, program was compiled and uploaded successfully. Still, No Output on LCD. Here comes the work of potentiometer (the Blue thing in above picture). There will be screw in the pot, just rotate that screw and try to change the resistor divider ratio settings to see the Output on LCD.

Did it work now ? Can you see the Output? Great …. Enjoy ….

-Signing Off, Arduino Novice

Please do follow my Blog and subscribe to my Youtube Channel for more demos and videos related to Arduino.

Advertisements

2 thoughts on “LCD Display using Arduino

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s