Skip to the content
PCBKitNew board
2 layers54.9 × 14.8 mmRasPi Hat, the printed circuit board in 3D

Allow students to program a remote labs experiment themselves, while protecting hardware from damage due to misfunction

Size
54.9 × 14.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
3
Nets
40
Pads
47
Tracks, vias
56, 6
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
22 Mar 2022
Updated
25 Jul 2025

Overview

RasPi Hat is an open-source printed circuit board by practable, from the practable/supervisor-pcb repository on GitHub. It is a 2-layer board of 54.9 × 14.8 mm with 3 parts on 40 nets, routed with 56 tracks and 6 vias.

README

README.md

Remote Labs Supervisor PCB V1.2

NOTE: This project has been continued in a new location, please see: rl-supervisor-two for the latest version of this project

Project Brief - [Remote Labs Supervisor PCB V1.2]

Design a PCB to provide power to remote labs experiments, which involve students programming microcontrollers remotely. PCB should also provide a supervisory role, blocking actuation of experimental hardware if it is likely to cause damage to the equipment.

This allows students to upload their own code to a bare bones microcontroller, without risk of causing hardware damage or unsafe conditions.
RemoteLabsSupervisorPCBV1 0_3DModel

Using Remote Labs Supervisor PCB

This document is intended to be a useage guide for the Remote Labs Supervisor PCB, and document the different use cases and configurations it is capable of.

For coded examples of the various features please see PCB Unit Tests, which contains arduino code firmware used during testing all hardware features of the PCB.

For the purposes of this document, it is assumed that the Motherboard PCB is populated with both Arduino Nano IoT 33 Daughterboards (A1 & A2), with shift registers installed, and NOT the bare bones SAMD21 MCU. A seperate document will be provided for cases in which SAMD21 MCUs are mounted to the motherboard directly.

Pin Naming and Shift Registers

All MCU pins will be referenced by the Arduino Pin Numbers in this document. Additional pins are sourced via Shift Registers attached to each MCU. Shift Register pins are labelled as Q0 - Q7. Both MCU connections to their independent shift registers are detailed below.

MCU PinShift Register Function
D8LATCH (Write to Register)
D11MOSI (Data)
D13SCK

Complete pinout diagrams for both MCUs and Shift Registers can be found at the bottom of this document

Powering the System

The System should be provided 12v DC power via the yellow XT60 connector J3. The system is specified to draw a maximum of ~ 8A depending on experiment configuration, ensure that power supply selected is sufficient for specific use case.

Diode D6 (Blue) will light to show correct polarity power is provided to input. Diode D7 (Orange) will light to show 3V3 DC power is available to microcontrollers and periferal devices.

Motherboard has reverse polarity protection, however care should be taken to ensure correct orientation of power input. - NOTE: Currently missing protection diode- awaiting delivery

Programming the MCUs

Each MCU, supervisor and student are able to be programmed via the USB connector on the daughterboard, or via UART using the 5 pin headers J26 Student_Prog_Header, and J1 Super_Prog_header.

For UART Programming, a hat is provided for raspi GPIO pins. 5 pin cable should be connected from Raspi hat to UART Programming connector on motherboard.

The USB connectors mounted to the Motherboard should not be used if Arduino Development boards are installed, and are UNTESTED for use with bare bones MCUs installed


Use Case 1 [Spinner Experiment]

In this configuration the following modules should be mounted to the motherboard:

  • Infineon DC Motor Control Shield - A3

In this configuration the following external hardware should be connected as follows:

  • DC Motor, wired to the OUTER two pins on J18 DC Motor Output
  • Optical Encoder, plugged into J25 Optical Encoder

Using the DC Motor

DC Motor PWM is routed to Infineon DC Motor Controller module via the following logic:

image

If MOTOR_DIR_A is driven HIGH, PWM is routed from STUDENT_MOTOR_PWM or SUPERVISOR_MOTOR_PWM to MOTOR_OUT_1 If MOTOR_DIR_B is driven HIGH, PWM is routed from STUDENT_MOTOR_PWM or SUPERVISOR_MOTOR_PWM to MOTOR_OUT_2

Care must be taken to avoid driving MOTOR_DIR_A and MOTOR_DIR_B to HIGH at the same time as this will cause shoot through.

In Order to avoid shoot through condition, Student does not have direct input to MOTOR_DIR_A or MOTOR_DIR_B. These outputs are spoofed via the Supervisor MCU.

The MCU able to pass PWM signal to Motor Control Module is selected by MCU_MOTOR_SELECT pin. When HIGH - STUDENT_MOTOR_PWM is active, when LOW - SUPERVISOR_MOTOR_PWM is active.

