The part of Kernel Flow that touches your head: lasers in, light back out. I designed the first-generation module for Flow 50, and the second generation optical module in Flow2, from the optics to the housing to the snap features that hold it together.
Both modules do the same thing: send short near-infrared laser pulses into the scalp and collect the light that scatters back, for time-domain functional near-infrared spectroscopy (TD-fNIRS). The first generation proved the architecture with one source per module. The second packs three sources into a smaller module, builds the heat sink into the base, adds an on-board reference channel for the laser's instrument response, and replaces screws with snap features wherever an optic has to be held.


| Generation 1 (Flow 50) | Generation 2 (Flow2) | |
|---|---|---|
| Sources | 1 laser pair | 3 laser pairs (753 + 905 nm) |
| Detectors | 6 | 6, plus a built-in IRF reference detector |
| Heat path | Machined base, prototype heat sink | Heat sink built into the base; detector ASICs sunk directly into it |
| Assembly | Screws throughout | Snap-fit optics, spring-loaded light pipes, bayonet lock to the headset |
| EMI | Not integrated | Shield built into the module |
| Module power (design case) | ~909 mW | ~988 mW, with three times the sources |
| Per headset | 52 | 40 |
The first module I took to production: a hexagonal stack with one source light pipe in the middle and six detector lenses around it, 52 of them tiling a Flow 50 headset. Its lenses and micro-prism are my drawings, and the housings and tray carry the module's mechanical design.
The first review of the second generation set out what it had to improve: more sources and detectors in one module, a heat sink built into the base, a built-in IRF detector, direct heat-sinking of the SPAD ASICs, integrated EMI shielding, and less volume.

Pull the module apart with the slider and click any part to see what I did on it. The source optic, the shroud and the optics tray each get their own deep dive below.
Each source has to satisfy two requirements that pull against each other. TD-fNIRS is photon-starved, so every bit of laser power lost in the optics is signal lost from the brain. But the light leaves the module pressed against skin, a short distance from eyes, and laser safety is judged on how concentrated it is: a tight, collimated beam is the worst case even at modest power.
The answer is a chain of molded PMMA optics. Two edge-emitting laser diodes (753 and 905 nm) fire sideways; a micro-prism turns their light upward and an aspheric surface collimates it, both in one molded source lens. A spring-loaded light pipe then carries the light to the scalp. Its bounces are specular total internal reflections, which keep the power, and its length and narrow input angles mix the beam spatially, which flattens the peak at the exit.
Past the skin, any residual structure stops mattering: transmission into skin stays near 97% out to about 45° incidence, which covers most of the pipe's output, and within about a millimetre of tissue scattering has erased any memory of direction. What reaches the brain depends on the power delivered at the surface.
A black shroud snaps onto each pipe's flange. It carries the pipe's spring on axis, blocks stray source light from the detectors next to it, and has one more job that's easy to get wrong: it must never touch the pipe's guiding surface.

I rebuilt the source stack's OpticStudio non-sequential model as a Monte Carlo ray trace in Python, using the production CAD for every optical surface: the source lens with its silver-coated micro-prism, the light pipe, and the shroud as an absorber. Each wavelength gets a million rays, launched from the 905 nm diode vendor's measured ray file and a diode emission model for 753 nm, with Fresnel splitting and total internal reflection at every surface.

The two edge-emitting diodes face each other across a V-groove molded into the bottom of the source lens. Its two 45° faces are silver-coated, so each beam enters the lens from the side and is turned straight up, and both beams leave through the same aspheric dome on either side of the axis.
The light pipe's aspheric entrance then focuses both beams into the mouth of a tapered square tunnel. Each wall reflection folds the beam back on itself, so the exit face sees many mirrored copies of the input overlapping, and the two beams arrive at the scalp sharing one footprint. The slow axis of the 753 nm diode is narrow, so that beam bounces less side to side and stays a little narrower across the tip.

