# Charlieplexing Larson Scanner

5,778

39

7

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)

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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

## Recommendations

• ### Internet of Things Class

22,790 Enrolled

## 7 Discussions

I made it as is then added 3 more sections for a total of 42 LED (7*6). I am pretty impressed with it and thank you for your instructable. Now trying to figure out what to do with it :)

Hi, i know this is old but is almos wtah i have been looking for, very nice explained, is there a way in this code to mahe the sequence go slowly?