Raspberry Pi Compute Module 5 Road Test: A First-Timer’s Look from an Intermediate User

View table of contents ...  

RoadTest: Test out the Raspberry Pi Compute Module 5 Development Kit!

Author: taifur

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: Raspberry Pi 5, Compute Module 4, Radxa CM5, Orange Pi CM5, NVIDIA Jetson Orin Nano

What were the biggest problems encountered?: I did not face any serious issues while working with it. However, my Wi-Fi disconnected several times during testing, and it sometimes took longer than usual to reconnect.

Detailed Review:

Introduction

A big thank-you to element14 and Raspberry Pi for giving me the opportunity to road test the Compute Module 5. I’ve been using Raspberry Pi hardware since the very first Raspberry Pi 1 and have worked with almost every model since, but this is my first time using a Compute Module, so I’m approaching it with fresh eyes. I’m an intermediate user rather than an embedded systems expert, so this review comes from the perspective of an experienced hobbyist exploring what the CM5 offers. The review kit was supplied by element14 at no cost, but that won’t influence what I write: you’ll get my honest findings, good and bad.

What I Received

The kit arrived in a medium-sized brown box, well packed and undamaged. Inside, I found two items: the official Raspberry Pi Compute Module 5 Development Kit in its own retail box, and a separate box containing the official 27W USB-C power supply with an Indian (Type C) plug.

Opening the development kit box, I found everything neatly organized, with each part packed separately. The most important item, the Raspberry Pi Compute Module 5 itself, came in the smallest box in the kit, which was in Raspberry Pi Color.

I took everything out of the box, and the kit includes the following items:

The development kit includes its own official Raspberry Pi 27W USB-C power supply with a UK plug. Since I’m in Bangladesh, element14 kindly sent an extra 27W power supply with a 2-pin Type-C plug, which fits local sockets directly. Thanks to element14 for this thoughtful addition.

Every item in the kit came in its own separate box, so I opened them one by one and took out all the components.

About the Compute Module 5

Unlike a standard Raspberry Pi, a Compute Module has no ports of its own. It packs the processor, RAM, and optional storage onto a compact board that plugs into a carrier board, which is what the IO Board in this kit is for. This makes it popular with people building their own products or custom devices.

The Raspberry Pi Compute Module 5 (CM5) is a small module made for building embedded products and custom devices. It takes the power of the Raspberry Pi 5 and packs it into a board that measures just 55 x 40 x 4.7 mm. It uses the same Broadcom BCM2712 processor as the Pi 5, with a quad-core 64-bit Arm Cortex-A76 CPU and an 800 MHz VideoCore VII GPU. It can drive two 4K displays at 60 Hz over HDMI.

The development kit includes the CM5 module, the Compute Module 5 IO Board, and the accessories needed to start prototyping a product design.

How it differs from the CM4

The CM5 is mostly compatible with the CM4 in size and connections, but it has a few changes:

  • The pinout of the two 100-pin connectors was changed to make room for two USB 3.0 ports and other features.
  • The connectors were tested for higher current.
  • The DSI and CSI signals now share the same pins, so you can connect either a camera or a display.

Memory and storage

The CM5 uses ECC memory and comes with 2, 4, 8, or 16 GB of RAM. Storage options are 16, 32, or 64 GB of eMMC flash. There is also a CM5 Lite version with no onboard storage, which suits cost-sensitive projects.

Connectivity

The CM5 has Gigabit Ethernet with Precision Time Protocol support. It also offers an optional, fully certified Wi-Fi and Bluetooth module, with a choice between the PCB trace antenna and an external antenna.

The variant I’m testing

The module in my kit is the 4 GB RAM, 32 GB eMMC model, with Wi-Fi and Bluetooth.

The Compute Module 5 IO Board

The Compute Module 5 IO Board is the official carrier board for the CM5. Since the module has no ports of its own, this 160 mm × 90 mm board provides the connectors you would expect on a regular Raspberry Pi 5. It accepts every CM5 variant, including the Lite version, which boots from the microSD socket on the board. Its main features include Gigabit Ethernet, dual HDMI outputs, USB 3.0 ports, and an M.2 slot that supports NVMe SSDs in sizes from 2230 to 2280 over a single PCIe Gen 2 lane. A 40-pin GPIO header and HAT+ mounting holes allow expansion, and there is also a PWM fan header and an RTC battery socket. The board is powered through USB-C at 5 V and 5 A, and it has a power button for turning the module on and off. Raspberry Pi also offers the design files in KiCad format, so the board can serve as a starting point for your own carrier board.

