Raspberry Pi Zero W - fhnw-imvs/fhnw-idb GitHub Wiki

Buy

Remarks

Setting up a Pi is more complex than with a microcontroller. The route via Wi-Fi, either in the home network or with a mobile hotspot, is easier than a direct connection via a USB cable.

Choose a simple way first. Make sure that both devices are ultimately on the same Wi-Fi network so that they can communicate with each other. Another Wi-Fi network can be added to the Pi at any time.

Setup

1. Flash Raspberry Pi OS (Bookworm) onto an SD Card

  1. Download the Raspberry Pi Imager from here.
  2. Insert your microSD card into your computer.
  3. Open Raspberry Pi Imager and select:
    • Raspberry Pi Model: Raspberry Pi Zero
    • Operating System: Raspberry Pi OS Lite (Bookworm, 32-bit)
    • Storage: Select your SD card.
  4. Click button Continue and configure clicking Edit settings:
    • Username and password
    • Enable SSH (Use password or public key authentication)
    • Set Wi-Fi SSID and Password (For your mobile hotspot)
    • Optional: Set hostname (e.g., pi-zero)
  5. Click Write to flash the OS.

2. Boot the Raspberry Pi and Connect via SSH

  1. Check that your mobile hotspot is activated.
  2. Connect your computer to the same hotspot.
  3. Insert the SD card into the Raspberry Pi Zero W.
  4. Power it on using a USB cable connected to a power adapter or computer.
  5. Be patient. This step can initially take several minutes.
    Use the mobile hotspot from step 1 to check connected devices or use
    • mDNS and
      ping raspberrypi.local
      or the hostname you set during the flash process.
    • an IP scanner app to find the Raspberry Pi’s IP.
  6. Connect via SSH from your computer or phone:
    ssh pi@<IP_ADDRESS>
    • Default hostname: raspberrypi
    • Default username: pi
    • Default password: raspberry

3. Update and Configure the System

  1. Update system packages:
    sudo apt update && sudo apt upgrade -y
  2. If you want to reconfigure some system parameters, open Raspberry Pi Config:
    sudo raspi-config
    • Change password
    • Set the correct timezone
    • Enable interfaces (I2C, SPI, etc.) if needed

Now, the Raspberry Pi Zero W is ready!

Tools

SCP

Copy a file from the computer to the Pi

$ scp -P 22 LOCAL_FILE pi@RASPI_IP:RASPI_PATH

Copy a file from the Pi to the computer

$ scp -P 22 pi@RASPI_IP:RASPI_FILE LOCAL_PATH

Code

Python

Pinout

Resources

⚠️ **GitHub.com Fallback** ⚠️