The Raspberry Pi, the microSD card and the lab
The Raspberry Pi 5 is a small but complete Linux computer: CPU, memory, USB, network, HDMI and a row of GPIO pins for electronics. In this class it is the server of the IoT system:
sensors ──> Arduino Uno ──USB serial──> Raspberry Pi 5 ──> MariaDB database ──> web page (Flask or PHP)
The Arduino is good at reading sensors in real time. The Pi is good at storing data, running a web server and talking to the network. Each does the part it is good at.
The card is the computer
The Pi has no hard disk. It boots from the microSD card, and everything lives on that card: Raspberry Pi OS, Apache, MariaDB, your databases, your Python files. So:
- Your card is your work. Any Pi 5 in the lab becomes "your" Pi when your card is in it.
- What you install stays installed from lab to lab: you only install LAMP and phpMyAdmin once.
- The clock does not stay right. Set it every lab. See why the clock resets.
- Cutting the power can damage the card. Always shut down first. See repairing corruption.
What runs on it
| Software | Version on Raspberry Pi OS 12 (Bookworm) | Job |
|---|---|---|
| Linux kernel + Debian 12 "Bookworm" | uname -r, cat /etc/os-release | The operating system |
| Apache | 2.4 | Web server on port 80 |
| MariaDB | 10.11 | Database on port 3306 |
| PHP | 8.2 | Runs .php pages and phpMyAdmin |
| Python | 3.11 | Your scripts, pyserial, pymysql, Flask |
Check any version yourself: apache2 -v, mariadb --version, php -v, python3 --version.
Pi 5 things that are different from older Pis
Most guides online are for the Pi 3 or 4. On the Pi 5:
| Topic | Pi 5 | What it means for you |
|---|---|---|
| Power | 5 V 5 A USB-C (27 W official supply) | A phone charger causes undervoltage, crashes and card corruption. |
| Video | micro-HDMI | Normal HDMI cables need an adapter. |
| GPIO chip | New RP1 chip | RPi.GPIO does not work. Use gpiozero (see Python and GPIO). |
| Boot files | /boot/firmware/ | Old guides say /boot/config.txt; on Bookworm it is /boot/firmware/config.txt. |
| Power button | Built in (next to the USB-C port) | One press: shutdown menu on the desktop. Hold: hard power off (avoid). |
| Clock | Has a clock chip, but no battery in the lab | Time is still lost when unplugged. |
Where to go next
- Every lab: Start-of-lab checklist
- Something broke: Quick fixes or Finding out what is wrong