Skip to the content
PCBKitNew board
4 layers65 × 56.5 mmSuperHAT V2, the printed circuit board in 3D

SuperHAT V2

JHSRobo/SuperHAT

HAT for Raspberry Pi 4 & 5.

Size
65 × 56.5 mm
Copper layers
4
Thickness
1.6 mm
Parts
82
Nets
97
Pads
325
Tracks, vias
641, 151
Pours
11
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
29 Mar 2026
Updated
29 Mar 2026

Overview

SuperHAT V2 is an open-source printed circuit board by JHSRobo, from the JHSRobo/SuperHAT repository on GitHub, published under the MIT licence. It is a 4-layer board of 65 × 56.5 mm with 82 parts on 97 nets, routed with 641 tracks and 151 vias.

It is built around the DRV8871DDA, AOSS32136C and B03B-PASK-1, with the SM04B-GHS-TB, B02B-PASK-1 and B04B-PASK-1 among its other parts. Its parts include 19 resistors, 14 diodes, 12 capacitors, 12 connectors and 4 ICs.

Main components

6

README

README.md

SuperHAT V2

A HAT (hardware attached on top) for the Raspberry Pi 4 & 5.


Power Rail Breakdown

SuperHAT receives external 5V and 12V power (with a common ground) from an MR30 connector. 12V is used for tools and motors. 5V is used for tools, servos, and powering the Raspberry Pi. When using the SuperHAT, do not plug in a USB-C power supply.


Feature Overview

  1. Four N-type MOSFETs for GPIO switching 5V or 12V tools.
  2. Six connectors for I²C interfacing.
  3. One dual H-bridge 12V motor driver.
  4. One stepper motor driver
  5. Two 5V servo connectors
  6. Overvoltage Protection
  7. Voltage & Current Sensing

1. MOSFET GPIO Switching

Schematic
Screenshot 2025-07-22 175952
N-Type MOSFET

The N-type MOSFET (AOSS32136C) in the schematic is routed for low-side switching. When testing, switching on the high side (before the load), resulted in a voltage drop. In an underwater environment, employing low-side switching means that the wires leading to the tool will be high (5V or 12V) when the tool is idling.

Back-EMF Protection

There is a standard diode (GSD2004WS-HE3-08) on the 5V and 12V lines. When the load is switched off, the diode prevents sensitive electronic components (the MOSFET in this case) from receiving voltage spikes generated by an inductive load (e.g. motor).

5V Configuration

To use a 5V you will need to solder the jumper (on the back of the board). Do not use a 12V tool when you solder the jumper because the 12V and 5V lines will short (because JP7 is closed and D3 leads to 5V). Technically, since MOSFETs can behave like variable resistors, and sending a PWM signal can "adjust" the voltage of the gate, it is possible to operate lower voltage tools. However, this is not recommended as there is no RC-filter at the gate to smooth these pulses. This RC-filter will be a feature in SuperHAT V3.

LED Indicator & Pulldown Resistor

In the schematic, there is an additional 10k $\Omega$ pulldown resistor in parallel with the LED circuit. This is because the LED can’t instantly pull down the voltage (since LEDs are non-ohmic). Intuitively, the green LED turns on when the GPIO is high.

2. I²C Interfacing

Schematic
Screenshot 2025-07-22 200031
Connectors

To ensure connectivity with a wide range of devices, there are six "I²C connectors": two right-angle JST-SH, two vertical JST-SH, and two right-angle JST-GH connectors. Note that JST-SH is the same as STEMMA QT by Adafruit and Qwiic by Sparkfun.

Pull-ups

There are no pullups for I²C on SuperHAT because the Raspberry Pi already incorporates 1.8k $\Omega$ pull-up resistors for SCL and SDA lines.

5V Device Support

Connector J10 is specifically designed for 5V I²C devices. While this connector provides 5V power to the device, the SDA and SCL logic lines remain at 3.3V levels. Ensure connected devices are 3.3V logic-compatible or include appropriate level-shifting circuitry.

3. Dual H-Bridge Motor Driver

Schematic
Screenshot 2025-07-22 201044
Operation

A 12V brushed DC motor can be driven in both directions with the DRV8871 motor driver. Input pins are set to GPIOs 9 and 10. To drive the motor, set one of the pins to high, and the other to low. Flip the status of both pins to drive the motor in the opposite direction. The motor won't move went both GPIOs are set to low. The 30k $\Omega$ resistor on pin 4 (ILIM) results in a trip current of about 2A (64 (kV) / RILIM (k $\Omega$)).

