A gloved hand holding the eyepiece, with a bright band of rainbow light, red through violet, inside it

First light: the spectrum through the eyepiece.

Hyperspectra

A portable line-scanning hyperspectral camera I built to see past human vision, from visible light into the near infrared.

Context
Personal project, 2025–present
Role
Optics, hardware prototyping, calibration
Hardware
OpenHSI optical design, a XIMEA camera with a Sony sensor, an NVIDIA Jetson on battery, and 3D-printed mounts. About $3,500.
Tools
Capture and processing software built with AI coding agents. AI is my general assistant for research and prototyping; I direct the work and test the result.
Code
github.com/christophernagel/hyperspectra

Why

It's for my own learning. I wanted to understand hyperspectral imaging and remote sensing from the inside: what's in the light around us that our eyes never register, and how you capture it.

It's one of three linked projects. The camera is about the physics of capture, the analysis software is about understanding the data, and the Spectral Light Lab is about how I want people to experience it.

The build

The optical design follows OpenHSI, an open-source hyperspectral camera. Light passes through a slit 25 microns wide, a collimating lens and a diffraction grating, then lands on a XIMEA camera with a Sony sensor. Each frame records one line of the scene, spread into its wavelengths. A motorized gantry will sweep that line across a scene to build a full image.

A Jetson computer runs capture from a battery pack, so it works in the field. It cost about $3,500, most of it the XIMEA camera. I did the optics, 3D-printed mounts, assembly and troubleshooting by hand, and went through several versions of the mounts and the battery clip. I directed AI for the capture and processing software.

Parts on a desk: the camera body with its heat sink, a lens tube, gray 3D-printed brackets, and packing bagsParts on the desk
Looking through a lens tube toward a window, with the thin bright line of the slit at its centerLooking through the slit
The first assembly: camera, white printed mount, and lens tube on paper, with spare printed parts and hex keysFirst assembly, printed mounts
A gloved hand holding up a small square diffraction grating that splits window light into two rainbow streaksThe diffraction grating
A tan 3D-printed enclosure part held in front of a laptop showing its CAD modelThe enclosure and its CAD model
The Jetson computer stacked with its power components and a USB power meter on top, cabled up on cardboardThe Jetson and power stack
From parts to a portable camera.

Trusting the measurement

Getting a spectrum to appear was easy. Knowing which parts of it to believe took a series of fixes, each removing one reason for doubt.

An early raw frame on the Jetson's screen: a soft, bright rectangle of lightAn early raw frame
A raw frame of the white LED at 5 ms: a horizontal band of light with fine lines across itThe white LED at 5 ms
Raw frames on the Jetson's screen. Each frame records one line of the scene, spread into its wavelengths.

Calibration

I calibrated against a mercury-argon lamp, whose emission lines sit at known wavelengths. I matched 17 lines and fit a curve from sensor column to wavelength. It lands within about 0.56 nm of the known lines on average, and a second exposure gave 0.561 nm.

A raw sensor frame of the mercury-argon lamp: a row of bright vertical lines on a noisy gray background, a few strong ones at left and a dense cluster at rightRaw frame
The same lamp capture after processing: thin, sharp vertical lines on a black backgroundProcessed
The mercury-argon lamp on the sensor, raw and processed. Each vertical line is an emission line at a known wavelength, and wavelength increases from left to right.

Field test

In a parking lot, I pointed the camera at black, white, red and leaf targets. These are very different materials with well-known spectral signatures, so I could compare the camera's response with catalogued spectra. The leaf shows the red edge, the sharp rise near 700 nm that marks healthy vegetation.

The field test: the camera rig on a van floor, cabled to a box of targets on the pavement in full sunThe parking-lot test
A contact sheet on the Jetson's screen: raw frames from each target with green boxes marking the regions measuredRegions marked on each target
Targets in a box in full sun, and the contact sheet the Jetson made from them.

The white target became a second check on the calibration. Its curve dips at the Fraunhofer lines, dark lines in sunlight at known wavelengths: hydrogen near 486 and 656 nm, magnesium near 517, sodium near 589, and two oxygen bands from Earth's atmosphere near 687 and 760 nm. Each dip lands 1.5 to 3 nm short of its known wavelength, a consistent shift larger than the lamp calibration's 0.56 nm. The 760 nm dip shows in the white, red and leaf curves alike, because it's in the sunlight itself.

A line chart of median raw sensor counts from 450 to 850 nm for four targets. The white curve is highest, with sharp dips near 485, 515, 587, 653, 685 and 758 nm. The leaf curve rises steeply after 700 nm. The black curve stays near zero.
Raw sensor counts from the parking-lot test, before reflectance calibration. The dips in the white curve are Fraunhofer lines in sunlight.

Next