CNAP

LCD 1602 Reference

A 16-column, 2-row character LCD with an HD44780-compatible controller and a backlight LED.

Pin names

NameDescription
VSSGround
VDDPower (5V)
V0Contrast — tie to GND for max contrast in the simulator
RSRegister Select
RWRead/Write — tie to GND to always write
EEnable
D0–D7Data bus (only D4–D7 needed in 4-bit mode)
ABacklight LED anode
KBacklight LED cathode

Attributes

This component has no configurable attributes.

Usage

Drive the display in 4-bit mode using RS, E, and D4–D7, with RW and V0 tied to GND. Use the built-in LiquidCrystal library.

#include <LiquidCrystal.h>

// RS, E, D4, D5, D6, D7
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);
  lcd.print("Hello, World!");
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print("Time: ");
  lcd.print(millis() / 1000);
  lcd.print("s  ");
  delay(500);
}

In real hardware, wire RW and V0 to GND, and power the backlight (A) through a 220 Ω resistor from 5V, with K to GND.

Examples

DescriptionAttrs
Default 16×2 display{}

See also

  • LCD 2004 — same 16-pin interface, 20×4 characters
  • SSD1306 OLED — graphical alternative using I²C instead of a parallel bus