16×2 Character LCD
I2C Setup Guide
Display two lines of text on a classic 16-column character LCD — using just 4 wires thanks to the integrated I2C backpack. No 16-pin wiring, no contrast potentiometer, just 4 wires and one library.
Video walkthrough
Prefer to watch? These cover the same steps.
Community videos. Tishvi is not affiliated with creators.
About the LCD + I2C Module
What makes this display easy to use.
A standard 16×2 LCD needs up to 12 wires to the Arduino. The I2C backpack (PCF8574T chip) soldered to the back reduces this to just 4 wires. It communicates over the I2C bus, the same as the OLED display — so both devices can share the same A4 and A5 pins (at different addresses).
ASCII characters
Arduino 5V pin only
Address: 0x27
On/Off via library
What You Need
Everything required for this guide.
Tishvi Arduino UNO R3
Must already be set up with Arduino IDE. See the UNO R3 Setup Guide first.
16×2 LCD with I2C Backpack (PCF8574T)
The LCD with a small PCB soldered to its back — 4 header pins labelled GND · VCC · SDA · SCL.
4× Jumper Wires (Female-to-Male)
Female end to LCD I2C header. Male end to Arduino.
USB-A to USB-B Cable + Computer with Arduino IDE
For uploading. One library needs to be installed before compiling.
Install the Library
One library needed — install before uploading.
Open Arduino IDE → Sketch → Include Library → Manage Libraries…
Search for: LiquidCrystal I2C
Install the one by Frank de Brabander (listed as "LiquidCrystal_I2C"). This is the most widely used library for I2C LCDs with PCF8574.
LiquidCrystal_I2C listed under Sketch → Include Library. You're ready to wire up.LiquidCrystal_I2C.h not found, try searching for just LiquidCrystal_I2C and look for the one by Frank de Brabander with the most downloads.Wiring (I2C)
Same 4-wire I2C connection as the OLED display.
| LCD I2C Pin | Arduino UNO R3 Pin | Wire Colour | Notes |
|---|---|---|---|
| GND | GND | Black | Common ground |
| VCC | 5V | Red | Must be 5V — this LCD does not work on 3.3V |
| SDA | A4 | Blue | I2C Data — fixed to A4 on UNO R3 |
| SCL | A5 | Green | I2C Clock — fixed to A5 on UNO R3 |
Hello World Sketch
Print text on both rows of the LCD.
This sketch initialises the LCD, turns on the backlight, and prints two lines of text — one on each row.
#include <Wire.h> #include <LiquidCrystal_I2C.h> // Address 0x27 is standard for PCF8574T. // If blank, try 0x3F (PCF8574AT variant). LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.backlight(); // Turn on blue backlight lcd.setCursor(0, 0); // Column 0, Row 0 (top) lcd.print(" Hello, World! "); lcd.setCursor(0, 1); // Column 0, Row 1 (bottom) lcd.print(" Tishvi Docs "); } void loop() { // Message stays — nothing in loop }
0x3F.Uptime Counter Sketch
Display live HH:MM:SS uptime on the LCD.
This sketch updates the LCD every second with a live uptime timer. It demonstrates overwriting specific columns without clearing the whole screen — which prevents the LCD from flickering.
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.print("Uptime:"); } void printPad(int v) { if (v < 10) lcd.print("0"); lcd.print(v); } void loop() { unsigned long t = millis() / 1000; int h = t / 3600; int m = (t % 3600) / 60; int s = t % 60; lcd.setCursor(0, 1); printPad(h); lcd.print(":"); printPad(m); lcd.print(":"); printPad(s); lcd.print(" Tishvi"); delay(1000); }
lcd.clear() every loop (which causes visible flicker), position your cursor with setCursor() and overwrite only the changing characters. Pad strings to a fixed width so old characters are always replaced.Troubleshooting
Screen blank or showing wrong output? Start here.
Backlight on but no text visible
The most common issue — contrast is set too low. On the I2C backpack there is a small blue box potentiometer. With the LCD powered and showing a sketch, use a small Phillips screwdriver to slowly turn it until dark rectangles or text become visible.
Screen completely blank (no backlight)
Check VCC is connected to 5V (not 3.3V). Verify GND. Also confirm SDA → A4 and SCL → A5 aren't swapped. Run an I2C scanner sketch to confirm the module is seen on the bus.
Sketch uploads but nothing happens
The I2C address may be wrong. Try LiquidCrystal_I2C lcd(0x3F, 16, 2); instead of 0x27. PCF8574AT chips use 0x3F, while PCF8574T uses 0x27. Run an I2C scanner to find the exact address.
Compile error: LiquidCrystal_I2C.h not found
Install the library: Sketch → Include Library → Manage Libraries → search LiquidCrystal I2C → install by Frank de Brabander.
First row shows blocks, second row is blank
This is an uninitialised display — your lcd.init() may not have run. Check that lcd.init() and lcd.backlight() are both inside setup(), before any print() calls.
Download Sample Sketch
Get a ready-to-upload .ino file for the 16×2 LCD.
Download the full sample sketch — it includes a welcome screen, a live HH:MM:SS uptime counter, zero-padding helper, and detailed comments. Requires the LiquidCrystal_I2C library (Step 3).
.ino file. If the address 0x27 doesn't work, change it to 0x3F on line 10 of the sketch.Next Steps
Ideas for your LCD project.
Show Distance on LCD
Combine with the HC-SR04 to show live distance measurements on the LCD — a simple ultrasonic range finder with display.
OLED Display Alternative
For a smaller, higher-contrast display with graphics capability, try the 0.96" OLED — it uses the same I2C pins.
Arduino Project Hub
LCD clocks, menu systems, sensor dashboards — hundreds of 16×2 projects to explore and build.