Assembling the CM5 with the IO Board

Coming from standard Raspberry Pi boards, this was the first step that felt completely new to me. The CM5 has no ports to work with, so before it can do anything, it has to be mounted on the IO Board.

Opening the IO Case

To install the Compute Module, I first had to open the IO Case. The case is held together by four screws, two on each side. I removed all four screws and began to separate the two parts of the case.

I did not expect the top part to have a fan attached to it. The fan’s cable is plugged into the IO Board, and the IO Board is screwed to the bottom part of the case. Because of this, the two halves are connected by the fan cable. I almost pulled the cable out, and could have broken the connector, as I was pulling the two parts apart. But I was fortunate enough that it did not happen. 

Tip: After removing the screws, lift the top of the case slowly. The fan cable connects the top part to the IO Board, so check it before pulling the two halves apart.

Installing the Compute Module

After opening the case, I picked up the Compute Module to plug it into the IO Board. At this point I was confused about which way it should face. I could not find any marking on the IO Board or on the module to show the direction.

Before plugging it in, I watched a YouTube video to check the correct orientation. Then I placed the module the right way round, lined it up with the connectors, and pushed down gently. I heard a click, which told me the module was seated properly.

Attaching the Heatsink

Next, I attached the heatsink. The heatsink kit comes with three thermal pads, already stuck to the heatsink with adhesive. They sit on the three chips that get hot when the module is running. The kit also includes four nylon washers and four screws.

I placed the washers between the IO Board and the Compute Module, lining each one up with a screw hole. Then I put the heatsink on top of the module. This time I was not confused about the direction, because the heatsink has a cut-out for the antenna.

After placing the heatsink, I realized the four screws go in from the bottom of the IO Board. This meant I had to take the IO Board out of the case first. I removed the screws holding the board in the case, lifted the board out, and put in the four heatsink screws. I tightened them, then fixed the IO Board back into the case.

Installing the Antenna

The development kit includes a Wi-Fi antenna with an SMA connector on one end and an IPEX connector on the other. The IO Case has a hole for the antenna.

I placed the antenna through the hole in the case and fixed the SMA connector in place with its nut. Then I plugged the IPEX connector into its socket on the Compute Module.

The IO Board has a socket for a real-time clock (RTC) battery. The RTC keeps the date and time running when the board is powered off. The kit does not include a battery, but I had a Panasonic CR2032 coin cell in my bucket, so I placed it into the RTC battery connector on the IO Board.

Installing the Operating System

Next, I installed the operating system on the Compute Module. I followed the official Raspberry Pi guide for Compute Modules, and the process went smoothly. I had no difficulties and no driver problems, and I was able to install the latest Raspberry Pi OS successfully using my Windows 11 Computer.

Official Compute Module guide: https://www.raspberrypi.com/documentation/computers/compute-module.html

Tip: Compute Modules are flashed differently from a normal Pi, since there is no SD card slot on a module with eMMC. Read the official guide fully before you start, especially the step that puts the module into flashing mode by shorting the pin headers on the IO board.

First Power-On

With the OS installed, it was time to power on the Pi. I connected a USB keyboard and mouse to the IO Board and plugged an HDMI display into the HDMI0 port. Finally, I connected the power supply.

The board turned on as soon as I connected the power, without me pressing the power button on the front of the IO Board. Later, I shut it down and left the power supply connected. When I pressed the power button, the board turned on again.

While connecting the HDMI cable, I made a mistake. I accidentally plugged the HDMI output of my desktop PC into the HDMI0 port of the IO Board. Luckily, it did not harm the board.

First-Boot Checks

I turned on the CM5 by pressing the power button. It took about 18 seconds to boot fully into the operating system. The Wi-Fi connected automatically, because I had set up the network details in Raspberry Pi Imager when installing the OS.

Next, I updated the system, as I usually do on any Raspberry Pi, with these commands:

sudo apt update
sudo apt full-upgrade -y

After the update finished, I rebooted the system with sudo reboot. Then I ran uname -a to check the kernel and OS version. The result is shown in the screenshot below.

The, uname -a showed that the system is running a 64-bit (aarch64) Linux kernel, version 6.18.60 with the Raspberry Pi 2712 build, dated 3 November 2026. The "2712" in the name refers to the Broadcom BCM2712, the same chip family used in the Raspberry Pi 5.

