Standalone CNC line scan camera

2026-06-12

I use my line scan camera to take cool pictures of trains and other stuff.

Piccadilly line.

FIGURE 1 Piccadilly line.

Download

For more information about how it works and the algorithms I use to process the images, see: line scan camera image processing.

But heretofore I had to plug it into my laptop, which was kinda annoying for many reasons.

Dongle hell with the Macbook.

FIGURE 2 Dongle hell with the Macbook.

EXIF data
Camera
Apple iPhone 14 Pro Max
Lens
iPhone 14 Pro Max back triple camera 6.86mm f/1.78
Aperture
f/1.8
Shutter
1/147 s
ISO
ISO 64
Software
26.0
Date
Download
A dropped frame can really ruin a capture. Here, the end of car 5519, near 5521, was missing a slice.

FIGURE 3 A dropped frame can really ruin a capture. Here, the end of car 5519, near 5521, was missing a slice.

Download

1 The camera

OK here it is!

Left side.

FIGURE 4 Left side.

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/3.5
Shutter
1/80 s
ISO
ISO 2000
Software
darktable 5.5.0+1479~g9e36df0344
Date
Download
Right side.

FIGURE 5 Right side.

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/3.5
Shutter
1/85 s
ISO
ISO 2000
Software
darktable 5.5.0+1479~g9e36df0344
Date
Download
Front side.

FIGURE 6 Front side.

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/5.0
Shutter
1/34 s
ISO
ISO 2000
Software
darktable 5.5.0+1479~g9e36df0344
Date
Download
Rear side.

FIGURE 7 Rear side.

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/5.0
Shutter
1/80 s
ISO
ISO 2000
Software
darktable 5.5.0+1479~g9e36df0344
Date
Download

Here are slightly older pics with worse 3D printed battery holder, bezel, and no wifi hat.

Trying it out.

FIGURE 8 Trying it out.

EXIF data
Camera
FUJIFILM GFX100S
Lens
GF55mmF1.7 R WR
Aperture
f/11.0
Shutter
1/42 s
ISO
ISO 640
Software
darktable 5.3.0+959~gf86f0af591
Date
Download
Rear side.

FIGURE 9 Rear side.

EXIF data
Camera
FUJIFILM GFX100S
Lens
GF55mmF1.7 R WR
Aperture
f/11.0
Shutter
1/42 s
ISO
ISO 640
Software
darktable 5.3.0+959~gf86f0af591
Date
Download

1.1 Bill of materials

Here’s the BOM (prices are approximate):

ComponentApprox. Cost
Alkeria Necta N4K2-7C$2000
NVIDIA Jetson Orin Nano Super$250
Intel 670P 2TB SSD$55 back in 2022, probably like $300 now lol
CNC case$110
Three-key Bluetooth macro pad$20
7 inch 1080P 2000 nit touchscreen$70
Short USB-A to USB-C cables$5
Short USB-A to right angle micro USB 3 cable$5
Short HDMI cable$15
USB-C PD to barrel plug adapter$7
Anker power bank$60
Table 1
Block diagram of how it's connected. The SVG was generated by AI but it looks right to me.

FIGURE 10 Block diagram of how it’s connected. The SVG was generated by AI but it looks right to me.

Download

1.2 Case design

I modelled the case in Rhinoceros 3D.

I ordered it from JLC CNC for about RMB 831, which is like $110.

JLCCNC order screenshot

FIGURE 11 JLCCNC order screenshot

Download
Sendcutsend would have cost ten times as much.

FIGURE 12 Sendcutsend would have cost ten times as much.

Download
3D printed prototype

FIGURE 13 3D printed prototype

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/8.0
Shutter
1/15 s
ISO
ISO 3200
Software
darktable 5.3.0+959~gf86f0af591
Date
Download
A pile of 3D printed rejects.

FIGURE 14 A pile of 3D printed rejects.

EXIF data
Camera
Apple iPhone 14 Pro Max
Lens
iPhone 14 Pro Max back triple camera 6.86mm f/1.78
Aperture
f/1.8
Shutter
1/40 s
ISO
ISO 320
Software
26.3
Date
Download
Transferring the guts from the old 3D printed prototype to the shiny metal one.

FIGURE 15 Transferring the guts from the old 3D printed prototype to the shiny metal one.

EXIF data
Camera
FUJIFILM GFX100S
Lens
GF55mmF1.7 R WR
Aperture
f/16.0
Shutter
1/42 s
ISO
ISO 1000
Software
Digital Camera GFX100S Ver2.13
Date
Download

