Raspberry Pi — Novice-to-Pro Developer Guide

Technology: raspberry-pi · Category: tooling · Last reviewed: 2026-08-23

Source: https://tech-stack.codeamanilabs.org/guide/raspberry-pi

Insight:

A Raspberry Pi is a full Linux computer the size of a credit card with a 40-pin GPIO header bolted to the side — so the same board both serves web apps and toggles real-world pins. Two rules decide everything: (1) the GPIO pins are 3.3V only — feed them 5V and you fry the SoC, so level-shift or use a Pico for 5V sensors; (2) gpiozero speaks BCM numbering, never the physical pin position (BCM17 ≠ physical pin 17). Flash with Raspberry Pi Imager (set SSH + Wi-Fi + hostname before first boot), ssh in headless, and you have an always-on ARM64 Linux box for ~$15–80 that sips power — ideal for an edge node on an East-African solar/battery setup.

██████╗  █████╗ ███████╗██████╗ ██████╗ ███████╗██████╗ ██████╗ ██╗   ██╗    ██████╗ ██╗
██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝    ██╔══██╗██║
██████╔╝███████║███████╗██████╔╝██████╔╝█████╗  ██████╔╝██████╔╝ ╚████╔╝     ██████╔╝██║
██╔══██╗██╔══██║╚════██║██╔═══╝ ██╔══██╗██╔══╝  ██╔══██╗██╔══██╗  ╚██╔╝      ██╔═══╝ ██║
██║  ██║██║  ██║███████║██║     ██████╔╝███████╗██║  ██║██║  ██║   ██║       ██║     ██║
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝     ╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝       ╚═╝     ╚═╝

Raspberry Pi — Novice-to-Pro Developer Guide

Focus: A complete path from "I just bought a Pi" to shipping production edge workloads — hardware models, headless OS setup, the 40-pin GPIO header and its 3.3V rule, the Python physical-computing stack (gpiozero, picamera2, lgpio), build ideas, experiments to run with Claude Code, and how the Pi compares to Arduino, ESP32, Jetson, and the Pi's own Pico microcontroller. Grounded in raspberrypi.com/documentation + gpiozero.readthedocs.io; reviewed 2026-08-23.

The Raspberry Pi is the rare device that is approachable on day one and still in your rack five years later. The trick is to learn it in the right order: get a headless Linux box running first (no monitor, no keyboard), then reach for the soldering iron. The interactive learn module above this page is a live 40-pin GPIO pinout explorer — start there to build intuition for the header, then use this reference.

Table of Contents

  1. What a Raspberry Pi actually is
  2. Pick the right board
  3. Headless OS setup (the right way)
  4. First-boot configuration
  5. The 40-pin GPIO header
  6. Physical computing with gpiozero
  7. The camera & other interfaces (I2C/SPI/UART)
  8. Hardware components shopping list
  9. Build ideas — novice to pro
  10. Experiments with Claude Code
  11. Raspberry Pi Pico (the microcontroller)
  12. Comparable tech stacks
  13. codeAmani notes

Official Documentation

Resource URL
Documentation hub https://www.raspberrypi.com/documentation/
Getting started https://www.raspberrypi.com/documentation/computers/getting-started.html
Computers / hardware reference https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
GPIO & the 40-pin header https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio
gpiozero (Python) https://gpiozero.readthedocs.io/en/stable/
picamera2 manual https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf
Datasheets https://datasheets.raspberrypi.com/
Interactive pinout (community) https://pinout.xyz/

1. What a Raspberry Pi actually is

A single-board computer (SBC): a complete ARM-based Linux computer — CPU, RAM, USB, HDMI, networking, storage (microSD) — on one board, with a 40-pin GPIO header for talking to electronics. That dual nature is the whole point:

flowchart TB
  subgraph PI["Raspberry Pi — one board, two faces"]
    subgraph LINUX["Linux computer"]
      CPU["ARM64 SoC + RAM"]
      NET["Wi-Fi / Ethernet"]
      SD["microSD: OS + storage"]
      USB["USB / HDMI"]
    end
    subgraph PHYS["Physical-computing face"]
      GPIO["40-pin GPIO header (3.3V)"]
      CSI["CSI: camera"]
      I2CSPI["I2C · SPI · UART buses"]
    end
  end
  LINUX -->|"same OS drives both"| PHYS
  WORLD["Sensors · motors · LEDs · displays"] --- GPIO
  CLOUD["Your web app · MQTT · cloud"] --- NET
  class GPIO pulse;
  class CPU pulse;