To make sure the module matched the variant I was sent, I checked the hardware from the terminal.

The lscpu showed four Arm Cortex-A76 cores, one thread per core. The CPU runs between 1.5 GHz and a maximum of 2.4 GHz, which matches the official specification. At the moment of the screenshot, the CPU was running at about 62% of its maximum speed, because the system was idle and the frequency scales with load. The caches are 256 KiB of L1 data and 256 KiB of L1 instruction cache in total, 2 MiB of L2, and 2 MiB of L3.

The free -h command reported [X] GB of RAM in total, which fits the 4 GB model, since a little memory is always reserved by the system.

The lsblk and df -h commands showed the eMMC storage as [X] GB in total, with [X] GB free after installing the OS. This matches the 32 GB eMMC variant.

Finally, I checked the temperature and power status. The idle temperature was 42.8 °C with the official heatsink, and vcgencmd get_throttled returned throttled=0x0. This means there were no undervoltage or throttling events so far.

Summary

Check Result Meaning
CPU 4 × Cortex-A76, up to 2.4 GHz Matches the Pi 5 family
RAM 4.0 GiB Matches the 4 GB variant
eMMC 29.1 GiB Matches the 32 GB variant
Free space 20 GB Plenty for testing
Idle temperature 42.8 °C Good for idle with a passive heatsink
Throttling 0x0 Clean, and the Type C power supply is working well

Testing Bluetooth and Video Playback

Next, I tested Bluetooth and basic media playback. I paired my Bose 700 Bluetooth headphones with the CM5, and they connected without any problem. Then I opened YouTube in the browser and played a video through the headphones. Everything worked well, with no issues during connection.

To measure playback, I opened "Stats for nerds." The video was a 4K HDR 60 fps nature video, but the browser played it at 1920×1080 at 60 fps, in a 1337×752 window. The stream used the H.264 (avc1) codec at about 13 Mbps, and the buffer stayed healthy at nearly 13 seconds.

In total, 737 of 19,411 frames were dropped, which is about 3.8%. At 60 fps, that is roughly 5 minutes and 20 seconds of playback. In normal viewing, the video and audio stayed in sync and I did not notice any serious problems, though some dropped frames are expected at this rate.

Thermal Test

To check how the CM5 handles heat, I used stress-ng to load all four CPU cores for 10 minutes. I logged the temperature and CPU clock speed every two seconds. The room temperature was 26 °C, and I used the official CM5 heatsink with the case fan.

The first reading was 51.6 °C. Over the first five minutes, the temperature rose steadily and then levelled off at about 67 °C. The highest reading was 68.6 °C, reached after about 7 minutes. The CPU stayed at its full 2.4 GHz for the entire 10-minute test, so there was no thermal throttling.

When the test ended, the clock dropped to its idle speed of 1.5 GHz and the temperature fell quickly. It was about 60 °C after the first minute, 52 °C after about 4 minutes, and settled near 47.7 °C about 12 minutes after the load stopped.

Key numbers

Measurement Result
Idle temperature (earlier check) 42.8 °C
First log reading 51.6 °C
Plateau under load about 67 °C
Peak temperature 68.6 °C
Clock under load 2.4 GHz for the whole test
Clock at idle 1.5 GHz
Temperature 12 minutes after load about 47.7 °C

Thermal Test with CPU and Memory Load

For the second test, I added memory stress to the CPU load, again for about 10 minutes, and logged the temperature and clock speed every two seconds.

This run started from a warmer board than a cold start, at 47.7 °C, with the CPU at its idle speed of 1.5 GHz. When the load began, the clock jumped to 2.4 GHz and stayed there for the whole test. The temperature rose steadily over about five minutes and then levelled off at roughly 67 °C. The highest reading was 68.6 °C, and the CPU did not throttle at any point.

After the load stopped, the temperature fell to about 59 °C within a minute and to about 49 °C after ten minutes.

Adding memory stress made almost no difference to the temperature. The CPU-only test also peaked at 68.6 °C and levelled off at about the same level.

Storage Test: eMMC

This is where the CM5 differs most from a normal Pi, since your OS runs from eMMC instead of an SD card.

The module has 32 GB of onboard eMMC, so I tested its speed with fio. I used direct I/O to bypass the Linux cache, and ran four tests on the root filesystem: 1 MB sequential read and write, and 4 KB random read and write. Each test used one thread with a queue depth of one, and no errors were reported.

