Raspberry Pi Build HAT: specs and pinout
Raspberry Pi add-on board, made with LEGO Education, with four connectors for LEGO Technic motors and sensors, controlled from Python on a Raspberry Pi. It does nothing on its own: it requires LEGO Technic motors or sensors that you already own (not sold here).
Specs
| Spec | Value | Source |
|---|---|---|
| Ports | Four connectors for LEGO Technic motors and sensors (LPF2 connector): SPIKE Portfolio devices, MINDSTORMS Robot Inventor devices and most other LPF2 devices | source Product brief p.3, Specification |
| Controller | Raspberry Pi RP2040 microcontroller manages low-level control of the LEGO Technic devices | source Product brief p.3, Specification |
| Host compatibility | Raspberry Pi computers with a 40-pin GPIO header; Keyboard-series devices need a ribbon cable or other extension device and cannot be powered through the HAT | source Product brief p.2-3; documentation: About |
| DC power connector | 2.1 mm barrel jack, centre positive (5.5 mm x 2.1 mm x 11 mm) | source Product brief p.3; documentation: Power the Build HAT |
| External supply rating | 7.2 V to 8.5 V DC (product brief); the documentation says any reliable +8 V +/-10% supply capable of 48 W | source Product brief p.3, Specification; documentation: Power the Build HAT |
| What needs the external supply | LEGO Technic motors and the SPIKE colour and distance sensors need the external supply; motor encoders and the SPIKE force sensor can be read with the Raspberry Pi powered the usual way through its USB power socket | source Documentation: Power the Build HAT, Note |
| Host serial link | Uses the Raspberry Pi serial port (GPIO14 Tx, GPIO15 Rx); the serial console must be disabled and the serial port hardware enabled | source Documentation: Prepare your Build HAT, Set up your Raspberry Pi |
| Mounting | Components are on the underside; attach 9 mm spacers, or add a tall header and 15 mm spacers to reach the GPIO pins | source Documentation: Prepare your Build HAT |
Power
| Value | Source | |
|---|---|---|
| Supply | External DC 7.2 V to 8.5 V (product brief) on the barrel jack, which also powers the Raspberry Pi through the HAT; or the Raspberry Pi's own USB supply when only reading motor encoders and the force sensor | source Product brief p.3; documentation: Power the Build HAT (supply capable of 48 W); no typical current is published |
Pinout
The HAT plugs onto the Raspberry Pi 40-pin header. The only pin information in the official documents is the list of GPIO pins the HAT uses, shown here; the pin order of the four LEGO connectors is not given in the official documents.
| Pin | Function | Voltage | Notes | Source |
|---|---|---|---|---|
| GPIO0/1 | ID prom | 3.3 V logic | used by the Build HAT itself; do not connect anything to it | source Documentation: Prepare your Build HAT, pin table |
| GPIO4 | Reset | 3.3 V logic | used by the Build HAT itself; do not connect anything to it | source Documentation: Prepare your Build HAT, pin table |
| GPIO14 | Tx | 3.3 V logic | used by the Build HAT itself; do not connect anything to it | source Documentation: Prepare your Build HAT, pin table |
| GPIO15 | Rx | 3.3 V logic | used by the Build HAT itself; do not connect anything to it | source Documentation: Prepare your Build HAT, pin table |
| GPIO16 | RTS | 3.3 V logic | status: unused; used by the Build HAT itself; do not connect anything to it | source Documentation: Prepare your Build HAT, pin table |
| GPIO17 | CTS | 3.3 V logic | status: unused; used by the Build HAT itself; do not connect anything to it | source Documentation: Prepare your Build HAT, pin table |
Build with it
Project ideas for the Raspberry Pi Build HAT. Each link opens Soldr with the prompt filled in; Soldr assigns the pins, checks power and shows how to wire every part.
- Motor angle readout: Requires LEGO Technic motors or sensors that you already own (not sold here). Turn the motor by hand and read its encoder: the documentation says encoders can be read with the Raspberry Pi powered through its USB socket, so no external 8 V supply is needed for this. Learning project.
- Force sensor tally counter: Requires LEGO Technic motors or sensors that you already own (not sold here). The documentation lists the force sensor among the devices that can be read with the Raspberry Pi on its own USB power.
- Encoder and force data logger: Requires LEGO Technic motors or sensors that you already own (not sold here). Both devices can be read without the external supply, and the Python library gives access to them. The Build HAT is not yet supported on Raspberry Pi OS Trixie, so use Bookworm.
Common mistakes
- Driving LEGO Technic motors from the Raspberry Pi's USB supply alone: motors and the colour and distance sensors need the external 8 V supply (source: link, Power the Build HAT)
- Using Raspberry Pi OS Trixie: the documentation says the Build HAT is not yet supported on Trixie, so install or stay on Bookworm (source: link, About, Warning)
- Wiring other parts to GPIO0/1, GPIO4 or GPIO14-17: the Build HAT itself uses them (source: link, Prepare your Build HAT)
Not covered by the official source
- The product brief gives a 7.2-8.5 V supply rating and the documentation says +8 V +/-10% (7.2-8.8 V); both are shown.
- No typical current, motor current limit or LEGO connector pin order was found in the official documents.
- The documents say only 'any Raspberry Pi computer with a 40-pin GPIO header'; no per-model support list is given.