Why it matters: because it's real Linux, everything you already know — ssh, systemd, Docker, Python, Node, cron, nginx — works unchanged. And because it has GPIO, the same box that runs a Flask app can also read a temperature sensor or drive a relay. It is the cheapest honest "computer + I/O" you can buy.

Microcontroller vs SBC: A Pi runs a full OS and is great at software (servers, ML, networking). A microcontroller (Arduino, ESP32, the Pi Pico) runs one program on bare metal with precise real-time timing and microamp sleep. Many real projects pair them: Pi for brains + network, Pico/Arduino for the twitchy real-time pins. See §11 and §12.


2. Pick the right board

Don't overbuy. Match the board to the job:

Board RAM Best for Rough power Notes
Pi Pico / Pico 2 / Pico 2 W — (RP2040/RP2350 MCU) Real-time sensors, 5V tolerant-ish I/O, battery µA–mA Not Linux — a microcontroller (§11)
Pi Zero 2 W 512 MB Tiny always-on jobs, wearables, cameras ~0.4–1 W idle Quad-core, Wi-Fi/BT; header often unpopulated (solder it)
Pi 4 Model B 1–8 GB Home server, NAS, light desktop ~3–6 W USB 3, dual HDMI, mature
Pi 5 2–16 GB Desktop replacement, ML inference, fast I/O ~5–12 W BCM2712, PCIe lane, much faster; needs active cooling
Pi 500 / 500+ 8 / 16 GB Keyboard-in-a-box desktop (Pi 5-class) ~5–12 W BCM2712; 500+ adds mechanical keys + built-in 256 GB M.2 SSD
Compute Module 4 / 5 up to 8 / 16 GB Embedding in your own carrier board varies CM5 is Pi 5-class (BCM2712); for products, not breadboards
flowchart LR
  Q1{"Need a full Linux OS?"}
  Q1 -->|No, just precise pins / battery| PICO["Pico 2 / ESP32"]
  Q1 -->|Yes| Q2{"Tiny & low-power, or muscle?"}
  Q2 -->|Tiny always-on| ZERO["Pi Zero 2 W"]
  Q2 -->|Server / ML / desktop| Q3{"Budget vs speed?"}
  Q3 -->|Proven & cheap| PI4["Pi 4 (4–8 GB)"]
  Q3 -->|Fastest, PCIe| PI5["Pi 5 (8–16 GB)"]

Also buy (these are not optional): a quality USB-C/micro-USB power supply (under-volting causes mysterious crashes — use the official PSU or a known-good 5V/3A+), a decent A2-rated microSD card (16 GB+; cheap cards corrupt), and for the Pi 5 active cooling. For reliability, an NVMe/USB-SSD boot beats microSD.


3. Headless OS setup (the right way)

You do not need a monitor or keyboard. The professional workflow is headless from minute one.

1. Flash with Raspberry Pi Imager. Download from raspberrypi.com/software, pick your board, choose Raspberry Pi OS (Lite = no desktop, perfect for servers; full = desktop). Then — and this is the step beginners skip — click the ⚙ / "Edit settings" (OS customisation) button before writing:

flowchart LR
  A["Raspberry Pi Imager"] e1@--> B["Choose OS + storage"]
  B e2@--> C["⚙ Edit settings:<br/>hostname · SSH · Wi-Fi · locale"]
  C e3@--> D["Write + verify"]
  D e4@--> E["Insert SD, power on"]
  E e5@--> F["ssh user@amani-pi.local"]
  e1@{ animate: true }
  e2@{ animate: true }
  e3@{ animate: true }
  e4@{ animate: true }
  e5@{ animate: true }
  class C glow;

2. Boot and SSH in — no screen required:

# From your laptop (mDNS resolves <hostname>.local on the same network)
ssh amani@amani-pi.local
# or by IP if .local doesn't resolve:
ssh amani@192.168.1.42

# First things first
sudo apt update && sudo apt full-upgrade -y
sudo reboot

If *.local doesn't resolve (some Windows/Android setups), find the IP from your router's DHCP table or ping amani-pi.local. On Windows, install Bonjour/iTunes or just use the IP.


4. First-boot configuration

raspi-config is the official text-UI for system settings; everything in it is also scriptable:

