Learn

LCD1602 (Parallel) on a Raspberry Pi 4B: Wiring & Python

Wire a 16x2 LCD in parallel/direct-GPIO mode to a Raspberry Pi 4B and print text to it with Python — full pinout, wiring, and starter code.

Try this directly in the free Raspberry Pi 4B simulator — no hardware or signup required. New to the GPIO header? Start with the interactive pinout guide.

What you’ll need

Step by step

  1. Drag Raspberry Pi 4B onto the Canvas.
  2. Drag LCD1602 (Parallel) onto the Canvas — like the Servo, this connects via drawn wires, not breadboard legs.
  3. Hover over each pin to see its real label. You should find: VSS (ground), VDD (+5V), VO (contrast), RS, E, D4, D5, D6, D7, and backlight A/K. RW is wired to always-write mode on this component — if you see an RW pin at all, it likely doesn't need to be connected; hover its tooltip to confirm.
  4. Wire the power pins: VSS → GND. VDD → 5V. A (backlight anode) → 5V. K (backlight cathode) → GND. VO controls contrast — check its hover label for guidance; real hardware usually needs a contrast adjustment here, so if you're unsure, try wiring it to GND first (typically gives maximum contrast on real hardware).
  5. Wire the signal pins to GPIO — this needs 6 separate GPIO pins, one each for: RS, E, D4, D5, D6, D7.
  6. Note down which GPIO pin number you used for each — you'll need them in the script.
import RPi.GPIO as GPIO
import asyncio
# Adjust these to match however you wired step 5
rs = 37
e = 35
d4, d5, d6, d7 = 33, 31, 29, 23
 
GPIO.setmode(GPIO.BOARD)
 
from RPLCD.gpio import CharLCD
lcd = CharLCD(pin_rs=rs, pin_e=e, pins_data=[d4, d5, d6, d7], numbering_mode=GPIO.BOARD)
lcd.write_string("Hello ZOLB!")
 
await asyncio.sleep(2)
GPIO.cleanup()

What “working correctly” looks like

More component tutorials are in Learn.