---
title: "Standalone CNC line scan camera"
date: "2026-06-12"
---


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

![Line scan camera](https://i.dllu.net/2026-06-12-14-42-35_DSCF9449_9158819d1ea5e54db2ef2c9ec8fb8a5df0096d66_db32eb1cbff1395c.jpg)

![Piccadilly line.](https://i.dllu.net/preview_stack_2583fc2d272e3430.jpg)

For more information about how it works and the algorithms I use to process the images, see: [line scan camera image processing](/blog/2025-09-21-line-scan-camera-image-processing).

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

* I have to carry a laptop around
* The [Macbook Air](/blog/2024-12-01-asahi-linux-with-sway-on-the-macbook-air-m2) I was using has only a 256GB SSD which necessitates bringing an external SSD
* On the Macbook Air, there were some bugs with sometimes the camera negotiating only a 480 MB/s USB2 link instead of the 5 Gbps one, leading to dropped frames
* It just doesn't look cool and stylish like a custom made standalone camera
* Screen isn't bright enough

![Dongle hell with the Macbook.](https://i.dllu.net/IMG_6269_2c28d64023943e34.JPG)

![A dropped frame can really ruin a capture. Here, the end of car 5519, near 5521, was missing a slice.](https://i.dllu.net/preview_stack_2eee326a600a6214.jpg)

# The camera

OK here it is!

![Left side.](https://i.dllu.net/2026-06-12-14-45-42_DSCF9452_251825cd942a577b55b9bcb3a862134297d6feb5_03dc2cfddc500320.jpg)

![Right side.](https://i.dllu.net/2026-06-12-14-46-35_DSCF9453_9ccfa6a9c4ac6a63b7fb8e752b39d0ff4608c922_3ca07a385350be54.jpg)

![Front side.](https://i.dllu.net/2026-06-12-14-47-31_DSCF9454_5823d38781e0f753ad605c1cbdc5c5e8a86af4c7_bef187eb595845fd.jpg)

![Rear side.](https://i.dllu.net/2026-06-12-14-48-29_DSCF9455_a1b9716638aadf41b6e6350a487ed2dfa8cd1a14_4d6d2b60e047819d.jpg)

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

![Trying it out.](https://i.dllu.net/2026-02-10-16-30-27_DSCF6372_1e7b93cfd8b8633d610b1f5067394ffee4e9fcee_acece33166506850.jpg)

![Rear side.](https://i.dllu.net/2026-02-10-16-29-59_DSCF6371_77d42d9b295b3965d946b7d3ce5e7ecf9a5d1635_5918c65f00b8eca0.jpg)

## Bill of materials

Here's the BOM (prices are approximate):

| Component | Approx. Cost |
| --- | --- |
| [Alkeria Necta N4K2-7C](https://www.alkeria.com/products/necta-series) | \$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 |

![Block diagram of how it's connected. The SVG was generated by AI but it looks right to me.](linescan_blockdiagram_simple.svg)

## 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](https://i.dllu.net/image_fe5ab46442d93d4b.png)

![Sendcutsend would have cost ten times as much.](https://i.dllu.net/image_11457805bae5fead.jpg)

![3D printed prototype](https://i.dllu.net/2026-01-04-21-28-28_DSCF3171_7f0aded00a1f1731dc77189c3fcd4bf90afe871f_f6bc57b107a7ecfe.jpg)

![A pile of 3D printed rejects.](https://i.dllu.net/IMG_8285_c825215b50996f29.jpg)

![Transferring the guts from the old 3D printed prototype to the shiny metal one.](https://i.dllu.net/2026-01-17-08-23-35_DSCF3779_7809801ffb7f61a8560c0ce0f077b735e049df71_bfea71e73edcfbb7.jpg)

## Setting up the Jetson

I picked the Jetson because it has a 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 an 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 an Ubuntu desktop.
The process was also really finicky with its USB cable requirements.
I had to plug the cable into 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](https://i.dllu.net/2026-06-11-20-19-53_DSCF9443_dc9b5e48ca122f2af434aed7d1484800b665f87f_b37a028a3dfd3eac.jpg)

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](rtc_j3_d4_pinout.svg)

![It works.](https://i.dllu.net/2026-06-11-21-04-15_DSCF9447_a4b3b5e27e7fbe5499992f8670b6a2ca49c5c5a4_119cf0c781c28389.jpg)

## Touchscreen

![Touchscreen specs](https://i.dllu.net/IMG_4761_f0d1585d9fa874b8.jpg)

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.

## Capture UI

It's implemented in C++ with Dear ImGui.

:: GitHub code https://github.com/dllu/nectar

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

![Live debugging in the field.](https://i.dllu.net/IMG_8555_ea2d6032483b15ff.jpg)

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.

# Future ideas

I'd do these differently next time:

* Add screw threads to the CNC case
* My wifi hat protrudes weirdly because my screws aren't long enough and again, no screw threads. So I had to use standoffs.

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.

# Other people's line scan cameras

## Adam Magyar

[Adam Magyar's "Einstein's Camera"](https://medium.com/matter/einsteins-camera-88aa8a185898) is perhaps the most famous one.

:: Adam Magyar's "stainless" project https://www.magyaradam.com/wp/?page_id=368

![Adam Magyar and his line scan camera.](https://i.dllu.net/1_i-lKxvcHb8e0xRnRudBZ-g_53678a52c6462f02.jpg)

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.

## 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 https://www.sethitow.com/posts/2026-linescan

![Seth's line scan camera.](https://i.dllu.net/camera-side_hu_37121314ccab48d_7a503eaf96ae2057.webp)

## Philomena

Philomena (aka FlamingSpork) has a neat one too. She wrote a really good writeup with lots of details and explanations.

:: Philomena's line scan camera https://philo.gay/linecam/

![Philo's line scan camera](https://philo.gay/linecam/blogpics_2x/camera-tape.jpg)

# 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](/blog/2024-08-31-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:

* Voigtlander Ultron 35mm f/1.7
* Voigtlander Apo Skopar 90mm f/2.8
* Voigtlander Apo Lanthar 125mm f/2.5

My Cheecar and Samyang have an 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.](https://i.dllu.net/irr_5e0981f569d75e0c.png)

> 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.
