Learn

Using the Raspberry Pi 5 in the Simulator — GPIO Pins, Python and RPi.GPIO

Add a Raspberry Pi 5 to the free ZOLB simulator, wire an LED to its 40-pin GPIO header and blink it with Python — plus what's the same as the Pi 4B, what's different, and how RPi.GPIO works on a real Pi 5.

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 5
  • LED
  • Resistor (220Ω)

Step by step

  1. Open the Raspberry Pi simulator — no signup needed to try it.
  2. Drag a Raspberry Pi 5, an LED and a Resistor (220Ω) onto the Canvas. The Raspberry Pi 5 is in the component list next to the Raspberry Pi 4B and is available on the Free plan.

A circuit holds one Raspberry Pi board at a time — either a 4B or a 5. If you try to add a second board, the simulator refuses and prints a message in the Console. To switch boards, delete the current one first.

  1. Wire Pi pin 37 (GPIO26) → the resistor, the resistor → the LED's anode (long leg), and the LED's cathode → a Pi GND pin (for example pin 39).

The Pi 5 uses the same 40-pin header as the 4B, with the same physical pin numbers, BCM (GPIO) numbers and 3.3 V logic. GPIO pins are not 5 V tolerant, so never wire a 5 V signal straight into one. Any 4B circuit you've already built works on the 5 with the same wiring and code.

  1. Go to the Code tab and write:
import asyncio
import RPi.GPIO as GPIO
 
GPIO.setmode(GPIO.BOARD)
GPIO.setup(37, GPIO.OUT)
 
for _ in range(5):
GPIO.output(37, GPIO.HIGH)
await asyncio.sleep(0.5)
GPIO.output(37, GPIO.LOW)
await asyncio.sleep(0.5)
 
GPIO.cleanup()
  1. Click Start. The LED blinks five times. Because your script mentions RPi.GPIO, the Console also prints a one-time note about using RPi.GPIO on a real Raspberry Pi 5 — see the next section. Your code still runs here exactly as written.
Raspberry Pi 4BRaspberry Pi 5
40-pin GPIO header, pin numbers, BCM numberingYesSame
GPIO voltage3.3 V (not 5 V tolerant)3.3 V (not 5 V tolerant)
Board size85.6 × 56.5 mmSame
Extra connectors on the board15-pin camera/display ribbonsTwo 22-pin mini camera/display connectors, power button, RTC battery, fan and PCIe connectors, UART header
GPIO chip on real hardwareBroadcom SoCRP1 I/O chip
Plan needed in the simulatorFreeFree

The simulator draws the Pi 5's extra connectors for realism, but they are decorative and have no pins to wire. CPU, RAM, PCIe and GPU performance differences are not simulated — the simulator teaches GPIO, wiring and Python.

On a real Raspberry Pi 5, the older pip-installed RPi.GPIO library does not work, because GPIO moved to the RP1 chip. the fix is to install rpi-lgpio, which keeps the same import RPi.GPIO line working, or to use gpiozero, which Raspberry Pi recommends and which works on both the Pi 4B and the Pi 5. See the gpiozero tutorial in this section for a version of these circuits that runs unchanged on either board.

What “working correctly” looks like

  • The LED turns on and off five times, half a second each, then the script ends.
  • The Console shows a single note about RPi.GPIO on a real Pi 5 each time you press Start.
  • The same circuit behaves identically if you swap the Pi 5 for a Pi 4B.

If something’s wrong

  • The Pi 5 won't drop onto the Canvas and the Console shows a message → a circuit can only have one Raspberry Pi board; delete the existing 4B or 5 first.
  • LED never lights → check the anode/cathode orientation, and confirm pin 37 goes through the resistor to the LED and the LED returns to a GND pin.
  • Nothing happens when you press Start → make sure GPIO.setmode(GPIO.BOARD) is used, so pin 37 means physical pin 37 (GPIO26), not BCM 37.
  • The Console note about RPi.GPIO appears → that's expected for a Pi 5; it's a teaching reminder about real hardware, not an error in your script.