Interfaces and Harnesses
How parts declare connection intent through interfaces, how harnesses bundle them, and the protocol compatibility rules that make it all work.
Interfaces and harnesses are the connection layer of Protoboard. An interface is a single, typed connection point declared by a part. A harness is the logical cable that groups every interface link between two parts into one bundle. Together they let Protoboard automatically discover which parts can talk to each other, allocate the right physical resources, and flag mismatches before you build anything.
Core Concepts
What Is an Interface?
An interface is a template for exactly one connection between two devices. It declares:
Protocol: what language it speaks (e.g.,
i2c,power,pneumatic).Role: which side of the conversation it is on (e.g.,
mastervsslave).Required functions: which physical resource capabilities it needs (e.g.,
i2c_sdax1,i2c_sclx1).
What Is a Harness?
A harness is the single logical cable between two parts. When you drag a connection on the canvas, Protoboard creates a harness and then discovers which interfaces on each side are compatible. Compatible pairs become interface links inside the harness.
To the user a harness looks like one line in the system diagram. Under the hood it carries all the mapped signals, power rails, or fluid channels between those two parts.
What Is a Function Link?
Within an interface link, each required function on one side is matched to a required function on the other side. These individual pairings are function links. For example, an I2C interface link contains two function links: one for SDA and one for SCL.
The Protocol + Role System
Two interfaces can connect only when:
Their
protocol.typevalues are identical (case-sensitive string match).Their
protocol.rolevalues form a compatible pair.
Protocol Types by Domain
power
input / output, source / sink
Point-to-point
Generic power delivery.
dc_power
input / output, source / sink
Point-to-point
Explicit DC power.
digital
transmitter / receiver, output / input, peer / peer
Point-to-point
Single digital signal.
gpio
input / output, peer / peer
Point-to-point
General purpose I/O.
pwm
transmitter / receiver, output / input
Point-to-point
Pulse-width modulation.
analog
transmitter / receiver, output / input
Point-to-point
Analog signal.
i2c
master / slave
Bus
2-wire, up to ~8 devices typical.
spi
master / slave
Multi-drop w/ SS
4-wire (MOSI, MISO, SCK, SS).
uart
host / device, peer / peer
Point-to-point
Serial TX/RX.
can
peer / peer
Bus
CAN-H / CAN-L differential.
usb
host / device
Point-to-point
D+, D-, GND, VBUS.
ethernet
host / device, peer / peer
Point-to-point
Physical Ethernet (TXD, RXD).
brushless_3phase
driver / motor
Point-to-point
3 phases (A, B, C).
dc_motor
driver / actuator
Point-to-point
Motor +/-.
servo_control
controller / actuator
Point-to-point
PWM servo signal.
quadrature
encoder / receiver
Point-to-point
A/B channels.
swd_debug
debugger / target
Point-to-point
SWDIO + SWCLK.
threaded_connection
mounting_point, structural_support, panel_mount
Screws, bolts, standoffs.
clip_connection
mounting_point, structural_support, panel_mount
Snap-fit, clip-on.
mechanical_connection
mounting_point, structural_support, cable_anchor
General mechanical.
mechanical_attachment
mounting_point, structural_support
Simple attachment.
mechanical_rotation
shaft, driver
Rotating couplings.
mechanical_spline
shaft, driver
Spline couplings.
arduino_uno_shield
shield, arduino
Arduino form-factor.
pi hat
shield, host
Raspberry Pi HAT.
thermal_connection
thermal_source, thermal_sink
Heat transfer path.
pneumatic
supply, return, exhaust, control, sensing, filter, regulator, valve, reservoir
Compressed air systems.
hydraulic
supply, return, control, sensing, filter, regulator, valve, reservoir
Hydraulic oil systems.
vacuum
supply, return, exhaust, sensing, filter, regulator, valve, reservoir
Vacuum systems.
gas_supply
supply, return, sensing, regulator, valve, filter, reservoir
Gas delivery.
liquid_supply
supply, return, sensing, regulator, valve, filter, reservoir
Liquid delivery.
drain
return, exhaust
Drain outlet.
vent
exhaust
Atmospheric vent.
ethernet
bridge, access_point, client, peer
Layer 2/3 networking.
power_over_ethernet
bridge, access_point, client
PoE with power + data.
wifi
access_point, client, peer
Wireless LAN.
bluetooth
master, slave, peer
BT Classic and BLE.
mqtt, http, https, ssh
client, server, peer
Application-layer protocols.
modbus, profinet, ethercat
master, slave, coordinator
Industrial protocols.
Role Compatibility Pairs
Two interfaces connect when their roles form a recognized pair. The table below covers all built-in pairings grouped by domain.
Electrical Role Pairs
output
input
power, digital, gpio, pwm, analog
source
sink
power, dc_power
transmitter
receiver
digital, pwm, analog, quadrature
master
slave
i2c, spi, bluetooth
host
device
uart, usb, ethernet
peer
peer
uart, can, digital, gpio, ethernet
driver
motor
brushless_3phase, bipolar_stepper_phases
driver
actuator
dc_motor, stepper_motor, stepper_pulse_dir
controller
actuator
servo_control
encoder
receiver
quadrature
sensor
receiver
hall_encoder
debugger
target
swd_debug
transceiver
antenna
nfc_antenna
Mechanical Role Pairs
shaft
driver
mechanical_rotation, mechanical_spline
shield
arduino
arduino_uno_shield
shield
host
pi hat
Thermal Role Pairs
thermal_source
thermal_sink
thermal_connection
Fluid Role Pairs
supply
return
pneumatic, hydraulic, vacuum, gas_supply, liquid_supply
supply
control
pneumatic, hydraulic
supply
exhaust
vacuum
regulator
supply
All fluid protocols
valve
supply
All fluid protocols
Network Role Pairs
bridge
bridge
ethernet
bridge
client
ethernet, power_over_ethernet
access_point
client
ethernet, wifi, power_over_ethernet
peer
peer
ethernet, wifi
master
slave
bluetooth
How Connections Work: Step by Step
Resource Allocation Model
Exclusive by Default
When an interface claims a resource for a function, that resource is exclusively allocated; no other interface can use it. This is the safe default and matches how most physical pins work.
Shareable Resources
Some resources legitimately serve multiple functions simultaneously. The shareable_with field unlocks this:
Here a single RJ45 jack can carry both Ethernet data and PoE power at the same time. Both functions list each other in shareable_with, so a network interface and a power interface can both claim this resource.
Allocation Rules
I2C bus (SDA + SCL)
Two resources: one with i2c_sda, one with i2c_scl.
3-phase motor (A, B, C)
Three resources: phase_a, phase_b, phase_c.
Pin with multiple alternate functions
One resource with multiple functions (mutually exclusive).
PoE port (data + power on same jack)
One resource with shareable_with between functions.
Multi-Domain Interfaces
Some real-world connections span multiple domains. A Power-over-Ethernet switch, for example, needs interfaces in both the electrical and network domains.
When an interface spans domains, reuse the same protocol identifier in each relevant domain. This keeps allocation synchronized. If the protocol (e.g., power_over_ethernet) does not exist in the protocol spec yet, request it from the ProtoPart team or add it yourself before using it in component files.
Interface Constraints
max_instances
Limits how many times the device can instantiate this interface. Use only when the hardware itself imposes a limit beyond what resources would allow.
MCU with 1 I2C controller
max_instances: 1 on the I2C master interface.
MCU with 2 UART peripherals
max_instances: 2 on the UART interface.
Sensor with 8 analog channels
Let the system calculate from resources; no max_instances needed.
max_connections
Limits how many other parts can connect to a single interface instance. This is about electrical, structural, or protocol load limits.
I2C bus
8
Capacitance limits.
Power output
10
Current sharing.
SPI chip select
1
One device per SS line.
Voltage Domain Matching
When requires_matching_voltage_domain is true, both sides of a connection must reference power domains with overlapping voltage ranges. This prevents connecting a 3.3V sensor directly to a 12V output.
Common Interface Patterns
Master side (e.g., Arduino Nano):
Slave side (e.g., BME280 sensor):
Compatibility: master pairs with slave. Both require the same functions, so function links map i2c_sda to i2c_sda and i2c_scl to i2c_scl.
Master side:
Slave side:
Pairs with:
Note: UART TX on one side connects to RX on the other; the function link handles the crossover.
Pairs with any power / input interface.
Supply side (compressor or regulator output):
Return side (actuator input):
Best Practices
Treat the physical connector as the boundary. One plug or cable = one interface. If any pin group could be separated, split it now.
Define both high-level and low-level interfaces. A motor control interface (2 digital + 1 PWM) can coexist with separate digital and PWM interfaces on the same resources.
Use specific roles, not generic ones.
"input"/"output"is far better than"connection".Let the system calculate instances. Only set
max_instanceswhen the hardware itself limits the count beyond what resources allow.Keep interfaces fully specified. Include direction, voltage constraints, protocol timing, and mechanical keying where applicable.
One resource per allocatable unit. Never wrap multiple wires into a single resource.
Last updated

