Complete Arduino LCD 16x2 Tutorial Wiring Code Examples

Logan Jul 13, 2026

Excited to dive into electronics and programming? You're in the right place! Today, we're going to embark on a journey to understand and control an LCD display using an Arduino board. By the end of this tutorial, you'll have a practical understanding of how to interface an LCD 16x2 with Arduino, making your next project even more engaging. Let's get started!

Arduino 16x2 LCD Tutorial - Everything You Need to Know
Arduino 16x2 LCD Tutorial - Everything You Need to Know

Before we dive in, make sure you have the following: an Arduino board (like the Arduino Uno), an LCD 16x2 display, and the necessary jumper wires. Also, install the LiquidCrystal library in the Arduino IDE, as it simplifies LCD communication. Ready? Let's set up.

Arduino LCD Set Up and Programming Guide
Arduino LCD Set Up and Programming Guide

Setting Up the Hardware

First, let's connect our LCD 16x2 to the Arduino. Grab yourbreadboard and jumper wires, and connect as follows:

Interfacing 16x2 LCD with Arduino
Interfacing 16x2 LCD with Arduino
  • LCD VSS (Pin 1) to GND (Ground)
  • LCD VDD (Pin 2) to 5V
  • LCD V0 (Pin 3) to a potentiometer connected to 5V and GND for contrast adjustment
  • LCD RS (Pin 4) to Arduino pin 12
  • LCD R/W (Pin 5) to GND
  • LCD EN (Pin 6) to Arduino pin 11
  • LCD D4 (Pin 11) to Arduino pin 5
  • LCD D5 (Pin 12) to Arduino pin 4
  • LCD D6 (Pin 13) to Arduino pin 3
  • LCD D7 (Pin 14) to Arduino pin 2

Initializing the LCD

How to Interface 16×2 LCD With Arduino Uno
How to Interface 16×2 LCD With Arduino Uno

Now that we've connected the hardware, let's initialize the LCD in our Arduino code. Include the LiquidCrystal library and set up the pins as follows:

```cpp #include const int RS = 12, EN = 11, D4 = 5, D5 = 4, D6 = 3, D7 = 2; LiquidCrystal lcd(RS, EN, D4, D5, D6, D7); ```

Next, we'll initialize the LCD with the number of columns and rows (16x2):

```cpp void setup() { lcd.begin(16, 2); } ```

Displaying Text on the LCD

Tutorial Arduino: Pantalla Serial LCD 128x64 | BricoGeek.com
Tutorial Arduino: Pantalla Serial LCD 128x64 | BricoGeek.com

Now let's make the display show some text. Add the following code in the `loop()` function:

```cpp void loop() { lcd.setCursor(0, 0); // Set cursor at the beginning of the first row lcd.print("Hello, LCD!"); } ```

The LCD should now display "Hello, LCD!" on the first line. Let's make it more interactive by displaying the current date and time. First, include the DS3231 RTC library to use a real-time clock:

Displaying Date and Time

an electronic device with the components attached to it, and wires connected to each other
an electronic device with the components attached to it, and wires connected to each other

After installing the DS3231 RTC library, initialize it in the setup function:

Here's the complete code to display the date and time on your LCD 16x2:

Arduino LCD 16x2. Turn Single Screen Into Multiple Screens.
Arduino LCD 16x2. Turn Single Screen Into Multiple Screens.
How to Use an LCD Display - Arduino Tutorial
How to Use an LCD Display - Arduino Tutorial
Arduino LCD using Sensor Shield v5 - Learn Robotics
Arduino LCD using Sensor Shield v5 - Learn Robotics
128×64 Graphical LCD Display with u8glib library & Arduino
128×64 Graphical LCD Display with u8glib library & Arduino
Tutorial LCD 16 x 2 - Arduino - Generación de Caracteres personalizados - Parte2
Tutorial LCD 16 x 2 - Arduino - Generación de Caracteres personalizados - Parte2
How to Connect I2C Lcd Display to Arduino Uno
How to Connect I2C Lcd Display to Arduino Uno
a magnifying glass looking at an electronic board with the words hello world written on it
a magnifying glass looking at an electronic board with the words hello world written on it
A Tutorial on Interfacing 128x64 Graphical LCD with Arduino
A Tutorial on Interfacing 128x64 Graphical LCD with Arduino
How to use a 16x2 character LCD with Arduino
How to use a 16x2 character LCD with Arduino
Raspberry Pi LCD Tutorial
Raspberry Pi LCD Tutorial
Arduino Uno LCD display 16x2 tutorial | Step by step instructions [Code & circuit diagram]
Arduino Uno LCD display 16x2 tutorial | Step by step instructions [Code & circuit diagram]
How to use 16x2 LCD with Arduino || Arduino tutorial
How to use 16x2 LCD with Arduino || Arduino tutorial
LCD interfacing with Arduino - In depth guide with Example Codes
LCD interfacing with Arduino - In depth guide with Example Codes
Display LCD 16x2 alfanumérico (azul | verde) - Geek Factory
Display LCD 16x2 alfanumérico (azul | verde) - Geek Factory
Top 20 Arduino LCD Animation Projects || animation lcd 16x2 || LCD Custom Animation Project
Top 20 Arduino LCD Animation Projects || animation lcd 16x2 || LCD Custom Animation Project
Arduino Tutorial 10: LCD
Arduino Tutorial 10: LCD
How to Use 16X2 LCD Display with Arduino. - MYTECTUTOR
How to Use 16X2 LCD Display with Arduino. - MYTECTUTOR
How to control a character I2C LCD with Arduino
How to control a character I2C LCD with Arduino
Tutorial: Pantalla LCD con texto deslizante mediante pulsadores - El Cajon de Ardu
Tutorial: Pantalla LCD con texto deslizante mediante pulsadores - El Cajon de Ardu
Arduino to LCD projects - Using 3 Different Types of LCDs - Tutorial45
Arduino to LCD projects - Using 3 Different Types of LCDs - Tutorial45

```cpp #include #include DS3231 clock; const int RS = 12, EN = 11, D4 = 5, D5 = 4, D6 = 3, D7 = 2; LiquidCrystal lcd(RS, EN, D4, D5, D6, D7); void setup() { lcd.begin(16, 2); clock.begin(); clock.setTime(20, 0, 0); // Set initial time if RTC not connected } void loop() { DateTime now = clock.now(); lcd.setCursor(0, 0); lcd.print("Time: "); lcd.print(now.hour()); lcd.print(':'); lcd.print(now.minute()); lcd.setCursor(0, 1); lcd.print("Date: "); lcd.print(now.day()); lcd.print('/'); lcd.print(now.month()); lcd.print('/'); lcd.print(now.year()); } ```

Your LCD 16x2 should now display the current date and time! With this new skill, you're ready to add an LCD to your next project. Happy making!