Hello, welcome craze technologist to a new initial level tutorial. In this tutorial “How to connect LCD with Arduino”, I shall teach you how to integrate a 16×2 LCD (Liquid Crystal Display) with an Arduino and displaying messages on it. On the next upcoming blog, I shall teach you how to display sensor data on this LCD. Later on, we will integrate this LCD with Raspberry Pi and ESP8266 for our IoT projects. If you are interested to know about the difference between the hardware structure of Raspberry Pi and Arduino, click here. This LCD 16X2 is a common type of LCD readily available in the market and extremely easy to integrate with any microcontroller. Its cost is also extremely low so it can be the best choice for beginners. Moreover, its library is available in Arduino so you even don’t need to program its parts like pins, etc. I shall go step by step with an explanation of each step.
Let, begun
Components Required
- Arduino ( Any Arduino Model can work but I am using Arduino UNO as it is most commonly available)
- LCD 16X2
- Bread Board
- 10K Ohm Resistor (Potentiometer) to control the contrast
- Connecting leads
- Laptop or PC for writing code
Wiring Diagram
A complete wiring diagram is shown below.

The above diagram shows how to connections are made between LCD, Arduino UNO, and Bread Board.
Wiring Steps
Wiring steps are given below in detail.
- Connect 5V Pin of Arduino to +ve rail of Bread Board. Now this line will serve as the positive line in our project
- Connect GND pin of Arduino to –ve rail of Bread Board. Now this line will serve as –ve or ground line in this project.
5V Supply from Arduino to Bread Board - Connect Pin 1 of LCD to a Ground rail of Bread Board.
- Connect Pin 2 of LCD to Positive rail of Bread Board.
- Connect Pin 3 with the variable terminal of Potentiometer (Usually central terminal is a variable terminal). Out of the remaining two terminals, connect one terminal of Potentiometer with +ve rail of Bread Board and another terminal of Potentiometer with –ve rail of Bread Board. Use knob to adjust contrast during the working of LCD.
- Connect Pin 4 of LCD with Pin 1 of Arduino Board.
- Connect Pin 5 to –ve rail of Bread Board.
Next are 8 data pins labeled as D0, D1, D2,D3,D4,D5,D6,D7. I shall use only 4 data pins in this simple project labeled as D4, D5, D6, D7.
- Connect Data Pin 4 of LCD with Pin 4 of Arduino.
- Connect Data Pin 5 of LCD with Pin 5 of Arduino.
- Connect Data Pin 6 of LCD with Pin 6 of Arduino.
- Connect Data Pin 7 of LCD with Pin 7 of Arduino.
Data pins integration with Arduino
8. Connect Pin 15 to +5V rail of Bread Board. It is the anode of the built-in LED of LCD.
9. Connect Pin 16 to –ve rail of Bread Board. It is the cathode of the Built-in LED of LCD.

Explanation of LCD Pins
Pin Configuration of LCD is shown below with further explanation.

Pin 1 (VSS): This is Ground Pin.
Pin 2 (VDD): This is 5V Pin.
Pin 3 (V0): This is a contrast control pin. It is used to control the contrast of LCD. The contrast will be controlled using a 10K Ohm potentiometer. Connect other
Pin 4(RS): This Register Select pin. It is used to select whether we want to send data or command to LCD. If we connect this pin with the Ground pin or 0V then we are sending commands to LCD (Moving cursor). If we connect this RS pin with High or 5V then we are sending data to LCD.
Pin 5(RW): This is the Read/Write pin of LCD. This pin is used to select either the read or write mode of LCD.
In this tutorial, we shall use only the write mode.
Pin 6(E): This is Enable pin. It enables us to write to register or next 8 data pins.
Pin (D0-D7): These eight are data pins.
Pin 15(A): This is an Anode pin of internal Led. It will be connected to 5V.
Pin 16(K): This is the Cathode pin of internal Led. It will be connected to the Ground.
Code for How to connect LCD with Arduino
Now, power up the Arduino and check the Light of the LCD. Open the new empty program and select your Arduino Board (In my case, it is Arduino UNO) and the port to which Arduino is connected. Write below code in it.
There are 8 data pins available for use but as it is a beginners level tutorial, we shall use only 4 bits. These four bits are enough for our program.
//https://automationcraze.com
#include <LiquidCrystal.h> // Adding LCD Library.
LiquidCrystal mylcd(1,2,4,5,6,7); // Creating object named mylcd and assign Arduino pin with it.
void setup() {
mylcd.begin(16,2); // Initialization of LCD Size. 16 Columns and 2 Rows.
}
void loop() {
mylcd.setCursor(0,0); // Setting cursor. At 0 Row (First Row) 0 Column (First Column).
mylcd.print(“automationcraze”); // This is print command and message will print.
mylcd.setCursor(0,1); //It will set new cursor position. First Row & Second Column.
mylcd.print(“Welcome You”); // Printing message
}
This is the simplest program to display on 16X2 LCD.
Complete working circuit with output
Complete working circuit with output is shown below

Few Important Built-in function of LCD Library
- LiquidCrystal()
- clear (): It will clear the LCD screen. Whatever we displayed before this command will be clear.
- begin: It will initialize the Liquid Crystal Display board.
- home(): It is returning home command.
- print(): It will print the message on LCD Screen.
- cursor(): It will move the cursor to the home position.
- setCursor(): It will move the cursor to the desired location as per provided parameters.
- cursor(): It will remove the cursor from the display
You can practice these functions to improve your skills.
Conclusion
That’s all, here I am closing my topic. In this blog, I teach you “ How to connect LCD with Arduino” in a very simple yet professional way. All images are real and performed by myself, so there should be no ambiguity. In case of any issue, you can comment or email at contactus@automationcraze.com.
Your positive feedback will be highly appreciated.
Judith
I know this if off topic but I’m looking into starting my own blog and was curious what all
is required to get setup? I’m assuming having a blog like yours would cost a pretty penny?
I’m not very internet savvy so I’m not 100% sure. Any tips or advice would be greatly appreciated.
Many thanks
admin
Thanks for commenting and sorry for late reply.
I shall really glade to help you out.
email me in detail at
admin@automationcarze.com