

The LCD 20x4 I2C is a 20-character by 4-line Liquid Crystal Display module that utilizes I2C (Inter-Integrated Circuit) communication. This module is designed for easy integration with microcontrollers, requiring only two data lines (SDA and SCL) for communication. It is widely used in projects where a compact and efficient display is needed to show text, numbers, or simple symbols.








| Parameter | Value |
|---|---|
| Display Type | 20x4 Character LCD |
| Communication Protocol | I2C (Inter-Integrated Circuit) |
| Operating Voltage | 5V DC |
| Backlight | LED (adjustable brightness) |
| Contrast Adjustment | Potentiometer (onboard) |
| I2C Address (Default) | 0x27 (can vary by module) |
| Operating Temperature | -20°C to +70°C |
| Dimensions | ~98mm x 60mm x 12mm |
The LCD 20x4 I2C module typically has a 4-pin interface for I2C communication. Below is the pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | GND | Ground (0V) |
| 2 | VCC | Power supply (5V DC) |
| 3 | SDA | Serial Data Line for I2C communication |
| 4 | SCL | Serial Clock Line for I2C communication |
Wiring the LCD 20x4 I2C to a Microcontroller:
GND pin of the LCD to the ground pin of the microcontroller.VCC pin of the LCD to the 5V power pin of the microcontroller.SDA pin of the LCD to the SDA pin of the microcontroller (e.g., A4 on Arduino UNO).SCL pin of the LCD to the SCL pin of the microcontroller (e.g., A5 on Arduino UNO).Install Required Libraries:
LiquidCrystal_I2C library from the Arduino Library Manager.Adjust the Contrast:
0x27, but it may vary depending on the module.Below is an example code to display text on the LCD 20x4 I2C using an Arduino UNO:
#include <Wire.h> // Include the Wire library for I2C communication
#include <LiquidCrystal_I2C.h> // Include the LiquidCrystal_I2C library
// Initialize the LCD with I2C address 0x27 and 20x4 dimensions
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
lcd.begin(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
lcd.setCursor(0, 0); // Set cursor to the first column, first row
lcd.print("Hello, World!"); // Print text on the first row
lcd.setCursor(0, 1); // Set cursor to the first column, second row
lcd.print("LCD 20x4 I2C"); // Print text on the second row
lcd.setCursor(0, 2); // Set cursor to the first column, third row
lcd.print("Line 3 Example"); // Print text on the third row
lcd.setCursor(0, 3); // Set cursor to the first column, fourth row
lcd.print("Line 4 Example"); // Print text on the fourth row
}
void loop() {
// No actions in the loop for this example
}
No Display or Blank Screen:
GND and VCC pins.Incorrect or Garbled Characters:
Backlight Not Turning On:
lcd.backlight() function is called in the code.I2C Address Not Detected:
Q: Can I use the LCD 20x4 I2C with a 3.3V microcontroller?
A: Yes, but you will need a logic level shifter to safely interface the 3.3V microcontroller with the 5V LCD module.
Q: How do I change the I2C address of the module?
A: The I2C address can be changed by modifying the solder jumpers on the back of the module. Refer to the module's datasheet for details.
Q: Can I display custom characters on the LCD?
A: Yes, the LiquidCrystal_I2C library supports creating and displaying custom characters. Refer to the library documentation for examples.
Q: What is the maximum cable length for I2C communication?
A: The maximum length depends on the pull-up resistor values and the operating frequency, but it is generally recommended to keep the cable length under 1 meter for reliable communication.