Isai Olvera
Work / Kernel, 2019–2026

Flow 50 Sync Box

A USB accessory that lets a neuroscience lab plug its own instruments into Kernel Flow: stimulus computers, button boxes, pulse sensors, accelerometers. Every trigger and every analog sample lands on the same clock as the brain data. I designed the enclosure; Kernel's electrical team designed the two boards inside it.

Tap or hover a port. Filter by signal:

Connector positions are taken from the connector board's layout file; the case outline is drawn approximately until the CAD is exported.
RoleDesigned the enclosure and released the assembly (90-0015-00)
Inputs and outputs8 analog · 2 high-speed analog · 8 digital · sync
ConnectionUSB-C (power and data)
ReleasedMay 2021
Why it exists

Brain data is only useful if you know what happened when

Kernel Flow records brain activity with time-domain fNIRS. Researchers coming from traditional optical NIRS systems expected to wire the rest of their lab into the recording: a stimulus computer that marks each trial, a response box, a pulse oximeter or skin-conductance sensor, sometimes a motion sensor. Each of those signals means little unless it is aligned with the brain data to well under a sample.

The sync box is that bridge. It takes analog and digital signals through BNCs and spring terminals, timestamps them on its own precision timer and streams them over the same PC that records the headset. A sync cable from the Flow hub disciplines its clock, so a trigger edge and the optical samples share one timeline. Without the cable the two devices can only be aligned through the PC's clock, to about a millisecond; with it the target is a microsecond.

Flow headsetFlow hubRecording PCSync boxLab instruments optical modulesFlow software,one data filethis pagestimulus PC, buttonbox, pulse, motion sync cable:time + edge,once a secondUSBUSB-CBNC
Inside

Each analog channel is configurable in software

Each of the eight analog channels can be an input, a trigger or an output, chosen in software. Two connectors serve it: a BNC pair for coax and a spring terminal for bare wire, wired in parallel. Behind them sit clamp diodes, a switch that decides whether the channel is single-ended or differential, a 16-bit converter that samples all eight channels at the same instant, and a comparator whose threshold comes from an 8-channel DAC.

ConnectorBNC pair orspring terminal ClampsSchottky diodesto the rails IN− selectIN− tied toreference 16-bit ADC8 ch, simultaneous,programmable gain Comparatoredge → digital 8-ch DACthreshold or output MicrocontrollerSTM32H742, 480 MHztimer capture ofevery edge, 1 µssample packets USB 2.0 HSto recording PC SPII²C

Digital I/O

Event markers as 8-bit codes

Stimulus software usually marks events by writing an 8-bit code to a trigger port: 1 for a face, 2 for a house, 255 for the end of a block. So the box treats its eight digital lines as a symbol, not as eight separate wires. When any configured edge arrives, it latches the state of all eight lines and stamps it with its microsecond timer. The Flow software shows the code in hex and, when it reads as text, as an ASCII character.

Each line can also be an output, driven from Python, to trigger someone else's equipment. And the lines double as the microcontroller's serial ports: DIO0–1 a UART, DIO2–3 I²C, DIO4–7 SPI, for talking to active sensors.

A simulation: timestamps come from your browser's clock since the page loaded.

box time (µs)binaryhexdecASCII
Set some lines and send an edge.
Keeping time

A clock that locks to the hub and survives a pulled cable

The box keeps its own real-time counter from a crystal reference. Through the 2.5 mm sync cable the Flow hub corrects it once a second, using a single wire for both the message and the timing edge. Between corrections, and whenever the cable is out, the box free-runs on its own clock; the next valid edge pulls it back. It behaves like a phase-locked loop.

hub linebox pin "at the next edge, time = T" sync edge UART receive timer capture armed UART receive pin re-muxed, 100 ms timeoutedge captured → clock = T;hub line back to UART idle(no edge in 100 ms → keep own clock) < 100 ms
  1. Once a second the hub sends a short UART packet: "at precisely the upcoming edge, the time will be T."
  2. The box decodes it, switches the same pin from its UART to a timer's capture input and starts a 100 ms timeout. The hub switches its side of the wire to a timer output.
  3. The hub's timer drops the line at the exact compare value. The box's timer captures that edge in hardware, and the box sets its clock to T at the captured count.
  4. Both pins switch back to UART. If the edge never comes (cable pulled mid-exchange), the timeout returns the pin and the box carries on with its own clock.
  5. Two boxes chain the same way: DIO1 of the first carries packets and edges to DIO0 of the second.

Illustration, not measured data: box clock error against the hub, not to scale.

My part

The enclosure

The connector board carries every port, so the case is built around it: the top case is the front panel. Both halves are machined 6061 aluminium in RAL 9023 pearl dark grey, and the channel names are machined through the finish so they read as bare metal. Pull the box apart and click a part.

The sync box exploded vertically: four corner screws on top, the top case with its 19 BNC holes and engraved labels, the connector board with BNCs and terminal blocks, standoffs, the small base board, dowel pins, the base case and four rubber feet.
Drag to orbit · ctrl + scroll to zoom · click a part
Loading 3D model…
The assembled sync box on black at a three-quarter angle: a dark grey aluminium case with 19 BNC jacks in a grid, spring terminal blocks recessed at each end, engraved channel names, the 2.5 mm sync jack and the USB-C slot in the front wall.
Assembled. Rendered from the SolidWorks assembly; the boards are the KiCad models, so every component sits where it was placed.
Specs

What the box does

Analog inputs8 channels, single-ended or differential, sampled simultaneously by a 16-bit converter at up to 1 kHz (100, 250, 500 Hz settings), programmable gain
High-speed analog2 inputs (or 1 differential pair) on the microcontroller's own ADC, up to 10 kHz
TriggersAny analog channel can be a comparator with a DAC-set threshold; rising, falling or either edge, time-stamped
Analog outputsUp to 8, shared with the analog channels, driven by the on-board DAC; the output value is reported in the data stream
Digital I/O8 lines, each an input or output; edges time-stamped to 1 µs with all 8 lines captured as one byte; UART, I²C and SPI on the same pins
Synchronisation2.5 mm jack to the Flow hub (time packet plus edge, once a second) and a sync BNC; free-runs without; chainable between boxes
Connectors19 BNC · 8 six-way spring terminal blocks · 10-pin digital header · 2.5 mm sync jack · USB-C
Host linkOne USB-C cable for power and data, USB 2.0 High-Speed
ElectronicsSTM32H742 microcontroller; 4-layer base board and 2-layer connector board, stacked (designed by Kernel's electrical team)
EnclosureTwo-part case, front panel engraved; assembly 90-0015-00, released May 2021 (mine)