An I2C LCD is a Liquid Crystal Display that uses the I2C communication protocol to show text data. It's widely used in embedded and IoT projects to display information such as temperature, sensor values, time, and status messages.
Displays text only (not graphics)
Usually 16x2 (16 characters x 2 lines) or 20x4
Has an I2C backpack (PCF8574 chip) that allows communication using just 2 pins: SDA (data) and SCL (clock)
Saves GPIO pins, compared to traditional 6- or 8-pin LCD control
| Component | Description |
|---|---|
| ESP32 Dev Board | Microcontroller (WiFi + BLE) |
| I2C LCD 16x2 | Text display with I2C backpack |
| Jumper Wires | Male-to-female wires |
| Breadboard (opt.) | For cleaner wiring |
| Arduino IDE | For programming ESP32 |
| I2C LCD Pin | ESP32 Pin | Function |
|---|---|---|
| VCC | 3.3V or 5V | Power supply |
| GND | GND | Ground |
| SDA | GPIO 21 | I2C Data |
| SCL | GPIO 22 | I2C Clock |
π The I2C address is usually 0x27 or 0x3F
The I2C backpack on the LCD uses the PCF8574 chip, which acts as an I/O expander.
This chip converts 2-wire I2C signals into the parallel signals needed to control the LCD.
The ESP32 sends commands/data over SDA/SCL, and the chip handles display logic.
The LCD has two rows: Row 0 and Row 1.
Each row supports 16 characters (in a 16x2 LCD).
You control the cursor to set where text appears.
The LiquidCrystal_I2C library simplifies the process.
In Arduino IDE:
Go to Sketch > Include Library > Manage Libraries
Search and install:
β
LiquidCrystal_I2C (by Frank de Brabander or compatible)
| Function | Purpose |
|---|---|
lcd.init() |
Start communication |
lcd.backlight() |
Turn on display backlight |
lcd.setCursor(x, y) |
Move cursor to (x: column, y: row) |
lcd.print("text") |
Print text to current cursor |
lcd.clear() |
Clear entire screen |
| Issue | Solution |
|---|---|
| No text on screen | Try other I2C address (e.g., 0x3F) |
| Characters not showing | Add lcd.backlight() |
| Random characters | Use correct column/row sizes |
| Display frozen | Check connections and address |
| Project | Description |
|---|---|
| Temperature Monitor | Show sensor readings (DHT11/22) |
| WiFi Status Display | Show IP address or signal strength |
| RTC Clock Display | Show time/date from RTC module |
| SMS Viewer with SIM900 | Display incoming SMS messages |
| Sensor Dashboard | Gas, sound, light sensors status |
HOW TO OPERATE