In order to enable the DC Motor Control Module, OUT_M_ENABLE must also be set HIGH. This is routed from either MCU using the same logic as above, when MCU_MOTOR_SELECT is HIGH, ENABLE is routed from STUDENT_MOTOR_EN, when it is set LOW, ENABLE is routed from SUPERVISOR_MOTOR_EN.

M_I_SENSE_1 and M_I_SENSE_2 output is buffered and distributed to both MCUs.

Supervisor MCU

Supervisor MCU uses the following table for DC Motor Control:

MCUPinPin NameStateMotor BehaviourNotes
SUPERVISORD12MOTOR_DIR_1HIGH or LOWSets motor DirectionIF(D7 == HIGH){D12 MUST = LOW)
SUPERVISORD7MOTOR_DIR_2LOW or HIGHSets motor DirectionIF(D12 == HIGH){D7 MUST = LOW)
SUPERVISORQ0DC_MOTOR_ENHIGHEnables DC Motor Drive
SUPERVISORQ1STUDENT_M_ENLOWBlocks Student Control, Enables Supervisor Control
SUPERVISORA7DC_MOTOR_IS1ANALOG INPUTCurrent Draw and Fault Condition Detection
SUPERVISORA6DC_MOTOR_IS2ANALOG INPUTCurrent Draw and Fault Condition Detection

Student MCU

Student MCU uses the following table for DC Motor Control: Note - Student control relys on specific pin configurations of Supervisor MCU

MCUPinPin NameStateMotor BehaviourNotes
STUDENTD12MOTOR_DIR_1HIGH or LOWDetected by Supervisor PIN A1IF(D7 == HIGH){D12 MUST = LOW)
STUDENTD7MOTOR_DIR_2LOW or HIGHDetected by Supervisor PIN A0IF(D12 == HIGH){D7 MUST = LOW)
STUDENTQ0DC_MOTOR_ENHIGHEnables DC Motor Drive
SUPERVISORQ1STUDENT_M_ENHIGHBlocks Supervisor Control, Enables Student Control
SUPERVISORA1STDNT_DC_M_DIR_1DIGITAL INPUTDetects state of Student Direction Pin and Spoofs output if logic != illegal
SUPERVISORA0STDNT_DC_M_DIR_2DIGITAL INPUTDetects state of Student Direction Pin and Spoofs output if logic != illegal
SUPERVISORD12MOTOR_DIR_1HIGH or LOWSets motor Direction - Spoofed from A1
SUPERVISORD7MOTOR_DIR_2LOW or HIGHSets motor Direction - Spoofed from A0
STUDENTA7DC_MOTOR_IS1ANALOG INPUTCurrent Draw and Fault Condition Detection
STUDENTA6DC_MOTOR_IS2ANALOG INPUTCurrent Draw and Fault Condition Detection

Using the Optical Encoder

Optical encoder signals are buffered and provided to both MCUs simaltaniously, therefore getting useful data from Optical Encoder is the same process for both MCUs

MCUs use the following table for Optical Encoder detection:

MCUPinPin NameStateNotes
BothD2ENCODER_BEXTERNAL INTERRUPT / DIGITAL INPUTFor best performance, External Interrupt used for edge detection of Encoder waveform
BothD3ENCODER_AEXTERNAL INTERRUPT / DIGITAL INPUTAlternative pin for External Interrupt.
BothD4ENCODER_INDEXDIGITAL INPUTUsed to track center detent of optical encoder (Untested in software)

Use Case 2 [Governer Experiment]

In this configuration the following modules should be mounted to the motherboard:

  • Infineon DC Motor Control Shield - A3
  • DRV8825 Stepper Motor Driver - A4

DC Motor & Optical Encoder are accessed as Use Case 1 above

In this configuration the following external hardware should be connected as follows:

  • DC Motor, wired to the OUTER two pins on J18 DC Motor Output
  • Stepper Motor, plugged into J19 Stepper Motor Output
  • Optical Encoder, plugged into J25 Optical Encoder
  • Limit Switch, plugged into J23 limit_switch_A

Using the Stepper Motor

Stepper Motor Driver inputs are routed via the following logic:

image

When MCU_STEP_SELECT is HIGH, inputs are routed from STUDENT MCU. When MCU_STEP_SELECT is LOW, inputs are routed from SUPERVISOR MCU.

STEPP_EN is driven from Supervisor MCU Only, however does not seem to have any effect on stepper motor function. - Requires further investigation.

STEPPR_FAULT output is buffered and distributed to both MCUs.

