This cheap official Raspberry Pi upgrade is a game changer
On May 14, 2024, the Raspberry Pi Foundation announced the M.2 HAT+, a board that can be used to add M.2 peripherals such as NVMe storage and AI accelerators to the Raspberry Pi 5.
HAT+ connects to the Raspberry Pi 5 with a flexible flat cable and can transfer data at speeds in excess of 800MB/s. Priced at $12, this is a great, low-cost upgrade that every Raspberry Pi 5 owner should consider purchasing.
The need for M.2 HAT+
For generations, the standard storage options for the Raspberry Pi have been microSD cards and hard drives/SSDs connected using a USB to SATA adapter. MicroSD cards are slow and unreliable, and SATA SSDs, while fast and reliable, take up the USB 3.0 port on the Raspberry Pi.
NVMe SSDs are much faster than SATA SSDs. You can connect them using a USB to M.2 enclosure, but the speed will still be the same as a SATA SSD because USB clogs it. This is why a faster interface is needed.
HAT+ (Hardware Attached on Top Plus) is an enhanced version of the standard HAT. The "Plus" in HAT+ denotes enhancements that improve data transfer speeds and support more peripherals. The Raspberry Pi M.2 HAT+ can provide up to 3 amps of current to connected peripherals. It also has a power LED.
Connect M.2 HAT+ to Raspberry Pi 5
Raspberry Pi 5 has a PCIe (PCI Express) connector on the board. By using FFC (Flexible Flat Cable), you can connect Pi 5 and M.2 HAT+. The FFC powers the board and also transmits data. There is no need to separately power the board. To meet the additional power needs, the official 27W power supply for Raspberry Pi 5 is recommended. FFC is included with the M.2 HAT+.
You can plug an NVMe drive into the M.2 slot. Drives with form factors 2230 (30mm long) and 2242 (42mm) fit the board perfectly. Longer SSDs, although compatible, do not fit on the board. M.2 SATA SSD is not NVMe type and is not compatible.
How fast is M.2 NVMe on Raspberry Pi 5?
Raspberry Pi 5 uses RP1, a new controller chip that handles I/O. It provides more bandwidth and accelerates peripheral throughput. Fast microSD cards can read at 100 MB/s, and SATA SSDs connected with a USB to SATA cable can reach speeds of about 300 MB/s.
However, M.2 NVMe on the HAT+ can read in excess of 400MB/s, making it the fastest storage option for the Pi 5.
M.2 NVMe can perform even faster
Even budget NVMe drives can easily reach speeds of 3GB/s. However, the Pi 5 has a single-lane PCIe 2.0 bus and speeds are limited to 500MB/s. The number of hardware lanes cannot be increased. However, you can change the bus to the PCIe 3.0 standard to provide more bandwidth. This is done by settings inside the configuration file.
Edit files in terminal:
sudo nano /boot/firmware/config.txt
Add a line:
dtparam=pciex1_gen3
Save the file with Ctrl + O and restart Pi 5 to load the new configuration. This will boot the Pi 5's PCIe into Gen 3 mode. How fast will the Pi 5 get? More than double that and it will now reach speeds in excess of 800MB/s. Just a quick note: Gen 3 is not officially supported yet.
Can Pi 5 be booted with an M.2 NVMe SSD?
Have! But first it is necessary to install the operating system. To install an operating system on a microSD card, you will use a card reader. To install the operating system on an NVMe drive, a USB to M.2 adapter is required. However, this accessory is not very popular. You can do without it, especially if you don't install the operating system regularly.
The trick is to install Raspberry Pi OS on the microSD card first. Boot from it, then install the operating system on the NVMe drive using the Raspberry Pi Imager. Once done, remove the microSD card and the Pi 5 will boot from the NVMe SSD.
NVMe speed on Raspberry Pi
The standards put forth by Raspberry Pi often become industry standards. However, the delayed launch of the M.2 HAT+ has spurred third-party development, such as Pimoroni's NVMe Base.
The M.2 HAT+ is designed to mount on the Pi 5 using a 16mm stand. The design looks compact but has just enough space to accommodate the official Pi 5 cooler. A lack of clearance can affect airflow and increase noise, especially when the fan is running at full speed.
Without a cooler, the Pi 5 will experience throttle in less than a minute when the processor is at full throttle. The M.2 HAT+'s design makes it difficult to use anything but a heatsink roughly the size of a full-fledged cooler.
Pi 5 has a much improved processor compared to previous generations of Pi. To get the most out of a fast processor, it's essential to feed it fast data, so M.2 NVMe is the right way forward and the future-proof HAT+ standard is a plus .
You should read it
- How to add an ADC to Raspberry Pi: What you need to know
- Raspberry Pi Zero vs Model A and B, how are they different?
- What is the Raspberry Pi and how is the Raspberry Pi used?
- How to start Raspberry Pi 3 from USB
- Why should people try Raspberry Pi 4?
- Learn Pi Imager, How to Use Raspberry Pi Imager
- How to use Raspberry Pi Imager to install Raspberry Pi OS
- 5 ways to make good use of Raspberry Pi 4
- 7 best Raspberry Pi 4 cases
- How to set up Raspberry Pi
- What is the difference between Raspberry Pi 4 and other models?
- What's New in Raspberry Pi OS 11?
Maybe you are interested
How to use Raspberry Pi 400 as a laptop
Raspberry Pi Pico 2 W Launched: Wireless-Enabled Microcontroller Board for Just $7
How to build Android TV Box with Raspberry Pi 4
Raspberry Pi Touch Display Releases New Version After 9 Years
6 ideas to utilize old Raspberry Pi
Raspberry Pi AI Kit: Bring AI to Raspberry Pi