Sequential reads reached 315 MiB/s (330 MB/s), and sequential writes reached 110 MiB/s (115 MB/s). Reads were about three times faster than writes, which is normal for eMMC. For small 4 KB operations, random reads reached 44.7 MiB/s (46.8 MB/s) at about 11,400 IOPS, and random writes reached 60.1 MiB/s (63.1 MB/s) at about 15,400 IOPS. The average latency was about 87 microseconds for random reads and 64 microseconds for random writes.

These results are close to the figures other CM5 testers have reported for the same 32 GB eMMC. In practice, the module boots and runs the desktop quickly, and the speed is much better than I would expect from a typical SD card, though I have not measured an SD card myself.

Results at a glance

Test Speed IOPS Avg latency
Sequential read (1 MB) 315 MiB/s (330 MB/s) 315 3.17 ms
Sequential write (1 MB) 110 MiB/s (115 MB/s) 109 9.1 ms
Random read (4 KB) 44.7 MiB/s (46.8 MB/s) 11,400 87 µs
Random write (4 KB) 60.1 MiB/s (63.1 MB/s) 15,400 64 µs

Wi-Fi Signal and Stability

I was not fully satisfied with the Wi-Fi performance. When connected to my home router, the CM5 disconnected from the network several times.

To check the signal strength, I connected to my iPhone's hotspot instead and measured it with the iw dev wlan0 link command. From a distance of 6 feet, the signal level was about -56 dBm. At 12 feet, it was about -64 dBm. These are fair readings that are usable for normal tasks, but the signal drops noticeably as the distance increases.

Accessing the GPIO Header

In this stage, I want to connect some external sensors using the GPIO header. For my first GPIO experiment, I opened the top cover of the IO Board case to reach the GPIO header. On the IO Board, the header is labelled J8. Unlike a standard Raspberry Pi, it has no pin markings at all, and not even a pin 1 indicator.

I opened the IO Board datasheet, but it does not show the pin mapping directly either. I found pin 1 in the mechanical layout drawing, where it is marked with a square pad. I then found the pinout in the schematic.

For a beginner, this is hard. Wiring a header with no labels invites mistakes, and a wrong connection could damage the board. The IO Board has enough free space for silkscreen markings, so labelling pin 1, and ideally the pin numbers or functions, would be a simple improvement.

Testing I2C Sensor

For my next experiment, I connected an I2C sensor to the GPIO header. I used the default I2C pins on the header and wired a SparkFun CCS811/BME280 Environmental Combo sensor to them, using a breadboard and jumper wires.

I2C is turned off by default, so I first enabled it from the configuration options.

After that, I scanned the I2C bus with this command:

sudo i2cdetect -y 1

The scan showed two devices at addresses 0x5B and 0x77. This matches the usual address of the CCS811 air quality sensor on the SparkFun Environmental Combo board, so the wiring was correct, and the CM5 could talk to the sensor on the first try. Turning on I2C was the only setting I had to change.

To read the sensors, I created a Python virtual environment and activated it. Inside it, I installed the libraries for the CCS811 and the BME280. I then ran a sample Python script for each sensor separately, first for the CCS811 and then for the BME280. Both worked without any issues.

import time, board, csv
import adafruit_ccs811

i2c = board.I2C()
ccs = adafruit_ccs811.CCS811(i2c, address=0x5B)

with open("ccs811_log.csv", "a", newline="") as f:
    w = csv.writer(f)
    w.writerow(["time", "eco2_ppm", "tvoc_ppb"])
    while True:
        if ccs.data_ready:
            w.writerow([time.strftime("%H:%M:%S"), ccs.eco2, ccs.tvoc])
            f.flush()
        time.sleep(10)

import time
import board
import adafruit_bme280.basic as adafruit_bme280

i2c = board.I2C()
bme = adafruit_bme280.Adafruit_BME280_I2C(i2c, address=0x77)

for i in range(10):
    print(f"Temperature: {bme.temperature:.1f} C   "
          f"Humidity: {bme.relative_humidity:.1f} %   "
          f"Pressure: {bme.pressure:.1f} hPa")
    time.sleep(2)

Combined:

import time, board, csv
import adafruit_ccs811
import adafruit_bme280.basic as adafruit_bme280

i2c = board.I2C()
ccs = adafruit_ccs811.CCS811(i2c, address=0x5B)
bme = adafruit_bme280.Adafruit_BME280_I2C(i2c, address=0x77)

