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
- Raspberry Pi 4B
- LCD1602 (Parallel) — the direct-GPIO variant, not the I2C one
Step by step
- Drag Raspberry Pi 4B onto the Canvas.
- Drag LCD1602 (Parallel) onto the Canvas — like the Servo, this connects via drawn wires, not breadboard legs.
- 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.
- 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).
- Wire the signal pins to GPIO — this needs 6 separate GPIO pins, one each for: RS, E, D4, D5, D6, D7.
- Note down which GPIO pin number you used for each — you'll need them in the script.
import RPi.GPIO as GPIOimport asyncio# Adjust these to match however you wired step 5rs = 37e = 35d4, d5, d6, d7 = 33, 31, 29, 23 GPIO.setmode(GPIO.BOARD) from RPLCD.gpio import CharLCDlcd = 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
- 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.
More component tutorials are in Learn.