Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

Start / Board Guides

Raspberry Pi 5 4GB

Boot Raspberry Pi OS and run your first Python program on Pi 5.

← Choose a different board

What you need

  • Raspberry Pi 5 and its recommended USB-C 5 V / 5 A USB-PD supply; a Pi 4 supply can limit USB peripheral current.
  • A 32 GB or larger microSD card, a USB card reader, and another computer to write a current Pi 5-compatible Raspberry Pi OS image.
  • For desktop use: a micro-HDMI display cable, monitor, USB keyboard and mouse. For headless use: a network connection and another computer with SSH.
Raspberry Pi 5 4GB

No GPIO wiring is needed. Keep the board ventilated; use suitable cooling for sustained workloads. Shut down Raspberry Pi OS before removing power or storage.

Setup

  1. Install a Pi 5-compatible OS

    Follow the shared Pi OS setup, selecting Raspberry Pi 5 and Raspberry Pi OS (64-bit) in Imager. Do not assume an old Pi 4 card supports Pi 5. If the Pi already boots a supported OS, keep its files and skip re-imaging.

  2. Sign in and open Terminal

    Use the Pi's desktop Terminal or an SSH session connected to it. Use the recommended 5 A USB-PD supply for peripheral headroom. The basic program does not need GPIO access or a cooling stress test.

Your first program

The Python script prints a greeting, checks a small calculation and reports the interpreter, architecture and actual board model.

Download complete project ZIP · Raspberry Pi OS + Python
first_success.py
#!/usr/bin/env python3
"""First Linux/Python success. No GPIO, network service or extra package."""
import platform
from pathlib import Path

def model_name():
    model = Path("/proc/device-tree/model")
    try:
        return model.read_bytes().rstrip(b"\x00").decode("utf-8")
    except OSError:
        return "Unavailable: host execution does not establish a Raspberry Pi"

def main():
    print("Engineering Club: Python is running")
    print("Calculation: 2 + 3 =", 2 + 3)
    print("Python:", platform.python_version())
    print("Machine:", platform.machine())
    print("Model:", model_name())

if __name__ == "__main__":
    main()
  1. Download the project onto the Pi

    On the Pi desktop, download the complete project ZIP, extract it, and open the extracted folder in the file manager. Open a terminal in that folder. With SSH, download and extract the ZIP on your computer, open a local terminal in that extracted folder, then copy first_success.py to the Pi using the command below. Replace both placeholders with your own Imager settings.

    scp first_success.py YOUR_USERNAME@YOUR_HOSTNAME.local:~/
  2. Run Python on the Pi

    In the Pi terminal, change to the folder containing first_success.py. Use cd ~ if you copied it into your home folder above. Run the command below. Only Python's standard library is needed; leave the optional GPIO program in the archive for a separate exercise.

    python3 first_success.py

Verify it works

The first two lines should match below. The remaining lines show the installed Python version, machine architecture and a model identifying Raspberry Pi 5. The program exits after printing. Model unavailable means you should check where it ran. When finished, use sudo shutdown -h now and wait for a clean halt before disconnecting power.

Engineering Club: Python is running
Calculation: 2 + 3 = 5

Troubleshooting

Pi does not boot or shows a power warning

Use a current Pi 5-compatible OS image and the recommended supply. Check the shared Pi OS setup before changing the Python file.

Python cannot find the file

Run pwd and ls on the Pi. Change to the folder containing first_success.py; if you used scp as shown, run cd ~.

python3 is missing

Run sudo apt update and then sudo apt install python3 on Raspberry Pi OS. The example needs no third-party Python packages.

The model is not Raspberry Pi 5

Make sure this terminal is on the Pi. Reconnect to its configured SSH hostname rather than running the script on your laptop.