I decided to finish up my Cylon Eye (Larson Scanner) project by adding it as a status indicator for my computer. I record over the air programming and transcode it to DVD quality. Since things can be a bit slower when FFmpeg is running, I set it up for the Eye to scan to let me know it’s processing a video file in the background. All the details after the break but here’s the gist of the system:
- Python script started by the FFmpeg transcoding script
- It controls the Parallel port, driving pin 1 high to turn on the cylon eye
- the ‘pidof’ command is called every minute for FFmpeg. When it is not found, the cylon eye is turned off and the script exits
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:
- Develop software (interrupt) based pulse-width modulation
- Write a function to monitor PWM values and automatically subtract from those over time to cause automatic fading.
- 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.
Okay, it’s time to make a realistic Larson Scanner. You may know it as a Cylon Eye from Battlestar Gallactica or the lights on the front of KITT, the car in Knight Rider. It’s a popular project because it looks cool, but I’ve seen (and built) a ton of lousy imitations. What makes the original so interesting is that the bright tracking light leaves a fading tale behind it. That’s a bit more work to implement, but I’m up for the challenge. Update: check out the complete project.
After the break I embedded a video of the Larson Scanner from Knight Rider. You can pause it to get an idea of what’s going on here. The brightest light is always on the leading edge, the rest fade with time.
So my implementation will happen in a couple of stages:
- Write some code to drive a PWM signal on the pins of an AVR microcontroller
- Write some code to automatically fade an LED once the focus has left it
- Write some code to change where the focus is on a row of LEDs