Developing a Larson Scanner

I’ve been hard at working coding my own Larson Scanner. This is the iconic sweeping light seen in the Cylons on Battlestar Gallactica or on the front of KITT, the car from Knight Rider.

As I discussed in my previous post, the thing that makes these look neat is the fading tail that chases the brightest light. Originally that was accomplished with capacitors which caused the light to fade as they discharged. I implemented the same concept, using a microcontroller and pulse-width modulation to manage the fading.

After the break I’ll go through the development process and share the code. I did this using an AVR microcontroller but you can use any chip you want. The gist of my process is this:

  1. Develop software (interrupt) based pulse-width modulation
  2. Write a function to monitor PWM values and automatically subtract from those over time to cause automatic fading.
  3. Use a buffer to track which LED is ‘active’ and do not fade that one. As soon as that buffer is shifted the old ‘active’ diode will start to fade.
Simple, right? Here’s a video overview to convince you:


And of course you’ll want to look at the most recent code.

Continue reading