sudo raspi-config            # interactive: interfaces, locale, hostname, boot
sudo raspi-config nonint do_i2c 0    # enable I2C non-interactively (0 = enable)
sudo raspi-config nonint do_spi 0    # enable SPI
sudo raspi-config nonint do_ssh 0    # ensure SSH on

Interfaces (I2C, SPI, the camera, UART) can also be toggled directly in /boot/firmware/config.txt via device-tree params — useful in provisioning scripts and Ansible:

# /boot/firmware/config.txt  — enable buses at boot
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on
# camera autodetect is on by default on current Pi OS:
camera_auto_detect=1
# Sanity checks after enabling
ls /dev/i2c-*          # I2C bus appears
ls /dev/spidev*        # SPI device appears
i2cdetect -y 1         # scan the I2C bus for device addresses (sudo apt install i2c-tools)
vcgencmd measure_temp  # SoC temperature — watch for throttling

5. The 40-pin GPIO header

Every current Pi (and the Zero/Pico, sometimes unpopulated) exposes a 40-pin header on a 0.1in (2.54 mm) pitch. The single rule that saves your board:

⚠️ GPIO is 3.3V logic, not 5V. The pins source/sink 3.3V and are not 5V-tolerant — putting 5V on a GPIO input can permanently damage the SoC. There are two 5V pins (for powering peripherals) and several 3V3 and GND pins, but every signal pin is 3.3V. Use a level shifter for 5V sensors, or hang them off a Pico instead.

The header is a fixed standard across boards. The layout (physical pin → function):

Pin Function Pin Function
1 3V3 power 2 5V power
3 GPIO2 (I2C SDA) 4 5V power
5 GPIO3 (I2C SCL) 6 GND
7 GPIO4 (GPCLK0) 8 GPIO14 (UART TXD)
9 GND 10 GPIO15 (UART RXD)
11 GPIO17 12 GPIO18 (PCM/PWM)
13 GPIO27 14 GND
15 GPIO22 16 GPIO23
17 3V3 power 18 GPIO24
19 GPIO10 (SPI MOSI) 20 GND
21 GPIO9 (SPI MISO) 22 GPIO25
23 GPIO11 (SPI SCLK) 24 GPIO8 (SPI CE0)
25 GND 26 GPIO7 (SPI CE1)
27 GPIO0 (ID EEPROM) 28 GPIO1 (ID EEPROM)
29 GPIO5 30 GND
31 GPIO6 32 GPIO12 (PWM)
33 GPIO13 (PWM) 34 GND
35 GPIO19 (PCM/SPI1) 36 GPIO16
37 GPIO26 38 GPIO20 (PCM/SPI1)
39 GND 40 GPIO21 (PCM/SPI1)

BCM vs physical numbering — the #1 beginner trap. Software (gpiozero, RPi.GPIO) addresses pins by Broadcom (BCM) GPIO number, not by physical position. LED(17) means BCM17, which sits at physical pin 11 — not physical pin 17 (that's a 3V3 power pin). When in doubt, run pinout on the Pi:

pinout       # ASCII diagram of YOUR board's header (ships with gpiozero)

6. Physical computing with gpiozero

gpiozero is the official, beginner-friendly Python library — it wraps pins as devices (LED, Button, Servo, DistanceSensor) so you write intent, not register pokes. It's pre-installed on Raspberry Pi OS; otherwise:

sudo apt install python3-gpiozero      # recommended (also installs the `pinout` tool)
# or in a venv:
pip install gpiozero rpi-lgpio          # rpi-lgpio = modern lgpio backend for the Pi 5 (RP1 I/O)

Blink an LED (LED on BCM17 = physical pin 11, through a ~330Ω resistor to GND):

from gpiozero import LED
from time import sleep
from signal import pause

led = LED(17)            # BCM17 — NOT physical pin 17
while True:
    led.toggle()
    sleep(0.5)

Button toggles LED — event-driven, no polling loop:

from gpiozero import LED, Button
from signal import pause

led = LED(17)
button = Button(2)       # BCM2, with internal pull-up by default

button.when_pressed = led.on
button.when_released = led.off
pause()                  # sleep forever, let callbacks fire

PWM for brightness / motor speed:

from gpiozero import PWMLED
from time import sleep

led = PWMLED(17)
while True:
    led.value = 0.1      # 10% duty cycle
    sleep(1)
    led.pulse()          # smooth fade in/out
    sleep(3)