LIMIT_1 Limit switch input is buffered and distributed to both MCUs.

Supervisor MCU

Supervisor MCU uses the following table for Stepper Motor Control:

MCUPinPin NameStateMotor BehaviourNotes
SUPERVISORD6STEPP_STEPPULSEMotor advances 1 step per pulse
SUPERVISORQ2STUDENT_STEP_ENLOWBlocks Student Control, Enables Supervisor Control
SUPERVISORQ4STEPP_DIRHIGH or LOWSets Stepper Motor Direction
SUPERVISORQ5STEPP_SLPHIGH or LOWEnables and Sleeps motor to avoid overheatingMUST BE HIGH? to enable
SUPERVISORQ6STEPP_RSTHIGH or LOWResets controller board after fault conditionMUST BE HIGH? to enable
SUPERVISORQ7STEPP_ENHIGH or LOWEnables motor driver boardNO DECERNABLE EFFECT? - Needs Testing
SUPERVISORA5STEPP_FLTDIGITAL INPUTFault reporting from Stepper Control daughterboardHIGH = NO FAULT, LOW = FAULT
SUPERVISORA4LIMIT_1DIGITAL INPUTLimit Switch Detection.LOW = Switch Pressed

Student MCU

Student MCU uses the following table for Stepper Motor Control: Note - Student control relys on specific pin configurations of Supervisor MCU

MCUPinPin NameStateMotor BehaviourNotes
STUDENTD6STEPP_STEPPULSEMotor advances 1 step per pulse
SUPERVISORQ2STUDENT_STEP_ENHIGHEnables Student Control, Blocks Supervisor Control
STUDENTQ4STEPP_DIRHIGH or LOWSets Stepper Motor Direction
STUDENTQ5STEPP_SLPHIGH or LOWEnables and Sleeps motor to avoid overheatingMUST BE HIGH? to enable
STUDENTQ6STEPP_RSTHIGH or LOWResets controller board after fault conditionMUST BE HIGH? to enable
SUPERVISORQ7STEPP_ENHIGH or LOWEnables motor driver boardNO DECERNABLE EFFECT? - Needs Testing
STUDENTA5STEPP_FLTDIGITAL INPUTFault reporting from Stepper Control daughterboardHIGH = NO FAULT, LOW = FAULT
STUDENTA4LIMIT_1DIGITAL INPUTLimit Switch Detection.LOW = Switch Pressed
Additional Stepper Motor Functions

SW1 - Stepper Mode Dipswitches set number of steps per revolution. If UNPOPULATED setting is at MAX RESOLUTION. (1, 1, 1 ) logic for MODE inputs.


Use Case 3 [Digger Experiment]

In this configuration the following modules should be mounted to the motherboard:

  • Infineon DC Motor Control Shield - A3

DC Motor & Optical Encoder are accessed as Use Case 1 above

In this configuration the following external hardware should be connected as follows:

  • DC Motor, wired to the OUTER two pins on J18 DC Motor Output
  • Optical Encoder, plugged into J25 Optical Encoder
  • Limit Switch, plugged into J23 limit_switch_A
  • Servo, plugged into J20 Servo_A

In this use case, supervisor must calibrate and track the position of DC motor to avoid equipment collision with self.

Supervisor MCU

Supervisor has ultimate control of the Servo PPM output.

Supervisor MCU uses the following table for Servo Motor Control:

MCUPinPin NameStateMotor BehaviourNotes
SUPERVISORD9SERVO_1PPM OutputPPM Standard sets Servo Position

Student MCU

Student MCU has no direct output to servo_1, instead supervisor must spoof and constrain output; given either a PWM signal, or PPM signal from the Student, applied to Pin A2 of the supervisorU MCU.

Student MCU uses the following table for Servo Motor Control: Note - Student control relys on specific pin configurations of Supervisor MCU

MCUPinPin NameStateMotor BehaviourNotes
STUDENTD9SERVO_1PPM or PWM OutputPPM/PWM used to infer desired position of servo
SUPERVISORA2STDNT_SRVO_RX_1ANALOG INPUT or EXTERNAL INTERRUPTDetects infered desired position for servo
SUPERVISORD9SERVO_1PPM OutputPPM Standard sets Servo Position

Use Case 4 [Pendulum Experiment]

NOTE: USE CASE UNTESTED

In this configuration the following modules should be mounted to the motherboard:

  • Remote Labs Pendulum PCB Daughterboard - A3

In this configuration the following external hardware should be connected as follows:

  • Pendulum Driver, wired to the OUTER two pins on J18 DC Motor Output
  • Optical Encoder, plugged into J25 Optical Encoder