print("Starting... press Ctrl+C to stop")

with open("sensor_log.csv", "a", newline="") as f:
    w = csv.writer(f)
    w.writerow(["time", "temp_c", "humidity_pct", "pressure_hpa", "eco2_ppm", "tvoc_ppb"])
    while True:
        t = time.strftime("%H:%M:%S")
        temp = bme.temperature
        hum = bme.relative_humidity
        pres = bme.pressure
        if ccs.data_ready:
            eco2, tvoc = ccs.eco2, ccs.tvoc
        else:
            eco2, tvoc = "", ""
        print(f"{t}  {temp:.1f} C  {hum:.1f} %  {pres:.1f} hPa  eCO2: {eco2} ppm  TVOC: {tvoc} ppb")
        w.writerow([t, temp, hum, pres, eco2, tvoc])
        f.flush()
        time.sleep(10)

Testing the Grove DHT11 Temperature and Humidity Sensor

Next, I connected a Grove DHT11 temperature and humidity sensor to the GPIO header. Unlike the CCS811 and BME280 sensors, which use I2C, the DHT11 sends its data over a single signal wire, so it needs only one GPIO pin, plus power and ground.

Wiring

I connected the sensor with jumper cable and wires, with the board powered off. The header has no pin markings, so I counted from the square pad of pin 1 and checked the pin numbers against the schematic.

Sensor wire IO Board header pin
VCC (red) Pin 1 (3.3 V)
GND (black) Pin 9 (Ground)
SIG (yellow) Pin 7 (GPIO 4)

I used the same Python virtual environment approach as for the other sensors, and installed Adafruit's DHT library:

pip install adafruit-circuitpython-dht

The tutorial I followed also told me to install a package called libgpiod2, but my system could not find it. The package name is different on newer versions of Raspberry Pi OS, so I searched for the right name with apt-cache search libgpiod. [Add: I then installed X, or I found the script worked without it.]

Reading the sensor

I used this short script, which reads the temperature and humidity every three seconds:

import time
import board
import adafruit_dht

dht = adafruit_dht.DHT11(board.D4)

while True:
    try:
        t = dht.temperature
        h = dht.humidity
        print(f"Temperature: {t} C   Humidity: {h} %")
    except RuntimeError as e:
        print("Read error:", e.args[0])
    except Exception as e:
        dht.exit()
        raise e
    time.sleep(3)

The sensor worked. [Add the readings you saw, for example: it reported about X °C and X % humidity.] Occasional read errors are normal for the DHT11 but I did not receive any error, which is a slow and timing-sensitive sensor, and the script simply tries again.

The Grove DHT11 worked on the CM5 without any issues.

Compatibility note: Many tutorials for the DHT11 were written for older Raspberry Pi boards and older OS versions, and some suggest libraries that don't work on the Pi 5 family, which the CM5 shares. The CM5 itself was not the problem. Anyone following an older tutorial may need to update package names and use the newer Adafruit library.

Project: A Home Environment Monitor on the CM5

To finish my road test, I wanted to build something I would actually use. I had three sensors connected to the CM5 from my earlier GPIO experiments, so I combined them into a small environment monitor that logs the data and shows it on a web dashboard.

The idea

The CM5 reads the sensors every 10 seconds, saves the readings in a database, and serves a web page with live values and charts. The page can be opened from any phone or computer on my home network.

[Diagram: BME280 + CCS811 (I2C) and DHT11 (GPIO 4) → Python collector → SQLite database → Flask web dashboard]

The monitor uses these parts:

Part What it does
BME280 Temperature, humidity, and pressure (I2C, address 0x77)
CCS811 Air quality: eCO2 and TVOC (I2C, address 0x5B)
Grove DHT11 Temperature and humidity (GPIO 4)
CM5 CPU sensor The board's own temperature
Python collector Reads all sensors and saves the data
SQLite Stores the history in one file
Flask Serves the dashboard

I also log the CM5's own CPU temperature next to the room readings, so I can see how the board's heat affects the sensors.

The collector

The collector is a short Python script that runs in the virtual environment I created earlier. It reads each sensor, adds a row to the database, and prints the values. A failed read is saved as an empty value, so a sensor error never stops the logging.

import time
import sqlite3
import board
import adafruit_ccs811
import adafruit_dht
import adafruit_bme280.basic as adafruit_bme280

