Introduction: Charlieplexing Larson Scanner
The Larson Scanner is an old prop that was popular thanks to shows like Battlestar Galactica and Knight Rider. In this example we will use charlieplexing for wiring so we can can use 4 pins to control all 12 LEDs. This build was a result of an LED build night we had up at our local makerspace Jax Hax.
- 12x LEDs
- An Arduino
- Hookup Wires
- A computer for programming the Arduino
- Pen and paper (or dry erase board)
Step 1: A Little About Charlieplexing
Charlieplexing is a way of wiring up LEDs to use less I/O pins. It uses the fact that I/O pins can be input or output, basically it can be a positive or negative line and flip flop between the two. That said we can also use the fact that an LED (Light Emitting Diode) is a diode at the end of the day which is intended to restrict the flow of electricity to one direction. This is why LEDs have polarity and have to be hooked up correctly to work. Charlieplexing allows us to hook up 2 LEDs to 2 lines and have them facing separate directions so depending on which line is positive and which in negative will determine which LED will light up due to the polarity. This is great because it allows us to control a lot of LEDs separately. Basically the formula for the number of LEDs we can control is X = N * (N - 1) where N is the number of I/O pins you are giving it and X is the number of LEDs you can control.
For my example I decided to give it 4 I/O pins, so we can control up to 12 LEDs off of that (4 * 3 = 12).
Step 2: Planning Your Wiring
With charlieplexing it is helpful to first choose how you want to wire it on paper first. The image attached here shows mine. Basically I gave each line a label of A, B, C, & D. The LEDs are the circles and the positive leads are on the bottom. Basically we can control the LED by having a wire on each lead and run it through every possible combo. In the picture drawn on the whiteboard, the LEDs are the circles and assume that the bottom is the anode of the LED (+). I have also added in a schematic of this wiring diagram thanks to the suggestion made by PhillipS1 that also shows this wiring diagram with the same color codes as the white board drawing.
Step 3: Wiring It Up
After you have decided how to wire it up then transfer it over to a bread board with the LEDs and run your lines to the Arduino on pins 13-10.
Step 4: Coding the Arduino
The last part to make it work is to load code to the Arduino for the logic. Attached is the code to load to the Arduino via the Arduino IDE.
Step 5: Enjoy!
If everything goes okay you should have a working charlieplexed larson scanner! The best part about this project is it only uses 4 pins, which means you can port this from Arduino to an attiny85.