Translate

Displaying Text on 16×2 LCD using Arduino

 Introduction

In this project, we will learn how to interface a 16×2 LCD display with Arduino and display a simple text message:

Nice to meet you

LCD displays are widely used in electronics projects because they can show text clearly and consume very little power.
This project is suitable for beginners to understand:

  • LCD interfacing

  • Arduino digital pin usage

  • Using the LiquidCrystal library

  • Displaying text messages


Components Required

  • Arduino UNO

  • 16×2 LCD display (HD44780 type)

  • 10k potentiometer (for contrast adjustment)

  • Breadboard

  • Jumper wires

  • USB cable


Circuit & Connections



LCD to Arduino Pin Mapping

LCD PinFunctionArduino Pin
1 (VSS)GroundGND
2 (VDD)Power5V
3 (V0)ContrastMiddle pin of 10k pot
4 (RS)Register Select12
5 (RW)Read/WriteGND
6 (EN)Enable11
11 (D4)Data 45
12 (D5)Data 54
13 (D6)Data 63
14 (D7)Data 72
15 (A)Backlight +5V (via 220Ω resistor)
16 (K)Backlight −GND

Circuit Explanation

  • The LCD is operated in 4-bit mode using pins D4 to D7.

  • The RS pin selects whether data or command is sent to LCD.

  • The EN pin enables the LCD to accept data.

  • The RW pin is connected to GND because we only write data to LCD.

  • A 10k potentiometer is used to adjust the contrast of the LCD.

  • The backlight pins (A and K) are connected to 5V and GND for illumination.

This wiring allows Arduino to control the LCD using only 6 digital pins.


Working Principle

  1. When the Arduino is powered ON, it initializes the LCD as a 16×2 display.

  2. The cursor is positioned at the first column of the first row.

  3. The text “Nice to meet you” is sent to the LCD.

  4. Since the text contains 15 characters, it fits completely in one line of the 16×2 LCD.

  5. The message remains displayed continuously.


Arduino Program Code

#include <LiquidCrystal.h> // Define LCD pin connections const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; // Create LCD object LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { lcd.begin(16, 2); // Initialize 16x2 LCD lcd.print("Nice to meet you"); // Display message } void loop() { // No repeated action needed }

Program Explanation

Including Library

#include <LiquidCrystal.h>

This line includes the LiquidCrystal library, which provides built-in functions to control the LCD.


Pin Definitions

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

These lines define which Arduino pins are connected to the LCD and create an LCD object for communication.


setup() Function

lcd.begin(16, 2); lcd.print("Nice to meet you");
  • lcd.begin(16, 2) initializes the LCD with 16 columns and 2 rows.

  • lcd.print() sends the text to the LCD starting from column 0, row 0.


loop() Function

void loop() { }

No code is required in the loop because the message does not need to change continuously.


Sample Output

Since “Nice to meet you” has 15 characters, it fits in one line of the LCD.

LCD Display:

Nice to meet you

The first line shows the message, and the second line remains blank.


Advantages

  • Very simple and beginner-friendly

  • Uses minimum components

  • Clear visual output

  • Low power consumption

  • Easy to modify for other messages


Applications

  • Welcome message display

  • Digital notice boards

  • Name display systems

  • Digital clocks

  • Sensor value display


Conclusion

This project demonstrates how to interface a 16×2 LCD display with Arduino and display a simple message: “Nice to meet you”.
It helps beginners understand LCD wiring, Arduino pin configuration, and basic programming using the Liquid Crystal library.
This project can be extended further to display time, temperature, or scrolling text.

To display text on the second line of a 16×2 LCD, you must move the cursor manually using
lcd.setCursor(column, row);

Try with This also 

👉 Row numbering starts from 0

  • First line → row 0

  • Second line → row 1

Tips for Using 16×2 LCD with Arduino

🔹 1. Use 4-bit Mode to Save Pins
Always use 4-bit mode (D4–D7) instead of 8-bit mode.
It reduces wiring and saves Arduino digital pins.

🔹 2. Connect RW Pin to GND
RW should be connected to GND because we only write data to LCD.
If left floating, the LCD may not work properly.

🔹 3. Adjust Contrast Properly
Use a 10k potentiometer on pin 3 (V0/VEE).
If contrast is too high or low, text will not be visible.

🔹 4. Use a Resistor for Backlight
Connect a 220Ω resistor in series with pin 15 (Backlight +).
This prevents damage to the LCD backlight LED.

🔹 5. Do Not Exceed 16 Characters Per Line
A 16×2 LCD can display only 16 characters per line.
Long text will be cut off unless you move the cursor manually.

🔹 6. Cursor Does Not Auto Move to Next Line
lcd.print() does NOT automatically go to the second line.
You must use:

lcd.setCursor(0,1);

🔹 7. Initialize LCD Before Printing
Always call:

lcd.begin(16, 2);

inside setup() before using lcd.print().

🔹 8. Use Delays for Clear Viewing
When changing messages, use small delays so text can be read easily.

🔹 9. Check Wiring if Nothing Appears
If LCD is blank:
✔ Check contrast
✔ Check RS, EN, D4–D7 connections
✔ Check power (5V & GND)

🔹 10. Clear Screen When Updating Data
Use:

lcd.clear();

before printing new content to avoid old characters remaining.

തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.