Click two terminals to wire · Drag headers to move parts · Middle-drag to pan
Wheel to scroll · Middle-drag or Space + drag to pan
Raspberry Pi 4
40-PIN GPIO HEADER · PHYSICAL PIN ORDER
BROADCOM GPIO
USB-C POWERHDMI ×2USB
SIMULATED GPIO BOARD
0 wiresExample loaded. Click ▶ Run Python to simulate. Python input() opens a terminal prompt.
How to use PiLab Studio
Try the first example: click Run Python, then click the push button on the circuit. The LED follows the button.
Callbacks (v5): load GPIO edge callback or gpiozero button callbacks, run Python, then press/release the wired button. A counter beside main.py shows callback executions. Event callbacks need the Python program to remain running (for example with a short while True: sleep(0.1) loop).
Change examples: select an example above the Python editor. Its correctly wired starter circuit loads automatically.
Build your own: click components in the left palette. Click any gold terminal, then another terminal to make a wire. Drag parts using the top bar. Use the ✕ on a component, or click a part or wire and choose Delete selected. Press Delete/Backspace when the editor is not focused. Clear canvas removes all components and wires.
Inspect: click a component (not its terminal) to change resistor values, PIR motion, temperature, distance, or other properties.
Run your Python: the simulator supports import RPi.GPIO as GPIO, common gpiozero objects, time.sleep(), loops, GPIO input/output, basic PWM, and the sim sensor helpers.
Smart Python editor: suggestions appear as you type; press Ctrl+Space or click Suggestions to view completions. Press Enter after a colon (:) to indent a Python block automatically. Red squiggles mark errors: click an error underneath the editor to jump to the line. Syntax analysis uses Python when loaded; runtime errors are shown when a program runs.
Global variables (v5.4): top-level variables now use real Python module scope. Use global counter inside functions and callbacks when changing a top-level variable. Try the new Global counter example.
Terminal input (v5.3): call input("Prompt: ") in your Python code, then type your answer in the Terminal and press Enter. Try the Terminal input controls LED example. Use A−/A+, Ctrl+wheel over the terminal, or Expand to adjust its size.
Projects: Save downloads a JSON file containing your circuit and source code. Open imports it. Changes also auto-save locally in this browser.
Scope and limitations: This models digital GPIO connections, basic resistance/current estimates, and selected sensors—not the Linux OS, a Raspberry Pi CPU, an accurate analogue SPICE solver, native hardware drivers, I²C/SPI bus timing, or full Python packages. Python runs in a sandboxed Web Worker via Pyodide (requires internet the first time). GPIO pins must never receive 5 V on a physical Pi, even if a simulated circuit appears to work.
Additional Python APIs in this version: sim.read_dht("DHT11 1"), sim.read_distance("HC-SR04 1"), sim.lcd_write("LCD 1", "Hello"), and sim.set_servo(18, 90). Pin values for sim.set_servo use BCM numbering.