# Change "taifur" to your username if it is different
DB = "/home/taifur/envmonitor/data.db"
INTERVAL = 10          # seconds between readings
CCS_ADDR = 0x5B
BME_ADDR = 0x77
CCS_RETRY_EVERY = 60   # seconds between CCS811 restart attempts

i2c = board.I2C()


# ---------- CCS811 helpers ----------

def ccs_soft_reset():
    """Software reset of the CCS811 (sequence from its datasheet).
    Please check these bytes against the datasheet."""
    try:
        while not i2c.try_lock():
            pass
        i2c.writeto(CCS_ADDR, bytes([0xFF, 0x11, 0xE5, 0x72, 0x8A]))
    except Exception as e:
        print("CCS811 soft reset failed:", e)
    finally:
        try:
            i2c.unlock()
        except Exception:
            pass
    time.sleep(1)


def start_ccs(tries=3):
    """Try to start the CCS811. Return None if it will not start."""
    for n in range(tries):
        try:
            return adafruit_ccs811.CCS811(i2c, address=CCS_ADDR)
        except Exception as e:
            print("CCS811 start failed, try", n + 1, ":", e)
            ccs_soft_reset()
            time.sleep(3)
    return None


# ---------- Other helpers ----------

def cpu_temp():
    with open("/sys/class/thermal/thermal_zone0/temp") as f:
        return int(f.read()) / 1000


def start_bme():
    try:
        return adafruit_bme280.Adafruit_BME280_I2C(i2c, address=BME_ADDR)
    except Exception as e:
        print("BME280 start failed:", e)
        return None


# ---------- Setup ----------

db = sqlite3.connect(DB)
db.execute(
    """CREATE TABLE IF NOT EXISTS readings (
        ts INTEGER,
        bme_temp REAL, bme_hum REAL, bme_press REAL,
        eco2 INTEGER, tvoc INTEGER,
        dht_temp REAL, dht_hum REAL,
        cpu_temp REAL)"""
)
db.commit()

bme = start_bme()
ccs = start_ccs()
dht = adafruit_dht.DHT11(board.D4)

if ccs is None:
    print("CCS811 not available. Logging the other sensors only.")
last_ccs_try = time.time()
ccs_errors = 0

print("Collector running. Press Ctrl+C to stop.")


# ---------- Main loop ----------

try:
    while True:
        ts = int(time.time())

        # BME280
        bt = bh = bp = None
        try:
            if bme is None:
                bme = start_bme()
            if bme is not None:
                bt = bme.temperature
                bh = bme.relative_humidity
                bp = bme.pressure
        except Exception as e:
            print("BME280 error:", e)

        # CCS811 (restart it if it is missing or keeps failing)
        eco2 = tvoc = None
        if ccs is None and time.time() - last_ccs_try > CCS_RETRY_EVERY:
            print("Trying to restart the CCS811...")
            ccs = start_ccs(tries=1)
            last_ccs_try = time.time()
        if ccs is not None:
            try:
                if bt is not None and bh is not None:
                    try:
                        ccs.set_environmental_data(int(bh), bt)
                    except Exception:
                        pass   # not critical
                if ccs.data_ready:
                    eco2 = ccs.eco2
                    tvoc = ccs.tvoc
                ccs_errors = 0
            except Exception as e:
                print("CCS811 error:", e)
                ccs_errors += 1
                if ccs_errors >= 3:
                    print("CCS811 failed 3 times, will restart it.")
                    ccs = None
                    last_ccs_try = 0
                    ccs_errors = 0

        # DHT11 (read errors are normal for this sensor)
        dt = dh = None
        try:
            dt = dht.temperature
            dh = dht.humidity
        except RuntimeError:
            pass
        except Exception as e:
            print("DHT11 error:", e)

        # Save the row
        db.execute(
            "INSERT INTO readings VALUES (?,?,?,?,?,?,?,?,?)",
            (ts, bt, bh, bp, eco2, tvoc, dt, dh, cpu_temp()),
        )
        db.commit()
        print(
            time.strftime("%H:%M:%S"),
            "BME:", bt, bh, bp,
            "CCS:", eco2, tvoc,
            "DHT:", dt, dh,
        )
        time.sleep(INTERVAL)

except KeyboardInterrupt:
    print("Stopping.")
finally:
    try:
        dht.exit()
    except Exception:
        pass
    db.close()

A problem along the way

