
BUILD AN AIRPORT-STYLE X-RAY SCANNER
Ben Krasnow built a backscatter X-ray imager that scans objects in 10-20 minutes using a photomultiplier tube, a Teensy, and compressed sensing algorithms.
by Ben Krasnow
Built withTeensy
- difficulty
- ●●●●●
- time
- several weekends
- license
- MIT
- repo
- repo ACTIVE56 stars
●●●●● · several weekends · MIT · 56 stars · repo ACTIVE
WHAT YOU’LL NEED
Jump to section
COMPAREE VERDICT
This is a research-grade imaging project, not a weekend scanner build. Ben Krasnow demonstrates backscatter X-ray imaging — the technique TSA scanners used — where light elements scatter X-rays back toward the source and appear bright, while metals stay dark. A motorized gimbal steers a 50 kV X-ray beam through a tiny aperture, a phosphor screen and photomultiplier count single returning photons, and a Teensy orchestrates the scan. Full 800×800 images take 85 minutes at 8 ms per pixel; compressed sensing sampling cuts that to 10-20 minutes by measuring only some pixels and reconstructing the rest algorithmically. The code is MIT-licensed and the video explains the build in detail. What it is not: a complete hardware design. The repo has the firmware and reconstruction pipeline, but no schematics, no gimbal CAD, no detector assembly drawings, and no sourcing list for the X-ray tube, photomultiplier, or phosphor cassette. You are reverse-engineering from video stills. The single hardest part is not the code or the motors — it is the X-ray safety. His primary beam points into a concrete floor; yours will need equivalent shielding, and operating an X-ray source without proper enclosure and permits is both illegal and dangerous. This is for someone with radiation safety experience who wants to explore computational imaging, not someone learning X-ray physics from scratch.
IN THE REPO
GOOD TO KNOW
- —GitHub has Teensy firmware, Processing GUI software, Python reconstruction code (pylbfgs), and sample data under MIT licence
- —No circuit schematics, no CAD files for the motorized gimbal or phosphor detector mount
- —No bill of materials — the X-ray tube, photomultiplier tube, phosphor screen, motors and potentiometers are shown in the video but not spec'd in the repo
- —The X-ray tube is a commercial 50 kV 1 mA unit controlled over RS232, not a DIY build
- —Licence permits commercial use, but X-ray equipment is regulated and you will need permits and shielding expertise
- —Video is the primary documentation — the GitHub repo assumes you watched it
Parts to buy
7 itemsFrom our check of the build. Exact quantities and part numbers are in the creator’s BOM.
Can I build this?
Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.
Videos
X-ray backscatter with compressed sensing algorithm
Applied Science, 18 Jul 2025, 204k views
More builds like this
All projectsGallery
Start here
Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.
- 1.Watch the full Applied Science video (The video is the primary documentation — the repo assumes you have seen the hardware)
- 2.Clone the GitHub repository (Contains Teensy firmware, Processing GUI, pylbfgs reconstruction code, and sample scan data)
- 3.Verify X-ray equipment regulations in your jurisdiction(Operating X-ray sources requires permits and radiation safety training in most countries)
- 4.Design and build shielding enclosure(The primary X-ray beam must terminate in concrete or equivalent shielding — his points into a concrete floor)
Resources
Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.
KNOWN ISSUES
- The X-ray tube is a commercial 50 kV unit — this is not a DIY tube build, and sourcing a suitable tube with RS232 control takes research
- No schematics or BOM in the repo — you are reverse-engineering the motorized gimbal, detector mount, and high-voltage circuitry from video frames
- Compressed sensing reconstruction requires the pylbfgs library and familiarity with optimization algorithms — the code runs but tuning parameters for different objects is not documented
- The photomultiplier needs its own high-voltage supply and careful setup, and the video doesn't document that part in detail.
- X-ray safety is non-negotiable: operating without proper shielding, interlocks, and permits is illegal and exposes you and others to ionizing radiation
- His images are much blurrier than a real airport scanner, and even with compressed sensing a scan takes 10 to 20 minutes.
Can I scan people like airport scanners do?
Ben only scans objects, not people. Scanning humans requires medical device approvals and radiation safety protocols far beyond this project.
Do I need to build the X-ray tube?
No — he uses a commercial 50 kV 1 mA X-ray tube controlled over RS232. Building an X-ray tube from scratch is a separate project.
How much does the X-ray tube cost?
Not specified in the video or repo.
What is compressed sensing and why does it matter here?
Compressed sensing lets you reconstruct a full image from a sparse set of measurements.
Community builds
No community builds yet — be the first, we feature the best ones.
Discussion1
FROM THE COMPAREE TEAM
A full 800×800 scan takes 85 minutes at 8 ms per pixel, but compressed sensing cuts it to 10-20 minutes by sampling sparsely and reconstructing — what would you scan first if you had one running?
Ben Krasnow
Ben Krasnow runs Applied Science, a YouTube channel where he builds scientific instruments and experiments in his workshop.
DISCLAIMER
- Comparee is not the author of the projects featured here. All rights to each project belong to its creator — every page links to the original source, and we never host creators’ files.
- Information is provided without warranty and may become outdated as projects evolve. Prices are indicative bands only — always check the creator’s parts list for current costs.
- Building and operating any project is at your own responsibility. Protective equipment, safe workshop practice and compliance with local regulations are the builder’s responsibility.
CompareeTEAM12h ago
Practical notes from our verification: the GitHub repo contains the code and sample data as stated, but zero hardware documentation — no schematics, no gimbal CAD, no BOM. The video is the design reference, and you will spend more time freeze-framing motor mounts than writing firmware. The X-ray tube is a purchased 50 kV unit with RS232 control, not homebrew, and sourcing an equivalent will take research. The single biggest barrier is not technical — it is legal and safety. Operating X-ray equipment without proper shielding, interlocks, and permits is illegal in most places, and the radiation hazard is real. This is a project for someone who already has radiation safety training and access to proper facilities, not someone starting from zero.