Prepare your Build HAT

Before starting to work with your Raspberry Pi Build HAT, set up your Raspberry Pi and install the latest version of the operating system using Raspberry Pi Imager.

Attach 9 mm spacers to the bottom of the board. Seat the Raspberry Pi Build HAT onto your Raspberry Pi. Make sure you put it on the right way up. Unlike other HATs, all the components are on the bottom, leaving room for a breadboard or LEGO® elements on top.

Access the GPIO Pins

If you want to access the GPIO pins of the Raspberry Pi, you can add an optional tall header and use 15 mm spacers.

tall headers

The following pins are used by the Build HAT itself; don’t connect anything to them.

GPIO Use Status

GPIO0/1

ID prom

GPIO4

Reset

GPIO14

Tx

GPIO15

Rx

GPIO16

RTS

unused

GPIO17

CTS

unused

Set up your Raspberry Pi

After the Raspberry Pi has booted, open the Control Centre tool by selecting the Raspberry Menu button and then selecting Preferences > Control Centre.

Select the Interfaces tab and adjust the serial settings as shown in the following image:

The Interfaces tab. SSH, VNC, and Serial Port are enabled. The rest of the options are not enabled.

Use your Raspberry Pi headless

If you are running your Raspberry Pi headless and using raspi-config, select "Interface Options" from the first menu.

raspi config 1

Then "P6 Serial Port".

raspi config 2

Disable the serial console:

raspi config 3

And enable the serial port hardware.

raspi config 4

The final settings look like this.

raspi config 5

You will need to reboot at this point if you have made any changes.

Power the Build HAT

Connect an external power supply. We recommend the official Raspberry Pi Build HAT power supply. However, any reliable +8V±10% power supply capable of supplying 48 W through a DC 5521 centre positive barrel connector (5.5 mm × 2.1 mm × 11 mm) can power the Build HAT. You don’t need to connect an additional USB power supply to the Raspberry Pi unless you are using a Keyboard-series device.

The Build HAT cannot power Keyboard-series devices, since they do not support power supply over the GPIO headers.

The LEGO® Technic™ motors are very powerful; so to drive them you’ll need an external 8V power supply. If you want to read from motor encoders and the SPIKE™ force sensor, you can power your Raspberry Pi and Build HAT the usual way, through your Raspberry Pi device’s USB power socket. The SPIKE™ colour and distance sensors, like the motors, require an external power supply.

You have the choice to use Build HAT with Python or .NET.