The Raspberry Pi 5 represents a significant leap in performance over its predecessors, boasting several times the speed. For under a few hundred dollars, you can acquire a computer that can handle a multitude of tasks typically reserved for a full-fledged PC, all while consuming minimal power. Additionally, the internet is rich with thrilling projects and tutorials to explore.
This guide will teach you how to set up a Raspberry Pi 5 for optimal performance, maximizing its potential. A key feature to leverage is its capability to connect an SSD via PCI Express.
What You’ll Need
To effectively follow this guide, gather the following components:
- Raspberry Pi 5 (for peak performance, I recommend the 8GB version, though 2GB or 4GB models also suffice).
- A “HAT” (Hardware Attached on Top), which is a daughterboard with an M.2 slot; I opted for the Waveshare POE M.2 HAT, but several alternatives exist.
- A cooling system (often included with the HAT).
- An NVMe-based SSD in M.2 format.
- A MicroSD card with a minimum of 8GB or a USB adapter specifically for the M.2 SSD for installation purposes.
- A Micro HDMI to HDMI cable to connect to a display.
Additionally, you will require a power source. This can be a USB charger capable of supporting USB-PD with a USB-C cable or the official Raspberry Pi charger. If you plan on using USB devices without external power, the charger should support at least 25 watts; otherwise, a 15-watt charger will suffice.
Moreover, a keyboard, mouse, and monitor are essential unless you plan to connect via SSH in Terminal, in which case you’ll be managing everything using text commands. If you intend to use the Raspberry Pi as a server in the future, the peripherals can be temporarily set aside, allowing for SSH or VNC access for adjustments.
While not strictly necessary, I recommend acquiring a case for your Raspberry Pi. This will help keep out dust and minimize static electricity risks while presenting a more polished appearance compared to a bare circuit board.
Installing the Operating System
You have two pathways for installation. If you possess a USB adapter for M.2 SSDs, you can connect your SSD and install the OS directly onto it. If this isn’t available, use a Micro SD card initially and clone the OS to the SSD once your Raspberry Pi is operational.
Start by downloading and installing Raspberry Pi Imager, which simplifies the OS installation process for your mini-computer.
When set up, choose the Raspberry Pi 5 from the device options on the left, select Raspberry Pi OS (64-bit) in the middle, and ensure your new SSD or Micro SD is selected on the right. Be cautious to choose the correct drive to avoid erasing any external hard drives or SSDs connected to your primary computer.
Proceed to click Next and then select Edit Settings. This allows you to input initial settings, such as time zone, network name, and password, making future installations easier. If you have an SSH key and want password-less remote access, you can enable SSH under Services and provide your public key.
After saving, the software will prompt you to confirm the deletion of all content on your selected target once more. After this, it will install the OS and verify its successful setup.
Putting Together the System
As a first step, it’s necessary to assemble the components. This usually doesn’t take long because there aren’t many parts. However, if you’re new to handling computer hardware, there are crucial points to remember.
Above all, prevent static electricity, as it can damage delicate circuitry. Avoid moving around while holding the board, especially on carpeted surfaces. Use the original box or an anti-static bag for transport.
Before handling the board, ensure you ground yourself by making contact with a metal object that’s earthed, like a radiator. A more reliable approach is to use an ESD wrist strap, following the accompanying instructions.
Begin by attaching the four standoffs for the HAT where the SSD will be mounted. These should be included and are commonly made from brass, installed with small screws from the underside of the board.
Next, affix the thermal pads that accompany the cooler to various circuits and install the cooler as per the provided instructions. The cooler attaches with two spring-loaded pins that fit into designated holes on the PCB.
Connect the SSD to the HAT, then carefully secure the HAT in place, ensuring all pins align correctly. If your M.2 HAT comes with a fan, make sure to connect it to the port marked FAN, located beside the outer USB connectors. Gently lower the HAT into position and secure it with the supplied screws.
Attach the short cable tie between the HAT and the designated PCI Express connector on the Raspberry Pi. Carefully loosen the fasteners (the brown plastic component on the Pi, which may vary slightly between different HATs) to insert the ribbon cable. Small white arrows indicate the correct orientation, which you can verify in the accompanying images. Secure the ribbon by pushing the fasteners back into place.
If you have a case, now is the time to install the assembled computer into it.
First Boot
Time to power on the system. Connect the monitor, mouse, and keyboard, then plug the USB cable for power. Note that the Raspberry Pi lacks an on/off switch, so it will boot up immediately (though some Raspberry Pi chargers include a power switch).
If everything went smoothly, you should see the Raspberry Pi OS welcome screen shortly and can set up basic configurations. If you didn’t specify a username and password during installation, make sure to do that now. The system will check for updates and install the latest versions before granting access to the desktop environment.
At this point, you can start using the Raspberry Pi as a basic desktop computer. Firefox and Chromium are pre-installed, and you can install additional software by clicking the Raspberry Pi icon at the top-left corner and choosing Settings > Recommended Software.
Shortcut icons for Bluetooth, Wi-Fi settings, and available updates appear in the top-right corner.
To optimize the SSD’s speed, consider making a minor change via the terminal. Click on the terminal icon in the top-left and type:
sudo nano /boot/firmware/config.txt
Scroll to the end and append the following lines to enable PCIe 3.0:
# Change PCIe speed to gen 3
dtparam=pciex1
dtparam=pciex1_gen=3
Press Ctrl-O, Return, and then Ctrl-X to save and exit. Next, update the BOOT_ORDER line:
BOOT_ORDER=0xf416
Again, press Ctrl-O, Return, and Ctrl-X to save the file. The system will then prioritize booting from the SSD, even with a Micro SD card present.
If you initially installed the OS on a Micro SD card, now is the time to clone it onto the SSD. Execute the following commands one by one in the terminal:
git clone https://github.com/geerlingguy/rpi-clone.git
cd rpi-clone
sudo cp rpi-clone rpi-clone-setup /usr/local/sbin
sudo rpi-clone nvme0n1
Provided the SSD and HAT are connected correctly, the last command will ask for confirmation to erase the target. Upon approval, the command will proceed to copy all contents from the SD card to the SSD.
After completion, shut down the system via Raspberry Pi button > Logout > Shutdown. Remove the Micro SD card and restart by unplugging and plugging in the power cable (or using the switch, if available). If all has gone well, the Raspberry Pi will boot smoothly, benefiting from the enhanced speed of the SSD.
Exciting Additional Accessories
Besides the M.2 SSD cap, numerous other accessories can elevate your Raspberry Pi experience, enabling various applications. Here are a few notable examples:
Power over Ethernet (PoE)
This feature allows your device to be powered via the network cable instead of USB-C. If your home is wired for PoE, connect your Raspberry Pi to an available network socket, eliminating the need for additional power cables. The M.2 cap I chose integrates PoE functionality.
Display Options
A wide variety of screens can be directly connected to the Raspberry Pi. These can range from small information displays to larger touchscreens for interactive applications.
Sensors
Transform your Raspberry Pi into an indoor weather station to monitor air quality. While not the most cost-effective approach, it can be a fascinating project.
Cameras
Another common project is building a DIY surveillance camera that integrates with Home Assistant. You can choose from multiple camera modules, including options with built-in AI capabilities for human recognition.
Sound Cards
Many users turn their Raspberry Pi into a music server connected to a speaker system. Since the Raspberry Pi lacks built-in audio output (aside from HDMI), several “HATs” are available with RCA, 3.5-mm connectors, and optical audio output options. The Raspberry Pi DAC Pro is one example, while simple amplifiers like the Hifiberry Amp4 Pro allow connecting analog speakers directly.
Alternatively, USB sound cards, such as Apple’s USB-C headphone adapter, provide high-quality audio output.
Five Smart Uses for Raspberry Pi 5
Retro Gaming Console
The Raspberry Pi excels as a compact gaming console, emulating classic games from the ’80s and ’90s. It can even emulate newer consoles like the Nintendo GameCube and Wii, though performance may vary. Batocera is a popular platform available as a disk image to write to either Micro SD cards or directly to SSDs with Raspberry Pi Imager. Installation instructions are available here.
Home Automation Server
By installing Home Assistant, the Raspberry Pi 5 becomes an excellent hub for all your smart home devices. Connecting a USB Zigbee radio enables interaction with products from brands like Ikea without the need for their app. The built-in Wi-Fi and Bluetooth features enhance usability. Follow the installation guide here.
AirPlay Receiver for Music Streaming
Stream music to older speakers using Raspberry Pi as an AirPlay receiver. While this doesn’t require a Raspberry Pi 5, it functions well on its predecessors, such as the Raspberry Pi Zero 2 W. You’ll just need a sound card and some terminal commands for setup. Poolside Factory offers a guide—just use the commands in the gray box under Option 2: Airplay 2.
Consider referring to the Shairport-Sync server software documentation for advice on selecting an audio output device, especially if you use a HAT with a DAC.
Router with OpenWrt
If you want to use alternative router firmware but have a router lacking support, consider building your own with Raspberry Pi and OpenWrt. By incorporating an extra USB Ethernet adapter, you can connect one port for WAN (internet) and another for LAN (local network). Home Network Guy has a tutorial video to assist you. You can set up your old router as a Wi-Fi access point since the built-in Wi-Fi in Raspberry Pi isn’t designed for such use. Alternatively, consider using IP Fire—details can be found in this guide.
Experimental Computing Platform
Use Raspberry Pi to learn Linux without risking your primary computer’s setup. Explore coding with Python or experiment with hardware projects controlling LEDs, motors, and more. The Raspberry Pi serves as an excellent platform for experimentation.