At first, the collector stopped with an error from the CCS811: "Device returned an error! Try removing and reapplying power." The sensor had worked in my earlier test scripts, so the chip was probably stuck in an error state. I shut down the CM5, unplugged the power for a few seconds, and started it again. I then changed the collector to retry the CCS811, reset it if needed, and keep logging the other sensors if it will not start. After that, it worked perfectly.

The dashboard

The web dashboard is a small Flask application. It shows the latest value of each sensor as a card, followed by four charts in two rows: temperature (BME280, DHT11, and the CM5 CPU), humidity, air quality, and pressure. A drop-down menu switches the range between 1 hour and 3 days, and the page refreshes itself every 15 seconds. I can open it from my phone at the CM5's IP address on port 5000. The charts are drawn in the browser by the Chart.js library, loaded from the internet, so the PC or phone needs a connection.

import time
import sqlite3
from flask import Flask, jsonify, request

# Change "taifur" to your username if it is different
DB = "/home/taifur/envmonitor/data.db"

app = Flask(__name__)


@app.route("/api/data")
def data():
    hours = float(request.args.get("hours", 1))
    since = int(time.time() - hours * 3600)
    db = sqlite3.connect(DB)
    rows = db.execute(
        "SELECT * FROM readings WHERE ts > ? ORDER BY ts",
        (since,),
    ).fetchall()
    db.close()
    cols = [
        "ts", "bme_temp", "bme_hum", "bme_press",
        "eco2", "tvoc", "dht_temp", "dht_hum", "cpu_temp",
    ]
    return jsonify([dict(zip(cols, r)) for r in rows])


PAGE = """<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CM5 Environment Monitor</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1"></script>
<style>
body {
  font-family: sans-serif;
  margin: 20px;
  max-width: 1200px;
}
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}
.card {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 16px;
}
.card b {
  font-size: 1.4em;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.box {
  position: relative;
  height: 300px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px;
}
@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
</style>
</head>
<body>
<h2>CM5 Environment Monitor</h2>
Range:
<select id="range" onchange="load()">
  <option value="1">1 hour</option>
  <option value="6">6 hours</option>
  <option value="24">24 hours</option>
  <option value="72">3 days</option>
</select>
<div class="cards" id="cards"></div>
<div class="grid">
  <div class="box"><canvas id="c1"></canvas></div>
  <div class="box"><canvas id="c2"></canvas></div>
  <div class="box"><canvas id="c3"></canvas></div>
  <div class="box"><canvas id="c4"></canvas></div>
</div>
<script>
let charts = {};

function chart(id, labels, sets, title) {
  if (charts[id]) charts[id].destroy();
  const datasets = sets.map(function (s) {
    return {
      label: s[0],
      data: s[1],
      pointRadius: 0,
      borderWidth: 1.5,
      spanGaps: true
    };
  });
  charts[id] = new Chart(document.getElementById(id), {
    type: 'line',
    data: { labels: labels, datasets: datasets },
    options: {
      responsive: true,
      maintainAspectRatio: false,
      animation: false,
      plugins: { title: { display: true, text: title } }
    }
  });
}

function fmt(v, unit) {
  if (v == null) return '-';
  return v.toFixed(1) + unit;
}

function card(name, value) {
  return '<div class="card">' + name +
         '<br><b>' + value + '</b></div>';
}

async function load() {
  const h = document.getElementById('range').value;
  const resp = await fetch('/api/data?hours=' + h);
  const d = await resp.json();
  if (!d.length) return;

  const L = d.map(function (r) {
    return new Date(r.ts * 1000).toLocaleTimeString();
  });
  const col = function (name) {
    return d.map(function (r) { return r[name]; });
  };
  const last = d[d.length - 1];

  const eco2 = last.eco2 == null ? '-' : last.eco2 + ' ppm';
  const tvoc = last.tvoc == null ? '-' : last.tvoc + ' ppb';
  const dht = fmt(last.dht_temp, ' °C') + ' / ' +
              fmt(last.dht_hum, ' %');

  document.getElementById('cards').innerHTML =
    card('BME280 temp', fmt(last.bme_temp, ' °C')) +
    card('BME280 humidity', fmt(last.bme_hum, ' %')) +
    card('Pressure', fmt(last.bme_press, ' hPa')) +
    card('eCO2', eco2) +
    card('TVOC', tvoc) +
    card('DHT11', dht) +
    card('CM5 CPU', fmt(last.cpu_temp, ' °C'));

  chart('c1', L, [
    ['BME280', col('bme_temp')],
    ['DHT11', col('dht_temp')],
    ['CM5 CPU', col('cpu_temp')]
  ], 'Temperature (°C)');

  chart('c2', L, [
    ['BME280', col('bme_hum')],
    ['DHT11', col('dht_hum')]
  ], 'Humidity (%)');

  chart('c3', L, [
    ['eCO2 (ppm)', col('eco2')],
    ['TVOC (ppb)', col('tvoc')]
  ], 'Air quality (CCS811)');

  chart('c4', L, [
    ['Pressure', col('bme_press')]
  ], 'Pressure (hPa)');
}

load();
setInterval(load, 15000);
</script>
</body>
</html>"""