gpiozero uses BCM numbering and it is not configurable — but you can pass alternate notations that all resolve to BCM: LED(17), LED("GPIO17"), LED("BOARD11") (physical), or LED("J8:11") (header:pin). For lower-level work, RPi.GPIO (legacy) / rpi-lgpio (its drop-in successor on Pi 5) and pigpio (hardware-timed PWM, remote GPIO over the network) are the steps down toward the metal.

flowchart TB
  APP["Your Python script"] --> GZ["gpiozero (device abstractions)"]
  GZ --> BK{"Pin backend"}
  BK --> LG["lgpio / rpi-lgpio (Pi 5, current Pi OS)"]
  BK --> PIG["pigpio (HW-timed PWM, remote GPIO)"]
  LG --> HW["40-pin header"]
  PIG --> HW

7. The camera & other interfaces (I2C/SPI/UART)

Camera (CSI ribbon → picamera2). Modern Pi OS autodetects official camera modules. picamera2 is the supported Python API (the old picamera is deprecated):

sudo apt install -y python3-picamera2                  # full (with preview GUI deps)
sudo apt install -y python3-picamera2 --no-install-recommends   # Lite OS, no GUI
from picamera2 import Picamera2
from time import sleep

picam2 = Picamera2()
picam2.start()
sleep(2)                       # let auto-exposure settle
picam2.capture_file("shot.jpg")
picam2.stop()
rpicam-still -o test.jpg       # CLI capture (formerly libcamera-still)
rpicam-hello -t 5000           # 5s preview to confirm the camera is detected

The three buses, in one breath:

Bus Pins (BCM) Use it for Enable
I2C SDA=2, SCL=3 Many low-speed sensors/displays sharing 2 wires by address dtparam=i2c_arm=on
SPI MOSI=10, MISO=9, SCLK=11, CE0=8 Fast displays, ADCs, SD/flash dtparam=spi=on
UART TXD=14, RXD=15 Serial to a Pico/Arduino/GPS/modem console off, enable_uart=1
i2cdetect -y 1        # find I2C device addresses (e.g. 0x3c for an OLED, 0x76 for BME280)

8. Hardware components shopping list

A starter kit that covers 90% of beginner projects:

The cardinal hardware rules: common ground between Pi and any external supply; never source motor/relay current from a GPIO pin; level-shift anything 5V; and double-check polarity before powering on.


9. Build ideas — novice to pro

flowchart LR
  N["NOVICE<br/>blink · button · buzzer<br/>web 'hello' on the LAN"]
  --> I["INTERMEDIATE<br/>weather station (BME280→DB)<br/>Pi-hole · home VPN · NAS<br/>time-lapse camera"]
  --> A["ADVANCED<br/>MQTT sensor mesh<br/>Kiosk / digital signage<br/>Retro game console"]
  --> P["PRO<br/>Edge ML (Hailo/Coral)<br/>K3s cluster of Pis<br/>Product on a Compute Module"]

10. Experiments with Claude Code

