Introduction: How to Connect Liquid Crystal Display(LCD) to Arduino

Picture of How to Connect Liquid Crystal Display(LCD) to Arduino

Overview

In this tutorial you are going learn how to connect a Liquid Crystal Display (LCD) to an Arduino Uno and make it display stuff. LCDs come in handy if you need to display info on a screen. They are cheap and common. Connecting an LCD to an Arduino is pretty straightforward and there is example code which comes with the Arduino IDE which we are going to modify and use.

Step 1: How to Connect Liquid Crystal Display(LCD) to Arduino

Picture of How to Connect Liquid Crystal Display(LCD) to Arduino

Details

There are different kinds of LCDs but for this tutorial we are going to use 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. We are going to be using the Liquid Crystal Library for Arduino. Here are the parts we are going to be using.

  • Hitachi HD44780 driver compatible LCD
  • Arduino Uno
  • 10kOhm Potentiometer
  • Some jumper wires
  • A breadboard

If you live in Ghana, you can get the components to buy at Invent Electronics website.

Step 2: LCD Pinouts

Picture of LCD Pinouts

The LCD has 16 terminals or pins which are labelled as you can see in the picture.

One of the images above shows the pinouts of the LCD and its functions

The states of the data bus lines (D0 to D7) which can either be 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 LCD can be used in either 4 bit or 8 bit mode. The 4 bit mode usage is more common with Arduino since it is enough to do almost everything you want, hence usually, data pins D0 to D3 are not usually used when working with Arduino.

I am assuming that you already have header pins soldered to your LCD.

Step 3: Schematic and Arduino Code

Picture of Schematic and Arduino Code

Above is a Fritzing image of how to connect the LCD to an Arduino.

Here is the Arduino code below. Click here to get a nicely formatted version of the code.

// include the library code:
#include

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2);

}

void loop() {

// set the cursor to column 0, line 1

// (note: line 1 is the second row, since counting begins with 0):

lcd.setCursor(0, 0); // Print a message to the LCD.

lcd.print("Welcome To");

lcd.setCursor(0, 1); // Print a message to the LCD.

lcd.print("CurrentCity.cc");

}

Step 4: Final Assembly and Resources

Picture of Final Assembly and Resources

Here is how it finally looks.

Download the LCD datasheet here and learn more about it.

And that's it!

For More projects tutorials, please check out our site at http://www.currentcity.cc

Also check out our Obstacle Avoider Using HC-SR04 ultrasonic sensor instructable

Comments

indavidjool made it! (author)2017-07-05

Worked well on my Arduino Mega.

matt1609 (author)2016-04-10

hi will the lcd light up when the connections are all done even before the code is uploaded

currentcitycc (author)matt16092016-10-13

yes. the backlight should come on if you have connected the appropriate terminals to your power supply

NahidS1 (author)2016-05-19

nice

matt1609 (author)2016-04-10

mine doesnt light up after all connections are right whats wrong??

currentcitycc (author)matt16092016-04-12

can you send a picture of your circuit ?

About This Instructable

2,754views

15favorites

License:

Bio: Current City is the place where you learn and have fun with electronics and Arduino. Get free tutorials and projects in Arduino and electronics complete ... More »
More by currentcitycc:How to simulate GPS Module In ProteusHow to Connect Liquid Crystal Display(LCD) to ArduinoObstacle Avoider Using HC-SR04 Ultrasonic Sensor
Add instructable to: