Building a Larson Scanner
Introduction
The Larson Scanner is one of those timeless electronics projects — the hypnotic red sweep made famous by the Cylons in Battlestar Galactica and KITT in Knight Rider. Both were created by Glen A. Larson, and both inspired generations of makers to recreate that iconic effect.
This build brings the classic scanner into the Raspberry Pi era using a custom PCB, 24 LEDs, and a dash of Charlieplexing magic.
Instead of dedicating one GPIO pin per LED, we’ll use Charlieplexing, a clever wiring technique that allows control of n2−n LEDs with only n pins. With 6 GPIO pins, we can drive up to 30 LEDs — more than enough for our 24‑LED scanner.
Project Overview
PCB Layout
I wanted to make it as compact as possible while laying out the LED lights in a straight line, after a few failed attempts I came up with the solution below. The board was designed in Sprint‑Layout and arranges all 24 LEDs in a clean, straight line for that unmistakable scanner look.
Fabrication
Fortunately for me, my brother is in to robotics and had recently built himself a PCB photo etching box out of an old scanner, I was thus able to get the PCB made fairly easily. Because Charlieplexing relies on precise pin‑to‑pin relationships, careful soldering is essential.
Charlieplexing Setup
Charlieplexing lets you control up to n2−n LEDs using only n GPIO pins. With 6 pins, the Pi can theoretically drive 30 LEDs — plenty for this project’s 24‑LED array.
Pins used: GPIO 13, 16, 19, 20, 21, 26
Each LED is defined by a pair of pins: one set HIGH, one set LOW, and the rest left as inputs.
Software Implementation
The scanner is driven by a Python script using the RPi.GPIO library.
Key Concepts
Pin Resetting: Before lighting each LED, all pins are set to input mode to prevent ghosting.
Lighting an LED: One pin goes HIGH, another LOW, the rest stay as inputs.
Sweep Effect: LEDs are lit in sequence, then reversed, creating the classic back‑and‑forth motion.
Core Script
The page includes the full Python script that:
Builds the Charlieplex LED matrix
Defines the sweep order
Supports an optional repeat count via
-lMonitors GPIO pin 5 for an external stop signal
Cleans up GPIO state on exit
Parts
Pi Zero 2W Pi Zero 2 W – Raspberry Pi
ATXRaspi ATXRaspi | LowPowerLab
Switch Momentary push button
Custom LED PCB