meta data for this page
lamaPLC: LCD 1602/2004 with I²C communication
The HD44780 chip-based 1602/2004 LCD module is bright and high-contrast, thanks to its LCD technology, which features a blue-green background. This display is well-suited to your projects if you need a screen with a wide viewing angle, a compact design, and low power consumption. The LCD 1602 can display 16 characters in two rows, while the LCD 2004 can display 20 characters in four rows. Additionally, 1602/2004 displays can be easily connected using an I²C adapter.
Features
- Display Mode: STN, BLUB
- Display Format: 16 Characters x 2 Lines
- Viewing Direction: 6 O'clock
- Input Data: 4-Bit or 8-Bit interface available
- Display Font: 5 x 8 Dots
- Power Supply: Single Power Supply (5V±10%)
- Driving Scheme: 1/16 Duty, 1/5 Bias
- Backlight (side): white LED
interfaces
| Pin | symbol | description | function |
|---|---|---|---|
| 1 | Vss | GROUND | 0V (GND) |
| 2 | Vcc | POWER SUPPLY FOR LOGIC CIRCUIT | +5V |
| 3 | VEE | LCD CONTRAST ADJUSTMENT | |
| 4 | RS | INSTRUCTION/DATA REGISTER SELECTION | RS = 0 : INSTRUCTION REGISTER RS = 1 : DATA REGISTER |
| 5 | R/W | READ/WRITE SELECTION | R/W = 0 : REGISTER WRITE R/W = 1 : REGISTER READ |
| 6 | E | ENABLE SIGNAL | |
| 7 | DB0 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 8 | DB1 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 9 | DB2 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 10 | DB3 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 11 | DB4 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 12 | DB5 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 13 | DB6 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 14 | DB7 | DATA INPUT/OUTPUT LINES | 8 BIT: DB0-DB7 |
| 15 | LED+ | SUPPLY VOLTAGE FOR LED+ | +5V |
| 16 | LED- | SUPPLY VOLTAGE FOR LED- | 0V |
Font set
The LCD1602 employs the Hitachi HD44780 LCD controller chip. This chip features a built-in font and supports the definition of up to 8 custom characters.
There are two variants of the chip's ROM, each with different fonts: HD44780UA00, which contains Japanese katakana characters, and HD44780UA02, featuring Western European characters.
I²C adapter
Reduction of the pin count for controlling an LCD from 12 to 2 pins: This practical module enables fast data transfer and converts the serial data output of an LCD into an I²C signal. It uses only four pins instead of 16 and supports six selectable I²C addresses, enabling simultaneous operation of up to 6 displays.
The I²C address for the 1602 and 2004 LCD modules depends on the specific I/O expander chip used on the I²C backpack (usually a PCF8574).
Common Default Addresses
- 0x27: The most common default address for modules using the PCF8574T chip.
- 0x3F: The common default address for modules using the PCF8574AT chip.
Address Ranges by Chip Type
The address is determined by the state of three hardware pins (A0, A1, A2) on the backpack.
- PCF8574 / PCF8574T: Range is 0x20 to 0x27
- PCF8574A / PCF8574AT: Range is 0x38 to 0x3F
How to Change the Address
Most I²C backpacks have three sets of solder pads labeled A0, A1, and A2.
- Default State: Usually, these pads are “open” (high), resulting in the default address (0x27 or 0x3F).
- Changing Address: Shorting (soldering) a pad connects that address bit to ground (low), changing the address.
Configuration Table (for PCF8574)
- All Open: 0x27
- A0 Shorted: 0x26
- A1 Shorted: 0x25
- A2 Shorted: 0x23
- All Shorted: 0x20
Arduino example
Connect the 4 pins of the I²C backpack to your Arduino as follows:
- GND to GND.
- VCC to 5V.
- SDA to A4 (on Uno/Nano) or the dedicated SDA pin.
- SCL to A5 (on Uno/Nano) or the dedicated SCL pin.
Library Installation
Open the Arduino IDE, go to Sketch > Include Library > Manage Libraries, and search for and install “LiquidCrystal I2C” (by Frank de Brabander or Marco Schwartz).
This sketch works for both 1602 and 2004 displays. Ensure you update the 0x27 address and the 16, 2 dimensions if necessary:
#include <Wire.h> #include <LiquidCrystal_I2C.h> // Set the LCD address to 0x27 for a 16 chars and 2 line display // Change to (0x3F, 20, 4) for a 2004 display if 0x27 doesn't work LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); // Initialize the LCD lcd.backlight(); // Turn on the backlight lcd.setCursor(0, 0); // Move cursor to column 0, row 0 lcd.print("Hello, Arduino!"); lcd.setCursor(0, 1); // Move to second row lcd.print("I2C LCD Example"); } void loop() { // Add dynamic content here if needed }
display topics on lamaPLC
| Page | Date | Tags |
|---|---|---|
| 2026/02/11 21:07 | dm56a04, dm36b06, eletechsup, 7-segment, display, modbus, rtu, modbus rtu, arduino | |
| 2026/02/11 21:07 | communication, i2c, display, lcd, 1602, 2004, hd44780, pcf8574, pcf8574t, pcf8574at, arduino | |
| 2026/02/11 21:07 | tm1650, stc8g, tp8485e, hyuduo5x1b64edtk1244, 7-segment, display, modbus, rtu, modbus rtu, arduino | |
| 2026/02/11 21:07 | i2c, oled, display, ssd1306, sh1106, ssh1106, arduino, cmos |
This page has been accessed for: Today: 1, Until now: 2