4. Stepper Motor Driver

Schematic
Screenshot 2025-07-22 205711
Operation

A 12V stepper motor can be driven by this motor driver (DRV8825). The pins for operation are GPIOs 21 and 26. Pulse GPIO 21 to move the stepper motor and set GPIO 26 to low or high to determine the direction of rotation. To test the stepper motor, run this code: https://github.com/Harry-IV/superhat_test/blob/main/stepper_motor.py.

Settings

To adjust the current limiting, use the screwhead on the potentiometer. The current limit is the voltage read on the screw head of the potentiometer multiplied by 2. To disable the stepper motor driver, solder jumper JP6.

Cooling

This IC gets hot, especially at higher currents. It would be wise to put a heat-sink.

5. Servo Driving

Schematic
Screenshot 2025-07-29 173046
Operation

GPIOs 12 and 13 can each drive one servo motor (a total of two for SuperHAT). Having a direct connection, especially with a Raspberry Pi due to their timing inconsistencies, can lead to jitter. This can be mitigated by using the pigpio library or by "sleeping" the pin while not moving the servo.

6. Overvoltage Protection

Schematic
Screenshot 2025-07-29 173822
Undervoltage Lockout (UVLO)

The TPS259621 will cut off power to the Raspberry Pi completely if the EN/UVLO pin does not receive a voltage above 1.2V (when rising). The UVLO threshold is set by a voltage divider consisting of resistors R18 (7.5kΩ) and R19 (2.61kΩ). These values yield an undervoltage cutoff of 4.85V. Note that the undervoltage cutoff when falling will be lower since it will cut off when the EN/UVLO pin does not receive a voltage above 1.1V. Ultimately, this part of the circuit isn’t really that necessary.

Overvoltage Clamping

What is more necessary is the overvoltage component. Here, there is no voltage divider. Texas Instrument's documentation calls for a 400k ohm resistor for the output clamp voltage to be 5.45V, but a 470k ohm resistor is used instead because they are a lot easier to come by.

Additional Resources

Video explanation by GreatScott!: https://www.youtube.com/watch?v=JOhQ3nsR7xo&t=440s

7. Voltage and Current Sensing

Schematic
image
INA3221

The INA3221 is a digital power-sensing IC that communicates via I²C. It features 3 channels, which are used to measure the voltage and current on the 3.3V, 5V, and 12V rails.

Shunt Resistors

Two 0.04 Ω resistors are placed at the 5V and 12V lines near the MR30 connector. All 5V and 12V power on the SuperHAT flows through these two shunts. This includes power draw at 5V from the Pi. A third 0.04 Ω resistor is placed on the 3.3V line near the 3.3V pin from the Raspberry Pi. This does not measure how much current the Pi draws at 3.3V, but rather how much SuperHAT draws (with I²C devices mainly).

Testing

To test the INA3221, run this code, which uses Adafruit's INA3221 library: [https://github.com/Harry-IV/superhat_test/tree/main/INA3221]


PCB Layout

4-layer Stackup

LayerType
1Signal
2Ground
3Power (3.3V, 5V, 12V)
4Signal
image

Design Notes

  • Via-in-pad is used to condense routing.
  • Copper pours help with thermal dissipation.

Email me at harry.c.ohagin@gmail.com if you have any questions.

Parts

