
Hall breakout
CoraBeanz/linescan-hyperspectral-splatting
A homebuilt pushbroom spectrograph rides a robot arm, and the 3D Gaussian splat it trains stores a full 500–950 nm spectrum in every Gaussian instead of an RGB color.

A homebuilt pushbroom spectrograph rides a robot arm, and the 3D Gaussian splat it trains stores a full 500–950 nm spectrum in every Gaussian instead of an RGB color.
Scan controller is an open-source printed circuit board by CoraBeanz, from the CoraBeanz/linescan-hyperspectral-splatting repository on GitHub, published under the MIT licence. It is a 2-layer board of 95 × 66 mm with 28 parts on 50 nets, routed with 67 tracks and 15 vias.
It is built around the A3144, SMAJ15A and SS34. Its parts include 8 resistors, 5 connectors, 4 diodes, 3 capacitors and 2 ICs. It belongs with the ESP32 boards of this library.
How it works · The rig · CAD model · Optical path · Optiland model · Software · Reconstruction · Roadmap · User's manual · Parts list
A hyperspectral camera records a whole spectrum at every pixel instead of three color channels, which shows things RGB can't, like the sharp rise in a leaf's reflectance just past red. This one is built from M12 board lenses, grating film and a Raspberry Pi camera sensor, for under $500 in optics and scanner parts.
| 1 · Pick a viewpoint | 2 · Sweep the slit | 3 · Train the splat |
|---|---|---|
| The SO-101 arm carries the scanner head to a pose and holds still. Its joint angles, through the robot model, give that pose. | A NEMA 8 stepper turns the scan mirror two microsteps per frame. Each frame is one line of the object by its spectrum, and a 107-line sweep covers about 64 × 43 mm. | Every scan line is a training sample. A C++/CUDA renderer draws the splat through a line-camera model at that line's pose and compares it with the measured line. |
SO-101 follower arm. Photo: TheRobotStudio/SO-ARM100, Apache-2.0. |
Arm. An SO-101 follower from LeRobot, with six STS3215 servos. It only sets the viewpoint, then holds still while the mirror scans. Scanner head. The spectrograph below, plus a first-surface scan mirror on a 60 g NEMA 8 stepper. A TMC2209 driver runs it at 1/32 microstepping from an ESP32, which takes plain-text commands from the Jetson over USB serial. Pose. The arm's joint readings give the head's pose for every line. A Pi NoIR camera on the head reads a printed ChArUco board once, in the head calibration, to measure where the head really sits on the wrist. Light. Halogen lamps, because LEDs give almost nothing past 700 nm. Compute. A Jetson Nano for capture, the calibration warp and the CUDA splat renderer. |
![]() | ![]() |
| The head from below: scan window and hood, pose camera, NEMA 8 stepper, wrist puck. | Lid and stepper hidden to show the optical train. |
The whole rig is a parametric FreeCAD model. One script builds the SO-101 from its URDF, reads the optical spacings from the Optiland model, and wraps the optics in a printable PETG housing that slides onto a puck on the wrist-roll servo. It checks the parts for clashes, the mirror's full turn and the wrist's clearance, and works out the servo load: the 187 g head needs 75% of the shoulder servo's stall torque with the arm stretched out level, and 18% in the folded scanning pose above. The STLs and assembly steps are in cad/.
A 16 mm f/4 objective images the object onto a 50 µm slit, so the instrument sees one line at a time. A field lens right behind the slit steers every point of that line toward the camera. A 25 mm lens, used backward, collimates the light, and a 500 lines/mm transmission grating fans it out by wavelength. A 12 mm f/2 lens, tilted 22° to the first diffraction order, refocuses the fan onto an IMX219 NoIR sensor, so each frame is one line of the object by its spectrum. A 500 nm long-pass filter in front keeps second-order light off the near-infrared end. Why each part is there: final optical train.
Each frame is the scan line (vertical) by its spectrum (horizontal), at about 5.8 px per nm. Spectral lines bow slightly across the frame (smile, up to about 33 px at the line ends) and the line length shifts a little with wavelength (keystone, about 11 px). Both get calibrated once with lamp lines and removed by a warp.
optics/spectrograph_model.py builds the whole train in Optiland with ideal thin lenses and traces it. Tracing changed the design twice: the stock Pi NoIR lens was far too small to catch the collimated beam, and without a field lens most of the light from the ends of the line missed the camera lens.
| Config (ideal lenses) | Light at line center | Light at line ends | Dispersion | Spectral resolution | Pixels along the line |
|---|---|---|---|---|---|
| A: stock Pi NoIR v2 lens | 8% | 0% | 1.5 px/nm | 3.7 nm | 543 |
| B: M12 IMX219 + 12 mm f/2 lens | 92–100% | 12–14% | 5.8 px/nm | 3.7 nm | 2,143 |
| C: B + 18 mm field lens | 100% | 98–99% | 5.8 px/nm | 4.1 nm | 2,204 |
Resolution is geometric, with perfect lenses: the slit image's width over the dispersion. For A and B it is the paraxial estimate. For C it is traced through the grating, which widens the slit image 1.08× as the beam leaves at 22°, and the field lens adds 1.03×. The parts that were bought trace to 4.1 nm as cad/ builds the head, with the field lens curved side to the slit (config E); turned the other way it would be 5.4 nm (config D, design notes). Real M12 lenses will likely land around 5–8 nm. More in the modeling notes.
pip install optiland # tested with 0.6.2
python optics/spectrograph_model.py # prints the table, writes optics/model_output/
python optics/readme_figures.py # redraws the Optiland figures in docs/img/Full output: optics/model_output/results.txt and the ray layouts.
The rig isn't built yet, so every module is written and tested against simulated hardware: the firmware on a simulated rig, the ROS 2 side on a fake servo bus and a simulated mirror, the calibration kit on lamp frames rendered through the Optiland model, and the splat on a synthetic scan with known poses. The instrument simulator ties them together: a digital twin of the whole rig that renders complete scan sessions, raw frames and logged poses, from a scene whose spectra and geometry are known. GitHub Actions runs each module's checks on every pull request that touches it.
| Module | What CI checks | Status |
|---|---|---|
| Scan-mirror firmware | Unit tests on a simulated rig, again under AddressSanitizer and UndefinedBehaviorSanitizer, and the ESP32 build | |
| ROS 2 scan arm | colcon build and colcon test in a ROS 2 Humble container, up to a two-viewpoint scan on mock hardware | |
| Calibration kit | The self-test and unit tests on Python 3.10 and 3.13, and the Jetson's capture commands on Python 3.6 and numpy 1.13 against a stand-in camera | |
| Line-camera splat | CPU build and unit tests, and a small synthetic scan trained end to end; the CUDA build with CUDA 13.4 for a desktop GPU (CI has no GPU, so the GPU tests skip there) | |
| Jetson Nano build | The renderer and trainer built with the Nano's CUDA 10.2 and gcc 7.5 for sm_53, every kernel checked against the Nano's registers and shared memory, and the tests on arm64 Ubuntu 18.04 | |
| Splat viewer | The page's file reader, colour weights, spectra and WebGL2 image against the C++ renderer, then the page itself at a desktop and a phone size, in headless Chromium | |
| GitHub Pages site | Builds the front page and the viewer, opens them in headless Chromium, and deploys them from main | |
| Instrument simulator | The self-test, which scans a relief target, calibrates the simulated instrument and checks the reflectance against the truth, and the unit tests, on Python 3.10 with the oldest packages it allows and on 3.13 | |
| Virtual first light | Nightly: a simulated scan through calibration, conversion, training, export and the viewer's reader, each hand-off checked against the simulator's truth | |
| CAD model | Lint on the FreeCAD scripts | |
| PCBs | KiCad's ERC and DRC on the scan-mirror controller and hall-sensor boards, including the check that each board matches its schematic | |
| Optiland model | Reruns the model and checks that its results, the CAD's as-built optics and the calibration kit's design map are current | |
| README and docs | The diagrams match the scripts that draw them, and every relative link resolves |
Each module's README says how to build and test it locally, and its workflow in .github/workflows/ runs the same commands.
An ESP32 runs the mirror from a 50 µs timer interrupt and keeps a line clock that follows the camera's frames. In a stare scan it steps the mirror at each tick, waits for it to settle, and holds it still through the frame; in a sweep scan it turns the mirror at a constant speed and reports its exact position at each tick. Every line, move and hall-sensor edge is stamped in ESP32 microseconds, so each camera frame can be matched to a mirror angle. Homing finds the middle of a hall sensor's window, which repeats to a microstep, and the TMC2209's current and microstepping are set over its UART, with a watchdog that stops the motor on a driver fault.
The Jetson talks to it in plain-text lines over USB serial rather than micro-ROS, as first planned: there's no agent to run, any serial monitor can drive it, and a ROS 2 node turns it into topics and services. Wiring, first power-up and a bench test with a logic analyser are in firmware/.
ROS 2 Humble runs in Docker on the Jetson Nano, since JetPack 4 is Ubuntu 18.04. A ros2_control driver runs the SO-101's STS3215 servos at 100 Hz. For each viewpoint in a plan, scan_sweep moves the arm, waits for it to stop, and asks the mirror bridge for a sweep. The bridge maps the ESP32's clock onto ROS time, so each line gets the arm's joint angles at the moment the mirror settled. Through the URDF, which takes the head's geometry from the CAD model, those give the head pose and the line-camera pose: one row per line in lines.csv. With mock servos and a simulated mirror the whole stack runs on any Linux machine with Docker, and Foxglove draws every scan line where it lands. The driver also stops the arm on a servo fault, a stall or an e-stop, and keeps the head off the table (arm safety). Setup on the Nano and first steps with the real arm: ros2/.
A synthetic CFL frame after calibration. On the sensor these lines bow by up to 35 px; here each one is a straight column at its own wavelength.
About ten minutes of lamp frames calibrate the spectrograph. A CFL bulb and a neon glow lamp give about 100 lines from 490 to 970 nm, a halogen lamp on PTFE gives the slit's ends and the spectral response, and a red laser pointer checks the result. The calibration kit, hsical, fits the wavelength of every pixel, the warp that straightens the bowed lines (smile) and evens out the slit's length across wavelengths (keystone), and the response that turns counts into radiance or reflectance, then writes a report with pass/fail checks. Its capture commands run on the Jetson's stock Python 3.6; the fitting runs on a PC. Before a scan, hsical check compares a quick CFL frame with the calibration and says whether anything has moved since.
Without the hardware, it is tested on sessions rendered through the Optiland model from a deliberately imperfect copy of the design: shifted on the sensor, with a denser grating, barrel distortion, dust on the slit, the sensor's colour mosaic and noise. At full resolution it recovers the truth to:
| Error against the truth | Result | Limit |
|---|---|---|
| Wavelength of every pixel, rms | 0.020 nm | 0.10 nm |
| Wavelength of every pixel, worst | 0.070 nm | 0.30 nm |
| Laser wavelength | 0.003 nm | 0.20 nm |
| Reflectance of a test scene, rms | 0.8% | 3% |
First light step by step, and how each fit works: calibration/.
Where the head's cameras and mirror really sit on the wrist, measured from one scan of a printed tag board: calibration/headcal/.
The relief target with every second line of the first sweep, the raw frame of the red line, and the whole sweep as the slit really saw it next to what the calibration kit made of the raw frames.
The simulator is a digital twin of the whole scanner: the arm, the scan mirror, the objective and slit, the spectrograph and its camera. Given a scene with known spectra and a scan plan, it renders the raw frame of every scan line and writes a complete session in the rig's own format, with the arm's servo offsets, flex and encoder steps and the mirror's homing error in the log, as the real rig's will have them. Most of it is the repo's own code, imported rather than copied: the URDF's kinematics from the ROS 2 package, the synthetic spectrograph from the calibration kit, and the Optiland design map. Its self-test calibrates the simulated instrument, turns two sweeps of a relief target into reflectance and checks them against the truth: 1.6% RMS reflectance error, and the absorption bands of a rare-earth tile within 0.07 nm.
The Nano is stuck on JetPack 4.6: Ubuntu 18.04, CUDA 10.2 and gcc 7. jetson/ builds splat for its GPU in a container that uses JetPack's own CUDA, and builds the ROS 2 image in a way JetPack's old Docker can manage. A day-one script builds and tests both and times training on the GPU. From a PC, the same scripts build splat with the Nano's compilers, check that every kernel fits the Nano's registers and shared memory, and run the tests on arm64 Ubuntu 18.04. What training needs on the Nano, in memory and time per dataset, and the commands that measure it: splat/docs/nano_budget.md.
Published hyperspectral splatting, such as HyperGS and DD-HGS, trains on full multi-view hyperspectral images. Here the splat trains straight from raw scan lines, through a model of the instrument itself.
Splatting through a non-pinhole camera has precedent in satellite imagery (RPC-GS), and close-range pushbroom cameras have been calibrated for plant phenotyping (Behmann et al. 2015). This project puts the two together on hobby hardware.
The renderer and trainer in splat/ are C++17, with a CUDA rasterizer written for the Nano's CUDA 10.2 and a CPU reference that the tests hold it to. Until there are real scans, they train on a synthetic one: a board with paint patches, a hidden word that only shows past 740 nm, a leaf-green ball and an orange box, scanned through the head's mirror geometry from the CAD model. Each sweep's head pose is off by about 1 mm and 0.3° per axis, as the arm's will be.
The true scene (left), and splats trained from 16 sweeps (middle) and from 8 (right). From 16 sweeps the trainer cuts the pose error from 10.9 px to 0.97 px at 256 px per line, which lines the sweeps up to about 0.15 mm on the board, and it renders the measured lines down to their noise. That takes 16 s on a desktop RTX 4070 SUPER, or under two minutes on a 4-core CPU. From 8 sweeps the ball and the box are seen from too few directions and get painted onto the board, so the rig will scan many sweeps from all around. The model, the CUDA passes and more results are in splat/.
Every Gaussian carries a spectrum, so the viewer can draw a trained splat at any single wavelength, in true color, in color infrared, or as a band index such as NDVI, and it plots the full spectrum of any point you click. Above, in color infrared, the ball's leaf spectrum and the black panel's dye both rise past 700 nm, so both turn red and the hidden word shows. It is plain HTML, JavaScript and WebGL2 with no build step, and its tests check it against the C++ renderer. Open it in your browser, on GitHub Pages.
It also shows what each part of the scene is made of: splat_materials labels every Gaussian by spectral angle against a library of spectra, clusters them and unmixes them, and on the trained splat 97% of the map's pixels get the right material.
Details for each step are in the build order.
| Layer | Built with |
|---|---|
| Optics | Python and Optiland: ideal-lens model now, catalog lenses next |
| CAD | FreeCAD, scripted in Python around the SO-101's URDF |
| Firmware | C++ on an ESP32 (Arduino core, PlatformIO) driving a TMC2209, with Unity tests on a simulated rig |
| Robotics | ROS 2 Humble in Docker on the Jetson Nano: a ros2_control driver for the STS3215 servos, the URDF and the scan sweeps |
| Capture and calibration | Python, numpy and scipy; raw 10-bit frames from the IMX219 NoIR on the Jetson Nano's CSI port, through V4L2 |
| Reconstruction | C++17 and CUDA: line-camera Gaussian splat renderer and trainer for the Jetson Nano |
| Viewer | Plain HTML, JavaScript and WebGL2, tested in headless Chromium with Playwright |
| Simulation | Python and numpy, reusing the calibration kit's and the ROS 2 packages' own code |
| CI | GitHub Actions, a workflow per module |
docs/
├── parts_list_and_design.md parts with vendors and prices, first-order design, build order
├── optical_train_v2.svg optical train drawing (v1 kept alongside)
├── img/ README figures; img/src/ holds the scripts that draw the SVGs
└── site/ the GitHub Pages front page, and the script that builds the site
optics/
├── spectrograph_model.py Optiland model of the spectrograph, configs A–E
├── readme_figures.py traces the model and renders the Optiland figures
└── model_output/ results.txt and ray layouts
cad/
├── so101_hsi_rig.FCStd FreeCAD assembly: SO-101 arm and scanner head
├── build_rig.py builds it, checks clearances and servo load, exports
└── stl/, step/, renders/ printable parts, the head as STEP, images
firmware/
├── lib/scanmirror/ step generator, line clock, commands, homing: plain C++
├── src/main.cpp the ESP32 glue
├── test/ Unity tests on a simulated rig
└── PROTOCOL.md the serial protocol
ros2/
├── so101_scan_*/ ROS 2 Humble packages: driver, URDF, bringup, sweeps, messages
└── docker/, udev/ the container for the Jetson Nano, stable device names
calibration/
├── hsical/ capture, calibration, reports: python -m hsical
└── tests/ pytest on synthetic sessionsmedia/SO101_Follower.webp), used unmodified under the Apache License 2.0; a copy of the license is in docs/img/SO-ARM100_LICENSE.txt. The SO-101 is designed by The Robot Studio in collaboration with Hugging Face.Simulation/SO101), Apache License 2.0.The code, the CAD model and the docs are under the MIT License. The SO-101's URDF and meshes (and their decimated copies in the CAD model) and the SO-101 photo are TheRobotStudio's, under the Apache License 2.0, as listed in Credits.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | M3 | rig:MountingHole_3.2mm_M3 | H1, H2, H3, H4 |
| 3 | 1k | rig:R_0805_2012Metric | R3, R4, R8 |
| 2 | 10k | rig:R_0805_2012Metric | R1, R2 |
| 2 | 220 | rig:R_0805_2012Metric | R5, R6 |
| 1 | 100nF | rig:C_0805_2012Metric | C2 |
| 1 | 100uF 25V | rig:CP_Radial_D6.3mm_P2.50mm | C1 |
| 1 | 12V | rig:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J2 |
| 1 | 12V 5.5x2.1 | rig:BarrelJack_Horizontal | J1 |
| 1 | 1nF | rig:C_0805_2012Metric | C3 |
| 1 | 4.7k | rig:R_0805_2012Metric | R7 |
| 1 | 500mA | rig:Fuse_1812_4532Metric | F1 |
| 1 | A3144 | rig:JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical | J4 |
| 1 | BTT TMC2209 V1.3 | rig:StepStick_Socket_BTT_TMC2209 | U2 |
| 1 | ESP32-DevKitC (38-pin) | rig:ESP32-DevKitC_Socket | U1 |
| 1 | Jetson | rig:PinHeader_1x03_P2.54mm_Vertical | J5 |
| 1 | NEMA 8 | rig:JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical | J3 |
| 1 | SMAJ15A | rig:D_SMA | D2 |
| 1 | SS34 | rig:D_SMA | D1 |
| 1 | UART on pin 4 | rig:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels | JP1 |
| 1 | green | rig:LED_0805_2012Metric | D3 |
| 1 | red | rig:LED_0805_2012Metric | D4 |