Claude Code runs on the Pi (it's just Linux + Node) or drives it remotely over SSH from your laptop. Both unlock fast hardware iteration: describe the circuit and the behaviour, let Claude write the gpiozero script, run it, read the output, and iterate.

# On the Pi (ARM64 Linux): install Node, then Claude Code
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
npm install -g @anthropic-ai/claude-code     # see the claude-api guide for current install
cd ~/projects/pi-lab && claude

Experiments that play to Claude Code's strengths:

  1. Conversational circuit bring-up. "I wired a BME280 to I2C and an SSD1306 OLED — read temp/humidity every 10s and show it on the display." Claude writes it; i2cdetect -y 1 confirms addresses; you run and refine.
  2. Hardware-in-the-loop TDD. Have Claude write a fake/mock pin backend (gpiozero supports a mock pin factory, GPIOZERO_PIN_FACTORY=mock) so logic is unit-tested on your laptop, then deployed to real pins on the Pi.
  3. Sensor → cloud pipeline. "Publish each reading to MQTT and also POST to a Next.js API route." Pairs with the webhooks and supabase guides.
  4. Local LLM on the edge. Run a small quantised model (ollama / llama.cpp) on a Pi 5 and have Claude Code build the glue: a voice-or-text assistant that works offline — relevant where connectivity is intermittent.
  5. Vision on the edge. Wire the camera + a Hailo/Coral accelerator; Claude scaffolds a picamera2 capture loop feeding an object detector, writing events to a DB.
  6. Remote GPIO from your dev box. pigpio exposes GPIO over the network — Claude Code on your laptop can prototype against the Pi's pins without copying files each iteration.

Run Claude Code over SSH for the tightest loop: edit on the laptop, execute on the Pi, watch real sensor output stream back. Pair with chrome-devtools to verify any web UI the Pi serves.


11. Raspberry Pi Pico (the microcontroller)

The Pico is a different animal: a microcontroller board built on the in-house RP2040 (Pico/Pico W) or RP2350 (Pico 2 / Pico 2 W) chip — not a Linux computer. The RP2350 keeps the dual-core, dual-PIO design but adds switchable Arm Cortex-M33 or RISC-V (Hazard3) cores, more SRAM, and secure/signed boot. No OS, no SD card; you flash one program that runs on bare metal. It shines where the Pi is weak: precise real-time timing, microamp sleep, true analog inputs (ADC), and being cheap enough to scatter.

flowchart LR
  subgraph SBC["Raspberry Pi (SBC)"]
    OS["Full Linux · network · ML · servers"]
  end
  subgraph MCU["Raspberry Pi Pico (MCU)"]
    BM["Bare-metal · real-time pins · ADC · µA sleep"]
  end
  MCU -->|"UART / I2C / USB"| SBC
  SBC -->|"brains + internet"| CLOUD["Cloud / dashboard"]

Two ways to program it:

# MicroPython (drag-and-drop firmware, then this is main.py) — blink the onboard LED
from machine import Pin
from time import sleep
led = Pin("LED", Pin.OUT)
while True:
    led.toggle()
    sleep(0.5)
// C/C++ with the Pico SDK — pico-examples style
#include "pico/stdlib.h"
int main() {
    const uint LED = PICO_DEFAULT_LED_PIN;
    gpio_init(LED); gpio_set_dir(LED, GPIO_OUT);
    while (true) { gpio_put(LED, 1); sleep_ms(250); gpio_put(LED, 0); sleep_ms(250); }
}

Pico W (RP2040) and Pico 2 W (RP2350) add 2.4 GHz Wi-Fi + Bluetooth, so they can publish to MQTT on their own. The classic architecture: Picos at the edge (sensors, real-time control) talking to a Pi hub (network, storage, dashboard).


12. Comparable tech stacks

What else lives in this space, and when to pick it instead:

Platform Type Pick it when
Arduino (Uno/Nano) MCU Dead-simple 5V I/O, huge tutorial base, no networking needed
ESP32 / ESP8266 MCU + Wi-Fi/BT Cheap connected sensors; Wi-Fi built in; battery IoT (the budget IoT king)
Raspberry Pi Pico / Pico 2 / Pico 2 W MCU (RP2040/RP2350) Real-time control, dual-core PIO, MicroPython/C, very cheap (Pico 2 W adds Wi-Fi)
NVIDIA Jetson (Nano/Orin) SBC + GPU On-device deep-learning / computer vision that a Pi can't keep up with
Google Coral Edge TPU (USB/dev board) Fast, low-power ML inference accelerator (add to a Pi, or standalone)
BeagleBone Black SBC Hard real-time via PRUs, lots of GPIO, industrial I/O
Orange Pi / Radxa Rock / Banana Pi SBC Pi-shaped boards, often more specs per dollar; software/community less polished
LattePanda / x86 mini-PCs SBC (x86) You need x86 + Windows compatibility, not ARM
flowchart TB
  Q{"What do you need?"}
  Q -->|"Heavy ML / vision"| JET["Jetson · or Pi + Coral/Hailo"]
  Q -->|"Cheap Wi-Fi sensor"| ESP["ESP32"]
  Q -->|"Real-time, no OS"| PICO["Pico 2 / Arduino"]
  Q -->|"Linux box + GPIO<br/>(the all-rounder)"| RPI["Raspberry Pi"]
  Q -->|"Hard real-time + Linux"| BBB["BeagleBone (PRUs)"]

The honest summary: the Pi wins on ecosystem — documentation, community answers, library support, and "it just works" software. Rivals win on specific axes (price-per-spec, GPU, battery life, real-time determinism). Most serious builds are hybrids: a Pi for brains + a Pico/ESP32 for the real-time edge.


13. codeAmani notes

Official docs: