16×2 LCD Display with Text Output Using Arduino Uno – Complete Beginner Guide

16×2 LCD Display with Text Output using Arduino Uno | MakeMindz
Lesson 16 · Display Modules

16×2 LCD Display with
Text Output using Arduino Uno

Learn to wire, code, and display real-time text on an LCD — a must-have skill for every Arduino project.

🟢 Beginner ⚡ Arduino Uno 📺 16×2 LCD 🔧 4-bit Mode ⏱ 30 min
Run Free Simulation on Wokwi

📺 What is a 16×2 LCD Display?

💡

LCD stands for Liquid Crystal Display. The "16×2" means 16 characters per row across 2 rows — giving you 32 characters total on screen at once.

Key Facts

16 cols × 2 rows

Displays up to 32 characters simultaneously

HD44780 controller

Industry-standard LCD driver IC used in most Arduino LCD modules

4-bit / 8-bit mode

4-bit mode saves Arduino pins — we use 4 data wires instead of 8

🛒 Components Required

🟦
Arduino Uno
× 1
📺
16×2 LCD
× 1
🔘
10kΩ Pot
× 1
🟫
220Ω Resistor
× 1
🔌
Jumper Wires
× 12+
🟧
Breadboard
× 1

🌐

No physical parts? No problem! Use the free Wokwi simulation — all components are virtual and ready to go.

🔧 Step-by-Step Wiring Guide

STEP 01
Power the LCD

Connect LCD VSS → Arduino GND (black wire) and VDD → Arduino 5V (red wire).

STEP 02
Set Up Contrast Control

Connect the 10kΩ potentiometer: outer pins to 5V and GND, middle wiper pin to LCD V0. Twist the pot to adjust contrast until characters appear clearly.

STEP 03
Control Pins (RS, RW, E)

Wire RS → Pin 12 (blue), RW → GND (write-only mode), and E → Pin 11 (yellow).

STEP 04
Data Pins — 4-bit Mode

Connect only D4–D7 (skip D0–D3): D4 → Pin 5, D5 → Pin 4, D6 → Pin 3, D7 → Pin 2.

STEP 05
Backlight LED

Wire A (LED+) → 5V via 220Ω resistor (red) and K (LED−) → GND (black). The 220Ω resistor limits current to protect the backlight.

📌 Pin Connection Table

LCD PinArduino / ConnectionWire Color
VSSGNDBlack
VDD5VRed
V0Potentiometer wiper (contrast)Black
RSPin 12Blue
RWGND (write-only)Black
EPin 11Yellow
D4Pin 5Orange
D5Pin 4Purple
D6Pin 3Gray
D7Pin 2White
A (LED+)5V via 220Ω resistorRed
K (LED−)GNDBlack

{ } Wokwi diagram.json

Paste this into the diagram.json tab in Wokwi. It auto-places the Arduino Uno and 16×2 LCD, and wires all 12 connections for you — including power, contrast (V0 → GND for fixed maximum contrast in simulation), control pins, data pins, and backlight.

How to use this in Wokwi
1. Open wokwi.com → New Project → Arduino Uno
2. Click the diagram.json tab
3. Select all existing text and replace with the JSON below
4. The LCD will appear pre-wired and ready to run!
diagram.json — Wokwi
{
  "version": 1,
  "author": "Wokwi LCD Demo",
  "editor": "wokwi",
  "parts": [
    {
      "type": "wokwi-arduino-uno",
      "id":   "uno",
      "top":  183,
      "left": -192.6,
      "attrs": {}
    },
    {
      "type": "wokwi-lcd1602",
      "id":   "lcd1",
      "top":  -150.17,
      "left": -118.4,
      "attrs": {}
    }
  ],
  "connections": [
    // Power
    [ "lcd1:VSS", "uno:GND.1", "black",  [ "v0" ] ],
    [ "lcd1:VDD", "uno:5V",    "red",    [ "v0" ] ],

    // Contrast (V0 to GND = max contrast for simulation)
    [ "lcd1:V0",  "uno:GND.1", "black",  [ "v0" ] ],

    // Control pins
    [ "lcd1:RS",  "uno:12",    "blue",   [ "v0" ] ],
    [ "lcd1:RW",  "uno:GND.1", "black",  [ "v0" ] ],
    [ "lcd1:E",   "uno:11",    "yellow", [ "v0" ] ],

    // Data pins (4-bit mode — D4 to D7 only)
    [ "lcd1:D4",  "uno:5",     "orange", [ "v0" ] ],
    [ "lcd1:D5",  "uno:4",     "purple", [ "v0" ] ],
    [ "lcd1:D6",  "uno:3",     "gray",   [ "v0" ] ],
    [ "lcd1:D7",  "uno:2",     "white",  [ "v0" ] ],

    // Backlight LED
    [ "lcd1:A",   "uno:5V",    "red",    [ "v0" ] ],
    [ "lcd1:K",   "uno:GND.2", "black",  [ "v0" ] ]
  ],
  "dependencies": {}
}

📋 What Each Connection Does

ConnectionPurpose
lcd1:VSS → GNDLCD ground — every IC needs a ground reference
lcd1:VDD → 5VPowers the LCD's logic circuits
lcd1:V0 → GNDContrast control — GND gives max contrast in Wokwi (use a pot on real hardware)
lcd1:RS → Pin 12Register Select — tells LCD if data is a command or character
lcd1:RW → GNDRead/Write — tied LOW = write-only mode (saves a pin)
lcd1:E → Pin 11Enable — Arduino pulses this to latch each byte of data
lcd1:D4–D7 → Pins 5–24-bit data bus — sends display characters and commands in two nibbles
lcd1:A → 5VBacklight LED anode — lights up the display
lcd1:K → GNDBacklight LED cathode

💻 Arduino Code

Copy the code below and paste it into your Arduino IDE or Wokwi's sketch.ino tab. The LiquidCrystal library is built-in — no installation needed.

ARDUINO · C++ · sketch.ino
/*
 * 16x2 LCD Display - Text Output
 * MakeMindz Summer Class | makemindz.com
 * Simulation: https://wokwi.com/projects/459549577107604481
 */

#include <LiquidCrystal.h>

// Initialize LCD: LiquidCrystal(rs, en, d4, d5, d6, d7)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // Set LCD dimensions: 16 columns, 2 rows
  lcd.begin(16, 2);

  // Print on Row 1 (top row, starts at column 0)
  lcd.print("Hello, World!");

  // Move cursor to Row 2, Column 0
  lcd.setCursor(0, 1);
  lcd.print("Arduino LCD");
}

void loop() {
  // Update timer on Row 2 every second
  lcd.setCursor(0, 1);
  lcd.print("Time: ");
  lcd.print(millis() / 1000);
  lcd.print("s   ");   // Extra spaces clear leftover digits

  delay(1000);
}

🔍 How the Code Works

LiquidCrystal lcd(12,11,5,4,3,2)

Creates the LCD object mapping Arduino pins to RS, E, D4, D5, D6, D7. Must match your wiring exactly.

lcd.begin(16, 2)

Tells the library the LCD is 16 columns wide and 2 rows tall. Always call this first in setup().

lcd.setCursor(col, row)

Positions where the next character appears. Column 0, row 0 is the top-left corner. Row 1 is the second line.

lcd.print("text")

Writes text, numbers, or variables to the LCD from the current cursor position.

millis() / 1000

Returns elapsed milliseconds ÷ 1000 = seconds. Creates a live-updating seconds counter without blocking the loop.

Expected Output

After uploading the code, your LCD should show:

LCD Preview — updates live below
Hello, World!   
Time: 0s        

The timer on row 2 counts up every second — just like your real Arduino will!

🧪 Try It in Your Browser — Free!

No Arduino or components needed. Run the full simulation instantly on Wokwi and watch the LCD display text in real time.

Open Wokwi Simulation

🚀 Real-World Applications

🌡️
Temperature Monitor
📏
Distance Display
🏠
Smart Home UI
🤖
Robot Status
🔢
Digital Counter
📡
IoT Data Output

Frequently Asked Questions

The potentiometer adjusts the voltage on the V0 pin, which controls how dark the LCD pixels appear. Without it characters may be invisible or too dark. In the Wokwi simulation, V0 is tied to GND for maximum contrast automatically — on real hardware you need a physical pot.
Yes! Read a sensor value into a variable — for example int temp = readTemperature(); — then display it with lcd.print(temp);. Numbers, floats, and strings all work with lcd.print().
1. Adjust the potentiometer first — this is the most common cause. 2. Double-check each wire against the pin table. 3. Confirm the pin numbers inside LiquidCrystal lcd(12, 11, 5, 4, 3, 2) match your physical wiring.
Yes! An I2C LCD uses only 2 wires (SDA → A4, SCL → A5) instead of 7. You'd use the LiquidCrystal_I2C library. Check the MakeMindz I2C LCD tutorial as the next step after this lesson!
The diagram.json file describes all components and their wiring connections in Wokwi's simulator. Pasting it auto-places the Arduino Uno and LCD on the canvas and draws all wires between them — so you can skip manual wiring and go straight to running the code.
Absolutely — this is one of the most recommended first projects after LED blink. The LiquidCrystal library handles all the complex HD44780 timing internally. You just call simple functions like lcd.print() to display anything you want.

🎉 Conclusion

You've learned how to interface a 16×2 LCD with Arduino Uno in 4-bit mode, apply the diagram.json for instant Wokwi wiring, write text to both rows, position the cursor, and display a live seconds counter using millis().

This foundational skill powers hundreds of real projects — from temperature displays to robot status screens. Paste the diagram.json, run the simulation, then build it on your breadboard!

Comments

try for free