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.

Materials needed:

• 12x LEDs
• An Arduino
• Hookup Wires

Tools needed:

• 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.

How to port it to attiny?<br>How many leds can power arduino nano?
<p>The tutorial is nice. However I think a proper schematic for the wiring diagram would make it more useful for someone who doesn't understand Charlieplexing already. Labeling them all A B C D doesn't tell you which LED's positive and neutral are wired to which pins. For someone who already understands the concept of Charlieplexing, they could easily figure this out, but if they already know it, they really wouldn't need a tutorial on how to do it would they? Just some food for thought :)</p>
<p>Thanks PhillipS1! That's a very valid point! I have taken the time to create and add the schematic of the wiring diagram from the board to the wiring section as well. Thanks for pointing out that issue as this is my first instructable. I knew I was going to forget something, so the feedback is quite helpful for this one and going forward. Thank you again!</p>
<p>Nice project! I have a tinyx5 firmware that you might want to play with - have a look at https://github.com/rmd6502/charlie_heart</p>