Irradiance across the exit, scaled to each wavelength's own peak. The dashed square is the pipe's tip face. Hover for values.
Time-domain fNIRS measures when each photon comes back, so every measurement is convolved with the instrument response function (IRF): the combined shape and timing of the laser pulse and the detector. If a laser's pulse drifts with temperature or age, the IRF drifts with it, and so does every depth estimate built on it. The second-generation module measures its own IRF while it runs.
One molded acrylic light guide sits across the module's three source lenses, and each source beam passes straight through its pad on the way to the light pipe. The guide needs no tap in the beam: a small fraction of the light scatters at the pad's molded surfaces, and the part that lands at guided angles is carried down the arm by total internal reflection. At the hub, angled faces turn it down onto a dedicated IRF detector. The sources are multiplexed, so one detector reads all three in turn.
The render is the same Monte Carlo trace as above, run through the production guide with a small Lambertian scatter at its surfaces: the beam continuing to the light pipe is dim, the scattered light filling the arm is brighter, and the light that reaches the IRF detector is brightest.

Total internal reflection is not quite total. At every bounce an evanescent field reaches a short way into the air outside the pipe. If anything with a higher index comes within that distance (say, a black plastic shroud), the reflection is frustrated and light tunnels straight into it and is absorbed. Every touch point would be a light leak on the one part whose job is to deliver photons.
The field decays exponentially away from the surface, with a depth set by the wavelength and how steeply the ray meets the wall:
For PMMA (n₁ ≈ 1.486) into air, the critical angle is about 42°. Rays just past it reach a few hundred nanometres out; steep rays, barely a hundred. The chart is the full three-layer calculation (PMMA, an air gap, then a black ABS wall) of how much of one bounce's power escapes into the wall as the gap closes.
So the shroud grips the pipe only at its flange, where the snap arms retain it and no guided light is reflecting, and stands off everywhere else. The cavity is drawn with a 1° draft and a perpendicularity tolerance to the snap datum so the clearance holds across the tolerance stack. That gap is more than a hundred decay depths: on this chart it would sit about forty chart-widths to the right, where the leakage is zero to any precision that matters.
Model: frustrated TIR, PMMA / air / ABS (n 1.54), TE and TM averaged. θ is the ray angle from the wall normal inside the pipe.
Every lens in the release module sits in one molded part: three source lenses and six detector lenses, plus a cutout for the internal IRF detector. All nine optical axes are toleranced as true positions to the same two datums, so the optics line up with the detectors on the board below by construction rather than by adjustment.
Each lens drops into a pocket and is held by small flexure arms molded into the tray: the arm deflects as the lens goes in and springs back over it. The arms have to be soft enough not to crack or crush the optic during assembly, stiff enough to hold the lens through a headset's life, and simple enough to mold.
Initial injection-molding release.
Snap features reworked for additional 0.063" ejector pins, so the tray releases cleanly from the mold.
The requirement pulls two ways: the housing against the skin must stay comfortable (target ≤ 45 °C module wall), and the SPAD detector ASICs want to run as cool as possible. Three laser pairs and seven ASICs put about 1 W into each module, so I made the base the heat sink and ran a design of experiments in SolidWorks Simulation: convection coefficient, fin height, thermal interface material and ASIC pedestals.

A later Flow2.x headset revision needed modules that carried their own fins without adding much mass across 40 positions. I simulated a family of fin designs, from a first finned base at 25.5 g down to 15.5 g, and traded simulated module temperature against mass. Radial fins at 5 to 6 mm came out cooler than the heavy first design for far less mass. Measured on a headset from a cold start, every finned variant settled around 46 to 49 °C after an hour, while the standard modules reached about 58 °C.
SolidWorks Simulation, same boundary conditions for every design.
When the shorter-wavelength source moved to 753 nm, the detectors' dual-band IR bandpass filter had to move its first passband up from 690 nm to cover it while keeping the 905 nm band. Interference filters shift toward shorter wavelengths as light arrives off-axis, and the light returning from the scalp arrives over a wide cone, so I checked both bands against the laser lines from 0° to 50° angle of incidence before releasing the new design.
Step through the angles: the passbands slide left and narrow, and both laser lines stay above 96% transmission all the way out to 50°.