Raspberry Pi CM4 Carrier Board for LEGO SPIKE Prime
June 2021

This is the final project for my Microcontrollers Programming Class. My professor gave us an open prompt which is "create something that is useful". With my previous experience and interests in designing LEGO Robotics expansion hardware, I developed a Raspberry Pi CM4 Carrier board specifically for the LEGO SPIKE Prime educational system. In short, this is a slim, self-contained add-on to the SPIKE Prime hub. It gives the educational platform a huge boost in computational power and peripheral connectivity, making it capable of running tasks such as image processing, machine learning, ROS, and more.

The Problem

The LEGO PIME Prime educational system, like its predecessors, is well known with their low level of entry, plug-and-play sensors, reliable actuators, and easy integration with the existing LEGO building system. Because of this, it is used worldwide in high schools and even universities to introduce students to robotics.

At Tufts University, I was the Teaching Assistant for ME35, an introductory robotics class taught by Professor Chris Rogers. In that class students are using a Raspberry Pi 4 in addition to the SPIKE Prime system to add computer vision and artificial intelligence to their robots. Although this system proves to be reliable, I find that a full-size Raspberry Pi is quite a noticeable addition in weight and volume to an existing SPIKE robot. It also contains peripherals, such as the ethernet port, the display port, and USB housings, that are not useful for the particular SPIKE-to-Pi connection. Furthermore, The Raspberry Pi needs a separate portable power supply, which takes up more space on the robot.

Some robots created by students using SPIKE Prime and Raspberry Pi 4

Therefore, I decided to create a custom carrier board for the newest Raspberry Pi compute model, the CM4, as well as an uninterruptable power supply (UPS) circuit, in an effort to create an ultra-slim yet powerful hardware expansion for the LEGO system.

My Solution

The finished CM4 backpack with battery is almost the same size as a bare Raspberry Pi 4 without any battery and power management system. Because of the custom 3D printed casing, it also integrates batter with the existing LEGO system.

My backpack design vs. Raspberry Pi 4

Design Details

After spending a few days learning about the Raspberry Pi compute module, I started designing the central engineering component of this project - the carrier board. Some major components on this 4-layer, 1.2mm PCB are:

  1. USB-C Power Input
  2. BQ25616 - standalone 1 cell LiPo charger IC, capable of passing through 3A to load
  3. TPS61235 - boost converter to 5V, 3A for powering the Raspberry Pi
  4. 50-pin Hirose connectors - this is the standard interfacing connector with the Raspberry Pi CM4
  5. Dual camera connectors
  6. USB 2.0 as host
  7. USB 2.0 as client
  8. Qwiic and Stemma QT-compatible connectors for I2C peripherals
  9. Some standard GPIOs, including two UART interfaces

A full Bill of Materials (BOM) list can be found under the GitHub repo I created for the project.

PCB board layout

I designed the board to be fitted in a 3D-printed case, which protects the board from potential damage while adding LEGO Technic mounting holes on it's four corners. This makes it very easy to

Rendered design from KiCAD (PCB only) and in SolidWorks (with casing)

Manufacturing the board

Since this design involves many components in low-pitch packages, I decided to tryout the assembly service from PCBWay. I ordered 5 completely assembled boards (excluding some through-hole pin headers, which I plan to solder them myself). After a few weeks of waiting, I finally received the assembled PCBs.

Assembled PCB

Assembled PCB With Casing