1.3 Setting up the Jetson

I picked the Jetson because it has low price and great compute compared to the similarly priced Raspberry Pi 5.

I wanted to only use the NVME M2 2280, and apparently the only way to do so is to use the NVIDIA SDK Manager, which requires a x86_64 Ubuntu 24.04 machine. It was really annoying. I couldn’t do it from my Arch Linux machine (must be Ubuntu), another Jetson (not x86), or my Windows machine, but was eventually able to do it by actually using a Ubuntu desktop. The process was also really finicky with its USB cable requirements. I had to plug in the cable in the back of the PC.

Another unanticipated issue was that the Jetson doesn’t keep time when powered off due to not having an RTC battery. Sometimes, my photos end up being out of order.

My friend soldering an RTC battery

FIGURE 16 My friend soldering an RTC battery

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/2.8
Shutter
1/70 s
ISO
ISO 125
Software
Digital Camera GFX100S Ver2.13
Date
Download

Actually, you can just bridge R560 with solder. Some people online painstakingly solder a 560 mΩ SMD resistor which is super difficult. I think the actual resistance is supposed to be 1 kΩ and the “R560” is just the name of the part and not the resistance.

Pinout

FIGURE 17 Pinout

Download
It works.

FIGURE 18 It works.

EXIF data
Camera
FUJIFILM GFX100S
Lens
SIGMA 70mm F2.8 DG MACRO A018
Aperture
f/2.8
Shutter
1/160 s
ISO
ISO 100
Software
Digital Camera GFX100S Ver2.13
Date
Download

1.4 Touchscreen

Touchscreen specs

FIGURE 19 Touchscreen specs

EXIF data
Date
Download

The good news is that the touchscreen is super bright (2000 nits), so it is easily legible in daylight unlike the Macbook.

Also, it is powered by 5V USB (you can also power it by a barrel plug if you want), so I could just plug it into the Jetson and it just works.

1.5 Capture UI

It’s implemented in C++ with Dear Imgui.

GitHub code

I set up a systemd thing to launch it automatically upon boot.

Live debugging in the field.

FIGURE 20 Live debugging in the field.

EXIF data
Camera
Apple iPhone 14 Pro Max
Lens
iPhone 14 Pro Max back triple camera 6.86mm f/1.78
Aperture
f/1.8
Shutter
1/1321 s
ISO
ISO 80
Software
26.3
Date
Download

I set up a keybinding to toggle capture on/off with the spacebar so that I can control it wirelessly with a Bluetooth macro pad, to avoid shaking the camera when capturing.

2 Future ideas

I’d do these differently next time:

Another idea is to add a regular video camera (i.e. an area-scan camera) to the thing. That would help measure the speed of the train as well as help me see which part of the scene the line scan camera is looking at.

Right now, the tripod quick release plate (a Peak Design plate) is attached by a single M4 screw. I’d like to use two screws instead attached to the Alkeria camera for better strength.

3 Other people's line scan cameras

3.1 Adam Magyar

Adam Magyar and his “Einstein’s Camera” is perhaps the most famous one.

Adam Magyar and his line scan camera.

FIGURE 21 Adam Magyar and his line scan camera.

Download

His monochrome line scan camera takes really clean images even in low light, but is huge and needs a backpack. To be fair, it was over a decade ago.

3.2 Seth Itow

My former colleague Seth created his handheld battery-powered line scan camera independently after being inspired by my previous stuff.

Seth's line scan camera.

FIGURE 22 Seth’s line scan camera.

Download

4 FAQ

Do you actually carry it with a strap attached to those Peak Design anchor links?

Good heavens no! It’s just a meme.

What lenses do you use?

In customizing my line scan camera I mentioned that I converted it to Sony E mount (manual only, no electronic contacts).

I use a Cheecar 50mm f/1.2 and a Samyang 85mm f/1.8 CS, both manual focus for Sony E mount (APS-C). The line is 28mm long so an APS-C lens covers it while being affordable.

I also have a variety of full frame lenses that I occasionally use on both this and my Fuji GFX camera, including:

My Cheecar and Samyang have a IR-block filter, but the Voigtlanders don’t. Actually, I had one for the 90mm, but I smashed it accidentally.

Before vs after putting on the IR-block filter.

FIGURE 23 Before vs after putting on the IR-block filter.

Download
How long does the battery last?

The Anker battery lasts about 1 hour. It is nice because it has a display indicating the amount of charge remaining, and it has a built-in USB-C cable capable of outputting PD 20 V and more than the 35 W needed for the setup.