LEGO Technic meets Raspberry Pi with the Build HAT

A new official Raspberry Pi expansion board is introduced today. The Built HAT provides four connectors for LEGO Technic motors and sensors from the SPIKE Portfolio, as well as an 8V DC jack to power both the Raspberry Pi and LEGO motors, sensors, LED matrix, and more.

Designed in collaboration with LEGO Education, the Build HAT features the Raspberry Pi RP2040 dual-core ARM Cortex M0+ MCU for I/O control, and will enable more complex models benefiting from more powerful Broadcom BCM2xxx processors, as well as a Python library for easy programming.

Raspberry Pi Build HATBuild HAT key features and specifications:

  • MCU – Raspberry Pi RP2040 microcontroller for low-level control of LEGO Technic devices
  • 4x LPF2 connectors for LEGO Technic motors and sensors included in the SPIKE Portfolio
  • 40-pin GPIO header for connection to Raspberry Pi 4 Model B, 3B+, 3B, 3A+, or Pi Zero family (Raspberry Pi 400 not supported)
  • Misc – 2x Status LED
  • Power Supply  – 7.2V to 8.5V DC via power barrel to power both the Build HAT and Raspberry Pi
  • Dimensions – Raspberry Pi HAT compatible, space for breadboard, opening for camera flat cable
Build HAT LEGO Technic Breadboard
Build HAT connected to Raspberry Pi board with tall headers, two LEGO Technic motors, and fitted with a breadboard

To get started with the Build HAT, you’ll need one of the supported Raspberry Pi boards, a microSD card with Raspberry Pi OS, a 48W (8V/6A) power supply, and compatible LEGO parts, for instance, the LEGO Education SPIKE Prime Set (PN: 45678) and SPIKE Prime Expansion Set v2 (PN: 45681). You could also use your own existing LEGO parts that are compatible with the LPF2 (LEGO Power
Functions version 2) connector.

You can obtain the Build Hat Python Library by upgrading your Raspberry Pi OS to the latest version or installing it from Github. You’ll also need to enable serial in rpi-config for the communication between the Raspberry Pi board and the Build Hat.

Programming looks quite straightforward with a “Hello Motor” sample in Python looking like:


The Raspberry Pi Foundation also provides five detailed guided project tutorials to help educators with teaching materials:

  • LEGO game controller
  • LEGO remote-controlled car
  • LEGO data plotter with pen and paper
  • LEGO data dashboard displaying pollution data on physical dials and sliders
  • LEGO robot face that reacts to what it can see
LEGO Technic Angular Motor
LEGO Technic Angular Motor

The Raspberry Pi Build HAT can be purchased for $25 and up on the usual resellers such as Sparkfun (US),  Cytron (South East Asia), PiHut (UK), and others, while the 48W power supply is sold separately for $15. Additional information may also be found on the official product page.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
3 Comments
oldest
newest
Salvador
Salvador
3 years ago

That’s an awesome product. Finally rpi stuff that makes sense.

Bob
Bob
3 years ago

The indentation on that python example is iffy – lines 2+3 shouldn’t be indented at all. /python pedant

crashoverride
crashoverride
3 years ago

Friends don’t let friends use languages with syntactic whitespace.

Boardcon Rockchip and Allwinner SoM and SBC products