Interfacing LCD Display with Arduino in detail

Interfacing LCD Display with Arduino in detail Interfacing LCD Display with Arduino in detail

Are you still checking the output from the Arduino on the serial monitor? and what if you want to run your project with out a computer or laptop where Arduino IDE is installed. So how will you get the output? So, the solution is by adding a display module to your Arduino board.  Connecting a LCD display module to Arduino can be achieved in two ways. stated below

  1. Directly with parallel connection
  2. Using I2C adapter

Before getting started lets know what are the components required to interface.

Requirements:

  • 16X2 LCD Display module – JHD 162A
  • 10k Potentiometer to adjust contrast
  • Connecting wires

Note:Any LCD display module compatible with Hitachi HD44780 interface will work for Arduino interfacing. Here we are using JHD 162A which uses the ST7066U controller which is compatible with Hitachi HD44780 instruction set.

16X2 LCD display module JHD 162A

lcd display module JHD162a image

The JHD162A LCD display module is a monochrome LCD module which which is the best and cheap module for starter projects and experiments. As it is a 16X2 display it has 32 blocks, each block has a dot matrix of 5X8 to display characters. It has 16 pins. Look at the following images for its pin out diagram.

lcd display module pinout

Method 1: Directly with parallel connections

In this method we are interfacing the LCD module with Arduino along with 10k ohm potentiometer which helps us to adjust the contrast of the Display to show the characters. Look at the below circuit diagram and connect the components.

Interfacing LCD display module to arduino circuit diagramIf you look at the above schematic diagram it looks very complex but when you try to connect its not that hard.

  • VSS     GND
  • VCC     5V
  • VEE     POTENTIOMETER OUT
  • RS         12
  • RW       11
  • E           11
  • D4         5
  • D5         4
  • D6         3
  • D7         2
  • LED+    5v
  • LED-  GND

Sample code to print text on display

Before uploading the code download the required library from the git link here.

// include the library code:
#include <LiquidCrystal.h>

// 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);
  // Print a message to the LCD.
  lcd.print("circuitschools.");
}

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, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
}

After uploading the code your LCD displays the text as below image

Interfacing LCD Display with Arduino output

Method 2: Using I2C adapter

In this method we used I2C adapter which acts has output of only 2 wires of data instead of 12-16 wires from the previous model.

Connect LCD display to Arduino with only two pins I2C adapter

As we already explained this method in the previous article please refer the below link.

Connect LCD display to Arduino with only two pins I2C adapter.

The above refereed link has multiple example codes where you can perform scrolling of text and adding special characters to the display.

Both this methods perform the same work of displaying the characters sent by arduino, you can use according to the preference. If you have any doubts or issues please comment below. If you found this tutorial helpful please support us by following our Facebook page.