Supervisor MCU

Supervisor MCU uses the following table for Pendulum Control:

MCUPinPin NamePendulum PCB Pin NameStatePendulum BehaviourNotes
SUPERVISORQ0DC_MOTOR_ENENABLEDIGTAL OUTPUTDriveTried to avoid this being on a shift register - failed can it be moved to another pin? User Thermo A3, and enable
SUPERVISORD6STEPP_STEPPENDULUM_PIN_1DIGTAL OUTPUTLoad
SUPERVISORD12DC_MOTOR_DIR_1PENDULUM_PIN_7DIGTAL OUTPUTLED_1 Control
SUPERVISORD7DC_MOTOR_DIR_2PENDULUM_PIN_8DIGTAL OUTPUTLED_2 Control
SUPERVISORD9SERVO_1PENDULUM_PIN_6DIGTAL OUTPUTLED_3 Control
SUPERVISORQ1STUDENT_M_ENPENDULUM_PIN_2LOWBlocks Student Control, Enables Supervisor Control
SUPERVISORA7DC_MOTOR_IS1I_SENSE_1ANALOG INPUTCurrent Draw and Fault Condition DetectionCheck which way around these are
SUPERVISORA6DC_MOTOR_IS2I_SENSE_2DIGITAL INPUTCurrent SIGN reporting (+/-)HIGH = Positive Current, LOW = Negative Current

Student MCU

Student MCU uses the following table for Stepper Motor Control: Note - Student control relys on specific pin configurations of Supervisor MCU

MCUPinPin NamePendulum PCB Pin NameStatePendulum BehaviourNotes
STUDENTQ0DC_MOTOR_ENENABLEDIGTAL OUTPUTDriveTried to avoid this being on a shift register - failed can it be moved to another pin? User Thermo A3, and external enable
STUDENTD6STEPP_STEPPENDULUM_PIN_1DIGTAL OUTPUTLoad
STUDENTA0SPARE_0PENDULUM_PIN_3DIGTAL OUTPUTLED_1 Control
STUDENTA1SPARE_1PENDULUM_PIN_4DIGTAL OUTPUTLED_2 Control
STUDENTA2SPARE_2PENDULUM_PIN_5DIGTAL OUTPUTLED_3 Control
SUPERVISORQ1STUDENT_M_ENPENDULUM_PIN_2HIGHEnables Student Control, Blocks Supervisor Control
STUDENTA7DC_MOTOR_IS1I_SENSE_1ANALOG INPUTCurrent Draw and Fault Condition DetectionCheck which way around these are
STUDENTA6DC_MOTOR_IS2I_SENSE_2DIGITAL INPUTCurrent SIGN reporting (+/-)HIGH = Positive Current, LOW = Negative Current

Additional Features

WS2812 LEDs

To use WS2812 LED strips with any configuration, the following external hardware should be connected as follows:

  • WS2821B LED Strip, connected to J24 WS2812B LEDs

Supervisor MCU uses the following table for WS2812B LED Control.

MCUPinPin NameStateUseNotes
SUPERVISORD5PIXEL_DATADIGITAL OUTPUTSets LED Colour & Brightness
SUPERVISORQ3STUDENT_PIXEL_ENLOWBlocks Student Control, Enables Supervisor Control

Student MCU uses the following table for WS2812B LED Control.: Note - Student control relys on specific pin configurations of Supervisor MCU

MCUPinPin NameStateUseNotes
STUDENTD5PIXEL_DATADIGITAL OUTPUTSets LED Colour & Brightness
SUPERVISORQ3STUDENT_PIXEL_ENHIGHEnables Student Control, Blocks Supervisor Control

Power Output Connectors

Voltage/BusPurpose/NameComponent NumberConnector TypeCurrent Considerations
12V12V_DCJ30Screw TerminalUnregulated ~8A Max(For entire Bus)
12VStrip LightingJ4MolexUnregulated ~8A Max(For entire Bus)
12VDC MOTOR PWRJ16Screw TerminalUnregulated ~8A Max(For entire Bus)
5V_DC_LED5V_DC_LEDJ6Screw Terminal1A Total. Regulated
5V_DC_RPI5V_DC SpareJ31Screw Terminal2.5A Total. Regulated
5V_DC_RPIUSB PowerJ5USB A Socket x22.5A Total. Regulated
Additional Voltage Bus Connections

Additional headers have been provided for:

  • 3V3 DC Power Output (1A Max)
  • 5V DC Digital Power Output (2 - 2.5A Max, including USB Socket)
  • 5V DC Servo Power Output (1A Max)
  • 12V DC Bus (Unregulated - 6A Max)

