ESP32 C3 Super Mini - LCD 20x4

In this ESP32 C3 Super Mini LCD 20x4 I2C tutorial, we'll show you how to display text on a 20x4 LCD screen using I2C communication. This beginner-friendly guide makes it easy to add a large display to your ESP32 projects.

In this tutorial, you'll learn:

ESP32 C3 Super Mini - LCD 20x4

Hardware Preparation

1×ESP32 C3 Super Mini
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×LCD 20x4
1×Jumper Wires
1×Optionally, DC Power Jack

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Buy Note: Alternatively, you can assemble the LCD I2C display using LCD 1602 Display and PCF8574 I2C Adapter Module.

Overview of LCD I2C 20x4

LCD I2C 20x4 is a liquid crystal display module that shows 20 characters per line across 4 rows using simple I2C communication.

  • Display Capacity: 20 columns × 4 rows (80 characters total)
  • Interface: I2C (only 2 wires needed for data)
  • Operating Voltage: 5V
  • I2C Address: Typically 0x27 (may vary by manufacturer)
  • Backlight: Built-in LED backlight (blue or green)
  • Contrast: Adjustable via onboard potentiometer
  • Beginner-Friendly: Much easier wiring than parallel LCD displays
  • Perfect For: Displaying sensor readings, menus, and multi-line messages

Pinout

The LCD 20x4 I2C module has just 4 pins, making connections simple:

  • GND: Ground pin - connect to GND (0V)
  • VCC: Power supply pin - connect to 5V
  • SDA: I2C data line - serial data communication
  • SCL: I2C clock line - serial clock signal
LCD 20x4 I2C Pinout

LCD Coordinate

Understanding the LCD coordinate system helps you position text precisely:

  • 20 columns: numbered 0 to 19 (left to right)
  • 4 rows: numbered 0 to 3 (top to bottom)
  • Cursor positioning: Use setCursor(column, row) to place text anywhere
  • Top-left corner: Position (0, 0)
  • Bottom-right corner: Position (19, 3)
ESP32 C3 Super Mini LCD I2C Coordinate

Wiring Diagram

Here are the wiring connections for the ESP32 C3 Super Mini and LCD 20x4 I2C display:

  • USB-Powered Setup: When powering ESP32 via USB port
The wiring diagram between ESP32 C3 Super Mini LCD 20x4 I2C

This image is created using Fritzing. Click to enlarge image

  • External Power Setup: When powering ESP32 via Vin pin
The wiring diagram between ESP32 C3 Super Mini LCD 20x4 I2C external power source

This image is created using Fritzing. Click to enlarge image

※ NOTE THAT:

When powering the ESP32 C3 Super Mini through the USB port, it is possible to power the LCD display using the VBUS pin of the ESP32 C3 Super Mini, eliminating the need for an external power source. However, it is important to note that this approach may not work as the power provided by the VBUS pin might be insufficient for the proper functioning of the LCD display.

LCD I2C ESP32 C3 Super Mini
VCC 5V
GND GND
SDA A4
SCL A5

How To Program For LCD I2C

The DIYables_LCD_I2C library makes programming the LCD 20x4 I2C display simple and straightforward for ESP32 C3 Super Mini projects.

The code performs these key steps:

  • Includes the DIYables LCD I2C library for easy display control
  • Creates an LCD object with I2C address and display dimensions
  • Initializes the LCD and turns on the backlight
  • Positions the cursor at specific coordinates
  • Prints text messages to each of the four rows

Include the Library

#include <DIYables_LCD_I2C.h> // Library for LCD

Declare LCD Object

DIYables_LCD_I2C lcd(0x27, 20, 4); // I2C address 0x27, 20 column and 4 rows

Initialize the LCD

lcd.init(); //initialize the lcd lcd.backlight(); //open the backlight

Set Cursor Position

lcd.setCursor(column_index, row_index);

Print Text Message

lcd.print("Hello World!");

※ NOTE THAT:

The I2C address of LCD can vary according to the manufacturers. In the code, we used 0x27 that is specified by DIYables manufacturer

ESP32 C3 Super Mini Code

/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-lcd-20x4 */ #include <DIYables_LCD_I2C.h> DIYables_LCD_I2C lcd(0x27, 20, 4); // I2C address 0x27, 20 column and 4 rows void setup() { lcd.init(); // Initialize the LCD I2C display lcd.backlight(); lcd.setCursor(0, 0); // move cursor the first row lcd.print("LCD 20x4"); // print message at the first row lcd.setCursor(0, 1); // move cursor to the second row lcd.print("I2C Address: 0x27"); // print message at the second row lcd.setCursor(0, 2); // move cursor to the third row lcd.print("DIYables"); // print message at the third row lcd.setCursor(0, 3); // move cursor to the fourth row lcd.print("www.diyables.io"); // print message the fourth row } void loop() { }

Detailed Instructions

  • New to ESP32 C3 Mini? Complete our Getting Started with ESP32 C3 Mini tutorial first to set up your development environment.
  • Set up Arduino IDE: If this is your first ESP32 C3 Super Mini project, follow the Arduino IDE setup tutorial to configure your environment.
  • Connect the hardware: Wire the LCD 20x4 I2C to ESP32 C3 Super Mini following the wiring diagram above.
  • Plug in USB cable: Connect the ESP32 C3 Super Mini to your computer using a USB Type-C cable.
  • Open Arduino IDE: Launch the Arduino IDE software on your computer.
  • Select your board: Choose ESP32 C3 Super Mini and the correct COM port from the Arduino IDE.
  • Install the library: Click the Library Manager icon on the left sidebar of Arduino IDE.
  • Search for library: Type "DIYables LCD I2C" in the search box.
  • Install DIYables library: Find the DIYables_LCD_I2C library by DIYables and click Install.
ESP32 C3 Super Mini DIYables LCD I2C library
  • Copy the code: Paste the example code above into Arduino IDE.
  • Upload the code: Click the Upload button to transfer code to your ESP32 C3 Super Mini.
  • View the display: Check the LCD screen - you should see text on all four rows.
  • Experiment: Try changing the text content and cursor positions to customize the display.
  • Pro Tip: If nothing appears on the LCD, adjust the small potentiometer on the back of the I2C module to increase contrast until text becomes visible.

Application Ideas

Here are practical projects you can build using the ESP32 C3 Super Mini with LCD 20x4 I2C display:

  • Weather station displaying temperature, humidity, pressure, and forecast
  • Smart thermostat showing current temperature, target temperature, mode, and schedule
  • Multi-sensor data logger displaying readings from multiple sensors simultaneously
  • Menu-driven system for controlling home automation devices
  • Real-time clock with date, time, day of week, and alarm status
  • Audio player interface showing song title, artist, album, and playback time
  • Network monitor displaying IP address, connection status, signal strength, and data usage

Video Tutorial

Watch the video below for a visual walkthrough of this project.

...VIDEO Z5z8MnJXb_s

Challenge Yourself

Take your ESP32 C3 Super Mini LCD skills further with these progressive challenges:

  • Easy: Display your name on the first row and your favorite quote on rows 2-4
  • Easy: Create a countdown timer that displays seconds remaining on the LCD
  • Medium: Read temperature from a DHT11 sensor and display it with a custom degree symbol
  • Medium: Build a scrolling text marquee that moves messages across the screen
  • Advanced: Create a multi-screen menu system that cycles through different information displays every 5 seconds
  • Advanced: Design a real-time system monitor showing WiFi status, uptime, memory usage, and sensor data

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!