π Raspberry Pi LabPython · Pi 4 & 5Python pathway ↗

PYTHON · RASPBERRY PI 4 & 5

Raspberry Pi projects

Choose a finished result you want to make. Build a game, record sensor data, control a light, take photos, or drive a robot with Python.

26 projects · Beginner to advanced

01Start with PythonText, files, Linux & data
02Make it movePygame & controls
03Connect hardwareLights, buttons & sensors
04Combine your skillsCameras, dashboards & robots

CHOOSE WHAT YOU WANT TO MAKE

What will you build?

← All projects

PYTHON 3 · TYPE IN THONNY

Checkpoint example

Sources & further reading

These classroom examples are adaptations written for this lab. Source links cover the underlying project ideas and APIs; older source tutorials may use different software.

Research checked October 26, 2026. Hardware behavior still needs testing on your Pi.

BEFORE YOU START

Set up your Raspberry Pi

Use a Raspberry Pi 4 or 5 with Raspberry Pi OS desktop, a working power supply, keyboard, mouse, and monitor. These projects use Python 3 on the Pi.

  1. Open Thonny. Choose the local Python 3 interpreter. Save a new file in a project folder before running it. Avoid naming files pygame.py, gpiozero.py, flask.py, or random.py.
  2. Install only what your project needs. Its Prepare checkpoint lists the Terminal command. If packages cannot be installed on a school Pi, ask your teacher to prepare it.
  3. Run one checkpoint at a time. Type the numbered example in Thonny, save, then press F5. Use Stop or Ctrl+C to stop a running program.
  4. Connect hardware with power disconnected. GPIO numbers in Python use BCM numbering; wiring tables also give physical pin numbers. Run pinout in Terminal to check the header.
  5. Check the circuit. LEDs need resistors. GPIO signals are 3.3V. An HC-SR04 ECHO needs a divider. Motors need a driver and separate suitable power.

Pygame and OpenCV windows need the desktop. Camera projects use a CSI ribbon camera and Picamera2. Browser pages here provide instructions and code; run the programs on your Pi.

Raspberry Pi OS Python documentation ↗