These are intended for future use, fault finding or reconfirging PCBs to perform tasks outside of the specified use cases.

Thermocouple

Currently Unavailable due to parts shortages

To use Thermocouple Input with any configuration, the following external hardware should be connected as follows:

  • K-Type Thermocouple, connected to J22 Thermocouple connector.

Thermocouple input J22 Thermocouple requires IC U19 AD8497 To be populated. (UNTESTED)

Analog voltage is buffered and distributed to both MCUs, Pin A3

Pinout Diagrams

MCU and Shift Register Pinout diagrams

Supervisor MCU

image image

Student MCU

image image

CAD Renders

RemoteLabs Supervisor PCBV1 0 CAD Design RemoteLabsSupervisorPCBV1 0_3DModel_3 image

Parts

3
QtyValueFootprintReferences
1Arduino SerialConnector_Molex:Molex_KK-254_AE-6410-05A_1x05_P2.54mm_VerticalJ2
1FanConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ1
1Pi HeaderConnector_PinHeader_2.54mm:PinHeader_2x20_P2.54mm_VerticalJ3

Questions

How big is the RasPi Hat PCB?

It measures 54.9 × 14.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the RasPi Hat use?

3 parts. 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 RasPi Hat KiCad files?

From the practable/supervisor-pcb repository on GitHub, at the commit this page was made from: the board is RasPi_Hat/RasPi_Hat.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the RasPi Hat design in my own project?

Its repository states no licence, so its author keeps all rights: ask practable before reusing the design.

More from practable/supervisor-pcb

5
  • 4 layers169.7 × 99.1 mmRemoteLabs supervisor PCB, the printed circuit board in 3D

    RemoteLabs supervisor PCB

    practable/supervisor-pcb

    Allow students to program a remote labs experiment themselves, while protecting hardware from damage due to misfunction

    201 parts
  • 4 layers180.3 × 99.1 mmRemoteLabs supervisor PCB, the printed circuit board in 3D

    RemoteLabs supervisor PCB

    practable/supervisor-pcb

    Allow students to program a remote labs experiment themselves, while protecting hardware from damage due to misfunction

    200 parts
  • 2 layers69.3 × 54 mmDriver PCB Vol2, the printed circuit board in 3D

    Driver PCB Vol2

    practable/supervisor-pcb

    Allow students to program a remote labs experiment themselves, while protecting hardware from damage due to misfunction

    79 parts
  • 2 layers69.3 × 54 mmDriver PCB Vol3, the printed circuit board in 3D

    Driver PCB Vol3

    practable/supervisor-pcb

    Allow students to program a remote labs experiment themselves, while protecting hardware from damage due to misfunction

    66 parts
  • 2 layers69.3 × 54 mmDrıver PCB to be Outsourced, the printed circuit board in 3D

    Drıver PCB to be Outsourced

    practable/supervisor-pcb

    Allow students to program a remote labs experiment themselves, while protecting hardware from damage due to misfunction

    38 parts

Similar boards

  • 2 layers40 × 30 mmBlinky, the printed circuit board in 3D

    Blinky

    earthtojake/text-to-cad

    Design physical products with AI

    3 parts26kMIT
  • 2 layers51.9 × 16 mmPassive2-rpi non standard adapter, the printed circuit board in 3D

    Passive2-rpi non standard adapter

    hzeller/rpi-rgb-led-matrix

    Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO

    3 parts4.4kGPL-2.0
  • 2 layers16.3 × 16.3 mmSensor, the printed circuit board in 3D

    Sensor

    scottbez1/splitflap

    DIY split-flap display

    3 parts4.2k
  • 2 layersSub, the printed circuit board in 3D

    Sub

    atopile/atopile

    Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️

    3 parts4kMIT
  • 2 layers85 × 30 mmDual stomp, the printed circuit board in 3D

    Dual stomp

    torvalds/GuitarPedal

    Linus learns analog circuits

    3 parts2.5kGPL-2.0
  • 2 layers124.5 × 33.7 mm172319-1 connector, the printed circuit board in 3D

    172319-1 connector

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    3 parts1.2k
  • 2 layers10.5 × 83 mmProgrammingAdapter, the printed circuit board in 3D

    ProgrammingAdapter

    stuartpittaway/diyBMSv4

    Version 4 of the diyBMS

    3 parts1.1k
  • 2 layers21.2 × 51.3 mmPico reset, the printed circuit board in 3D

    Pico reset

    hackclub/sprig

    🍃 Learn to code by making games in a JavaScript web-based game editor.

    3 parts1.1kMIT