@app.route("/")
def index():
    return PAGE


if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000)

After 10 minutes of running:

What this showed about the CM5

This project used the same Python, I2C, and GPIO tools as on any other Raspberry Pi, and the CM5 handled it without any trouble. The load was very small, and it ran for a long time without any crashes. The problems I hit were not caused by the CM5 itself: an unmarked GPIO header, old GPIO libraries that don't support the Pi 5 family's I/O chip, and a sensor that needed a power cycle. For a project like this, I would happily choose a Compute Module over a normal Raspberry Pi if I were building a product with a custom carrier board.

Who Should Choose the CM5 (my opinion)?

After assembling, testing, and building a project on the CM5, my view is that the right choice depends on how it will be used.

The CM5 with the IO Board: a good fit for servers and gateways

I think the CM5 with the IO Board suits always-on devices such as a small home server, a network gateway, or a data logger like my environment monitor. My reasons are:

  • Reliable storage. The onboard eMMC removes the microSD card, which is the most common failure point in Raspberry Pi systems that run all the time. My eMMC read about 330 MB/s and write about 115 MB/s, which is plenty for this kind of work.
  • Room to grow. The M.2 slot on the IO Board takes an NVMe SSD without extra parts, which is useful for a server that needs more or faster storage.
  • Networking. The board has Gigabit Ethernet, and the external antenna improves the Wi-Fi options when the board sits in a metal case. 
  • Stable under load. In my 10-minute stress tests, the CPU held 2.4 GHz and peaked at 68.6 °C with no throttling.
  • Ready-made extras. The 40-pin GPIO header, the power button, and the RTC battery connector made it easy to add sensors and keep the time.

The CM5 alone: a good fit for commercial products

The CM5 on its own is aimed at people building a product with their own carrier board. I haven't designed a carrier board for this test, so this is based on the module's design and the documentation, not on my own build. The reasons I think it suits that job are:

  • Compact size. The module measures only 55 × 40 × 4.7 mm, so it fits into small products.
  • A custom board around it. A designer can add only the connectors and parts the product needs, and leave out the rest, which saves space and cost.
  • Flexible memory and storage. There are several RAM and eMMC sizes, plus a Lite version without eMMC for cost-sensitive designs.
  • A reference design. The IO Board works as a starting point, and Raspberry Pi has published its design files, so a designer doesn't start from nothing. 
  • Familiar software. The Raspberry Pi OS and the same tools mean developers don't need to learn a new platform.
  • Product lifetime. Long-term production commitment for the CM5, since it matters for a product.

Who may prefer the Pi 5

For a beginner, or for a general-purpose board that is simple to set up, the standard Raspberry Pi 5 is the easier and probably cheaper choice. The CM5 needs more assembly, and as I found, the IO Board's GPIO header has no pin markings.

The Conclusion

I started this road test as an intermediate Raspberry Pi user who had never used a Compute Module. After assembling it, installing the OS, testing it, and building an environment monitor on it, I came away impressed.

The CM5 was stable and fast in my tests. Boot time of about 18 seconds, no throttling at 2.4 GHz with a peak of 68.6 °C, eMMC reading at about 330 MB/s. The monitor ran without a crash, using the same Python, I2C, and GPIO tools as any other Raspberry Pi.

For a project like mine, the CM5 with the IO Board has some real advantages over a standard Pi 5. The built-in eMMC removes the need for a microSD card, which is more reliable for a device that runs all the time. The M.2 slot on the IO Board takes an NVMe drive without extra parts. The external antenna also helps if the board goes in a metal case. The IO Board, like the Pi 5, includes a power button and an RTC battery connector.

The CM5 also has drawbacks. It takes more steps to assemble, and the unlabeled GPIO header was hard for a beginner.

Anonymous