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.

Note: the LCD1602 (Parallel) is a Premium-tier component in the simulator — you’ll need a Premium or VIP plan to use it there.

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

  • Raspberry Pi 4B
  • LCD1602 (Parallel) — the direct-GPIO variant, not the I2C one

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()
  1. Click Start. The display only works while the simulation is running.

What “working correctly” looks like

  • Text appears on the simulated 16x2 display matching exactly what your script wrote.
  • Text stays put — updating it should replace/clear correctly on the next write, not garble or overlap.

If something’s wrong

  • The display stays blank → check its power. VSS must reach a Pi GND pin and VDD must reach a Pi power pin (5V), and the simulation must be running. An unpowered display ignores everything your script sends.
  • The display is powered but still blank → RS, E, D4, D5, D6 and D7 must each go to a Pi GPIO pin that your script drives. The display reads one nibble of data each time E goes from HIGH to LOW, so it shows nothing if E never toggles.
  • Wrong or missing pins in the script → the pin numbers in your script must be the physical pin numbers of the GPIO pins you wired to RS, E, D4, D5, D6 and D7.
  • Nothing changes when you wire VO, A or K → in the simulator these pins are present but have no effect. There is no contrast model and the backlight is always on, so text shows without them.
  • The text is gone after a restart → each Start begins with a clean, blank display. Your script has to write the text again.
  • Custom characters and display shifting are not supported by this component.