Extension board · Host adapters

Raspberry Pi 40-pin expansion HAT

Make a Raspberry Pi the host for small modules: five ten-contact sockets (Y, S, U, I and P) and a Qwiic port, with a protected resistor on every GPIO line.

Top view of the Raspberry Pi 40-pin expansion HAT.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
5 socketsY S U I P
26 GPIOall brought out
100 Ωseries each
3.3 Vsignals
Qwiicon the I²C bus
65 × 56millimetres
Check continuity, supplies, polarity, current and start-up states on your assembly before powering it. All signals are 3.3 V and not 5 V tolerant. There is no fuse or current limit on the forwarded supplies. Never cable a socket to another powered controller.

Tech specs

PurposeGadgeteer host ports for a Raspberry Pi
Header2×20 socket under the board
Protection100 Ω and an ESD diode on every GPIO
3.3 VFrom the Pi through a ferrite bead
5 VFrom the Pi through an LM66100 that blocks back-feeding; no current limit
QwiicJ6 (or the alternative 2.54 mm header J7), same bus as J4
Not connectedPi contacts 27 and 28 (HAT ID); no EEPROM
Size65 × 56 mm, four 2.75 mm HAT holes, 58 × 49 mm pattern

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it.

  1. 1
    Y socket (J1) — general inputs and outputs.
  2. 2
    S socket (J2) — SPI.
  3. 3
    U socket (J3) — serial.
  4. 4
    I socket (J4) — I²C.
  5. 5
    P socket (J5) — PWM.
  6. 6
    Qwiic port (J6) — 3.3 V I²C.
  7. 7
    Back-feed blocker (U1) — LM66100 on 5 V.
  8. 8
    3.3 V light (LED1) — green.
  9. 9
    5 V light (LED2) — green.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Lights

LightLit meansDisable it
LED1, green3.3 V presentCut JP1
LED2, green5 V presentCut JP2

Pinout

On every socket contact 1 is 3.3 V, contact 2 is 5 V and contact 10 is ground. The full socket-to-GPIO map is in the schematic below. For example, J1 contact 3 is BCM GPIO5 (header pin 29).

Qwiic contactSignal
1GND
23.3 V
3SDA
4SCL

What you need

A Raspberry PiWith the 40-pin header and a suitable supply.
This HATWith spacers.
A module3.3 V, for example the Buzzer breakout.

Get started

This example drives the Buzzer breakout from the Pi.

Wiring: J1 contact 1 to 3.3 V; J1 contact 2 to 5 V; J1 contact 3 to signal 3; J1 contact 4 to signal 4; J1 contact 5 to signal 5; J1 contact 6 to signal 6; J1 contact 7 to signal 7; J1 contact 8 to signal 8; J1 contact 9 to signal 9; J1 contact 10 to GND.J1J1 on this boardBuzzer breakout 13.3 V1: 3.3 V 25 V2: 5 V 3signal 33: signal 3 4signal 44: signal 4 5signal 55: signal 5 6signal 66: signal 6 7signal 77: signal 7 8signal 88: signal 8 9signal 99: signal 9 10GND10: GND
Cable contact for contact with the power off; bridge the module JP1 pads 1–2 only. Equipment is drawn as a typical unit, not a specific model.
  1. Fit the HAT

    Power off; seat all 40 contacts without offset.

  2. Connect the buzzer

    On the module bridge JP1 pads 1–2 (power from the socket), then cable HAT J1 to the module’s J1.

  3. Check

    Continuity, rails and polarity.

  4. Run the script

    Run the Python script below.

    The buzzer sounds briefly.

Configuration

You wantModuleExample
Use a module from the PiYour Pi program; not a Smoothieboard moduleSetup

Setup

Smoothieware is not involved: the Pi is the host. With GPIO Zero, which uses BCM numbers:

from time import sleep
from gpiozero import Buzzer

with Buzzer(5, active_high=True, initial_value=False) as buzzer:
    try:
        buzzer.on()
        sleep(0.2)
    finally:
        buzzer.off()

Run it with GPIOZERO_PIN_FACTORY=lgpio python3 hat_buzzer.py.

How it works

Each header signal goes through 100 Ω to its socket, with an ESD diode to ground. There is no level conversion. Older Pi firmware can briefly drive GPIO6, 14 and 16 during boot (J2.4, J3.4 and J2.5), so keep sensitive loads off those until checked.

Pi header signal then 100 Ω and ESD diode then Socket, no level conversion.Pi header signal100 Ω and ESD diodeSocketno level conversion
How the signals pass through this board.

Troubleshooting

SymptomCheck
Nothing happensBCM numbering, not header pin numbers; check the supply lights.
Pi rebootsA module draws too much current; there is no limiter.

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The complete circuit diagram
Parts list (CSV)Every component with its value and footprint
Board drawing (WebP)The top view used on this page

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side.

Mounting drawing of the ph, component side: outline 65 by 56 millimetres with 4 mounting holes and 2 cable-tie holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 65 56 0, 0 X Y 1 3.50, 3.50 2 61.50, 3.50 3 3.50, 52.50 4 61.50, 52.50 cable tie Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 65 × 56 mm, corners rounded to a 3 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
13.503.502.75 mm, not platedMounting
261.503.502.75 mm, not platedMounting
33.5052.502.75 mm, not platedMounting
461.5052.502.75 mm, not platedMounting
–58.0045.002.5 mm, not platedCable tie
–14.0052.502.5 mm, not platedCable tie

Appendix: electrical specifications

Values from the design.

ParameterApplies toLowerNominalUpperBasis and conditions
SignalsAll sockets—3.3 V—Not 5 V tolerant
Series resistanceEach GPIO—100 Ω—Parts list

Appendix: datasheets

The first page of each important chip’s datasheet. Click a page to open the PDF.

First page of the LM66100 datasheet
LM66100 ideal diode — Texas Instruments, 23 pages.
First page of the TPD1E10B06 datasheet
TPD1E10B06 single-channel ESD protection diode — Texas Instruments, 33 pages.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.