Learn

Raspberry Pi 4B in the Simulator: GPIO Pins, Python

Add a Raspberry Pi 4B to the free ZOLB simulator, learn its 40-pin GPIO header and BOARD pin numbers, and blink an LED from pin 37 with Python.

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

Step by step

  1. Open the Raspberry Pi simulator. You do not need to sign up to try it.
  2. Drag a Raspberry Pi 4B, an LED and a Resistor (220Ω) onto the Canvas. The Raspberry Pi 4B is in the component list and is on the Free plan.

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

  1. Hover over the header pins to read their labels. The 40 pins use the physical pin numbers 1 to 40. For example, pin 1 is 3V3, pin 2 is 5V, pin 39 is GND and pin 37 is GPIO26.
  2. Wire Pi pin 37 → the resistor, the resistor → the LED's anode (long leg), and the LED's cathode → a Pi GND pin (for example pin 39).

GPIO pins run at 3.3 V and are not 5 V tolerant. Never wire a 5 V signal straight into one. The 3V3 and 5V power pins only supply power after you click Start.

  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.

What “working correctly” looks like

  • How to test it: the LED turns on and off five times, half a second each, and then the script ends. The Console shows one line each time pin 37 changes, for example "Pin 37 → HIGH".
  • The Pi 4B does not print the note about RPi.GPIO that the Pi 5 prints. Your code runs exactly as written.
  • The same circuit works if you swap the Pi 4B for a Pi 5.

If something’s wrong

  • The board will not drop onto the Canvas and the Console shows a message → a circuit can only have one Raspberry Pi board. Delete the existing one first.
  • The LED never lights → check the anode and cathode orientation, and that pin 37 goes through the resistor to the LED and back to a GND pin.
  • Nothing happens → make sure the script uses GPIO.setmode(GPIO.BOARD), so 37 means physical pin 37 (GPIO26), not BCM 37.
  • You wired an LED straight to a 3V3 or 5V pin and it stays dark before Start → that is normal. Power pins only act as power while the simulation runs.