82
QtyValueFootprintReferences
8~Standard Diode:SOD2613X115ND2, D3, D6, D8, D9, D11, D12, D14
70.1 uF0805 Ceramic Capacitor:CAPC2012X140NC1, C5, C6, C7, C8, C10, C12
5SolderJumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mmJP6, JP7, JP8, JP9, JP10
41000805 Resistor Moisture Resistant:RES_CHP0805_BRNR3, R4, R5, R6
410k2 RES 10k Array:SMT_1002P1AT_VISRN1, RN2, RN4, RN5
4AOSS32136CAOSS32136C:SOT23_AOSQ1, Q2, Q3, Q4
4B03B-PASK-13 Pin JST-PA Vertical:B03B-PASK-1JP1, JP2, JP3, JP4
4~0805 Green LED:WL-SMCW_0805D1, D7, D10, D13
30.04WSLP 0805 Resistor:RES_VISHAY_WSLP0805_VISR9, R10, R11
20.1WSLP 0805 Resistor:RES_VISHAY_WSLP0805_VISR15, R16
210 nF0805 Ceramic Capacitor:CAPC2012X140NC3, C11
210k0805 Resistor Moisture Resistant:RES_CHP0805_BRNR12, R13
247 uF47 uF Tantalum Capacitor:CAPMP7.6X4.3_3.1N_KEMC2, C9
2Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2, J4
2MountingHole_2.7mm_M2.5MountingHole:MountingHole_2.7mm_M2.5MH1, MH2
2Qwiic_RAQWIIC Connector RA:QWIIC Connector RAJ5, J10
2Qwiic_VerticalSparkFun-Connector:JST_SMD_1.0mm-4_VerticalJ6, J7
2SM04B-GHS-TBSM04B-GHS-TB:CONN_SM04B-GHS-TB_JSTJ8, J9
2~0805 Red LED:WL-SMCW_0805D4, D5
10.47 uF0805 Ceramic Capacitor:CAPC2012X140NC4
110k10k Potentiometer:POT_TC33_3X3P8_BRNRV1
11MCMP0805AFX:RES_CMP0805_BRNR8
11kTNPW0805:RES_TNPW0805_VISR2
12.61kTNPW0805:RES_TNPW0805_VISR19
130kSG73S2ATTD3002F:RESC2012X60NR7
13kTNPW0805:RES_TNPW0805_VISR1
1453RESC2012X60N:RESC2012X60NR14
1470kCMP0805AFX:RES_CMP0805_BRNR17
17.5kTNPW0805:RES_TNPW0805_VISR18
1B02B-PASK-1B02B-PASK-1:CONN_B02B-PASK-1_JSTJ12
1B04B-PASK-14 Pin JST-PA Vertical:B04B-PASK-1JP5
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_HorizontalJ11
1DRV8825PWPRDRV8825:PWP28_5P18X3P1U3
1DRV8871DDAPackage_SO:Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalViasU4
1GPIOConnector_PinSocket_2.54mm:PinSocket_2x20_P2.54mm_VerticalJ1
1INA3221Package_DFN_QFN:Texas_RGV0016A_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mmU1
1TPS259621DDARTPS259631:SOIC_20DDAR_TEXU2
1~Connector_AMASS:AMASS_MR30PW-M_1x03_P3.50mm_HorizontalJ3

Questions

How big is the SuperHAT V2 PCB?

It measures 65 × 56.5 mm and has 4 copper layers, 1.6 mm thick.

What parts does the SuperHAT V2 use?

82 parts, built around the DRV8871DDA, AOSS32136C, B03B-PASK-1 and SM04B-GHS-TB. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the SuperHAT V2 KiCad files?

From the JHSRobo/SuperHAT repository on GitHub, at the commit this page was made from: the board is SuperHAT V2.kicad_pcb and its schematic SuperHAT V2.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the SuperHAT V2 design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers33.7 × 36.8 mmVibrationSensor, the printed circuit board in 3D

    VibrationSensor

    npiegdon/ShakeFinder

    A low-cost, high-sensitivity vibration sensor

    27 parts75
  • 2 layers59.5 × 101 mmMouse, the printed circuit board in 3D

    Mouse

    unknownusername504/WirelessMouse

    A wireless mouse with open source pcb/schematic as well as drivers to come.

    54 parts35GPL-3.0
  • 4 layers24.9 × 49.9 mmCosmos Camera Spinner Sensors, the printed circuit board in 3D

    Cosmos Camera Spinner Sensors

    BarrettT123/CanSat-Team-Cosmos

    (The software I contributed to this project can be found in the CanSat-Team-Cosmos-Software repository)

    52 parts
  • 2 layers30 × 15 mmTFHT01, the printed circuit board in 3D

    TFHT01

    ThunderFly-aerospace/TFHT01

    Airborne Humidity and Temperature sensor for UAVs.

    34 parts10GPL-3.0
  • 2 layers25 × 23 mmTFI2CADT01, the printed circuit board in 3D

    TFI2CADT01

    ThunderFly-aerospace/TFI2CADT01

    I2C address translator module, allows connection of multiple I2C devices with the same address to one bus.

    38 parts10GPL-3.0
  • 2 layers37.5 × 19 mmTFRPM01, the printed circuit board in 3D

    TFRPM01

    ThunderFly-aerospace/TFRPM01

    Revolutions per minute (RPM) meter for UAV, rotors, wheels and engines.

    28 parts9GPL-3.0
  • 2 layers25 × 15 mmTFI2CEXT01, the printed circuit board in 3D

    TFI2CEXT01

    ThunderFly-aerospace/TFI2CEXT01

    I2C bus wire length extension module. Enabling the use of more extensive bus interconnection.

    26 parts8GPL-3.0