CoraBeanz/linescan-hyperspectral-splatting
A homebuilt pushbroom spectrograph rides a robot arm, and the 3D Gaussian splat it trains stores a full 500–950 nm spectrum in every Gaussian instead of an RGB color.


EdgeCoil/wiegand-bridge
ESP32-S3 Wiegand reader bridge for Home Assistant: 4-layer board, BOM and ESPHome firmware.

comedy1982-spec/pcb-viewer
Dadu 기반 ELD 솔레노이드 ECU. 12 V 입력, TC364 · CAN-FD · PMIC, PCB 위 센서는 NTC 하나. A4911(3상 드라이버)의 A·B 레그로 H-브리지(하프브리지 IAUC60N04S6N050H ×2, 레그 션트 2 mΩ ×2), C 레그는 비워 두고 SPI로 그 고장(VC · CHO · CLO · OC3)을 마스크.


HeyPCB/iris-brainstem
Iris Brainstem: power and servo hub of the Iris robot head. 9 V USB-C PD in, 6 V / 5 A servo rail in stitched copper zones (measured), 5 V rail, half-duplex servo bus with ten ports, speaker amp.

SmallCoral/c5-car
用 KiCad 10 打开 CoralC5-Expansion.kicadpro。这是 Coral-C5 的单槽扩展板,顶部 J14 接核心板,左右 J9、J8 各一组 2×24 排针,下方放 RJ45 和 microSD,右侧放 ESP32-C3-MINI-1U。100×86mm 板框为本项目暂定尺寸。


thelad-dev/ESP32-USB-PWM-Board
ESP32-Firmware & Hardware für 4-Pin-PWM-Lüfter: Duty-Steuerung, Tacho/RPM, serielle CLI.
It measures 95 × 66 mm and has 2 copper layers, 1.6 mm thick.
28 parts, built around the A3144, SMAJ15A and SS34. 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.
From the CoraBeanz/linescan-hyperspectral-splatting repository on GitHub, at the commit this page was made from: the board is pcb/scan_controller/scan_controller.kicad_pcb and its schematic pcb/hall_breakout/hall_breakout.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
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).