loading
This is a simple way to make a Larson Scanner using an Arduino, with the added capability of setting the scanning rate with a potentiometer.

Minimum parts list:

(1)  Arduino Duemilanove (or equivalent / compatible)
(8)  LED's of your choice. I used 5mm T1-3/4 120-180 degree water clean 1500mcd pure green LCD's.
(8)  100ohm 1/8 watt (minimum) resistors. I used (4) 330ohm 1/4 watt, and (4) 450 ohm 1/4 watt, just because that's what I had lying around. I see no difference in brightness between the two.
(1)  10k potentiometer of your choice.
(1)  project breadboard, solderless "push-in" style.
(11)  4 inch lengths of hookup wire , preferrably solid core with tinned tips. Stranded wire will work, but is just more annoying. I used pre-assembled breadboardinging wires that came in a kit.



I did not write the sketch personally, but rather modified someone else's to fit my needs. It includes the ability to add a button, which I don't use.
The sketch for the Arduino is as follows:

const int buttonPin = 2;
const int ledPin1 = 13;
int buttonState = 0;

int leds[] = {3, 4, 6, 7, 8, 9, 10, 11};
#define NUMBER_OF_LEDS (sizeof(leds)/sizeof(int))

boolean larson[][NUMBER_OF_LEDS] = {
{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW},
{ LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},
{ LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW},
{ LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW},
{ LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW},
{ LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW},
{ LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW},
{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH},
{ LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW},
{ LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW},
{ LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW},
{ LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW},
{ LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW},
{ LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},
};

#define FRAMES (sizeof(larson)/(sizeof(larson[0])))


int sensorPin = 0;

void setup() {
pinMode(ledPin1, OUTPUT);
pinMode(buttonPin, INPUT);
for (int led=0; led<NUMBER_OF_LEDS; led++) {
pinMode(leds[led], OUTPUT);
}
}

void loop(){

buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPin1, HIGH);
}
else {

long time = millis();

for (int frame=0; frame<FRAMES; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++) {
digitalWrite(leds[led], larson[frame][led]);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() - time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}

}
<p>i wanna put this in my car brake light can the arduino nano withstand car 12v and the current needed to drive 6/7 car led (usually T10 with 5 SMD 5050 LEDs)</p>
<p>Hi, </p><p>Yes, you can have it as a brake indicator. Just need to use a LM7805 to pull down the 12v DC to 5v DC so that the electronics dont fry! </p><p>Now, we can design the LED array based on the forward voltage &amp; current of the led as on datasheet. </p>
<p>It's very simple project and I including the operation</p>
<p>The program worked very well! I added two extra LED's in pins 2 and 12 and you only need to add a little bit of code to make it work flawlessly. I'm new to all of this and this Instructable was very helpful. The changes you need to make a 10 LED scanner are as follows.</p><p>In the integer definition for &quot;leds[]&quot; use this: </p><p>int leds[] = {2, 3, 4, 6, 7, 8, 9, 10, 11, 12};</p><p>and for the large block of code that indicates the order of the LED's turning on and off:</p><p>boolean larson[][NUMBER_OF_LEDS] = {</p><p>{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH},\</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>};</p><p>What confused me was that pin 5 wasn't used in the original code. I changed the code to use pins 3-12 including pin 5 and it still worked the same. Regardless, great program!</p>
I'm intrigued by your project, but what does it do? What's a Larson scanner?
<p>It was originally used in the original &quot;Battlestar Galactica&quot; TV series (also created by Glen Larson) as the &quot;eye&quot; of the Cylons</p>
yeah, i had to google it... it's the lighting effect that they used for the front end of kitt on 'knight rider'. (light bouncing back and forth, for those too young to have watched 'knight rider'.)
ok, thanks. Now I understand.<br>BTW, I'm just old enough to have watched Knight Rider!
<p>This is my first larson scanner, very simple and fun to do. Used super bright leds and the outcome is great. The beam of lights hit the ceiling and it looks like a disco.</p><p>Thanks again.</p>
<p>is it possible to make a larson scanner with more than 8 leds?<br>arduino mega has 54 input/output pins so i was thinking a 30led or 50led larson scanner.<br>one more question except from scanning and turning off 1 by 1 led i would also like to scan them and keep the leds high after the scan passes them<br>can i use somethink like this</p><p>{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW},</p><p>and so on?</p><p><br>also i would like to make a program where the scan uses 4 leds at a time living behind 4 turned off and while it continues enables 4 more leds to scan <br>is this possible to do using this</p><p>{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},</p><p>{ LOW, LOW, HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},<br>....... and eventually keep scanning like this :</p><p>{ HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, HIGH, HIGH, HIGH, HIGH,</p><p> LOW, LOW, LOW, LOW},</p>
<p>Thanks for this! I have been looking for ways to make a scanner of my own and this is the first that has worked correctly. I did add some lines to have the light wait at the end. Thanks for the video explaining what ports to plug into. :3</p>
<p>Is there a way to remove the potentiometer without changing the speed?</p>
Have you tried removing one of the lines from your 'flickbook' because when the scan hits either end it hangs longer than it should, try this.<br><br><br>boolean flickbook[][NUMBER_OF_LEDS] = {<br>{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW},<br>{ LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},<br>{ LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW},<br>{ LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW},<br>{ LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW},<br>{ LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW},<br>{ LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW},<br>{ LOW, LOW, LOW, LOW, LOW, LOW, LOW, HIGH},<br>{ LOW, LOW, LOW, LOW, LOW, LOW, HIGH, LOW},<br>{ LOW, LOW, LOW, LOW, LOW, HIGH, LOW, LOW},<br>{ LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW},<br>{ LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW},<br>{ LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW},<br>{ LOW, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},<br>};<br><br>I removed two lines, so in theory it shouldn't hang on the sides anymore.
<p>which lines did you remove </p>
Yes those were put there so it would pause at either end briefly. Simply what I prefer it to do, but others are obviously welcome to do as they wish. Thanks for the tip, tho!
Not a problem, the reason why I spotted it is because the 'Larson Scanner' doesn't have any pauses.
I tried your version of the code, and I actually do like that better. Thanks!
Not a problem at all, Glad to help.
<p>great project </p>
This project is great, thanks for posting. <br>I have a question on expanding this- I want to set up a single button so that if it is pushed it will activate a specific pin depending on which LED is activated in the larson scanner. So if the first LED is lit and the button is pushed, it could activate pin 8, if the second LED is lit, it could activate pin 7, so forth. I've change the pins in the Larson scanner code to be 13-9 (only five LEDs) and will dedicate pins 8-4 to the external switches. This will be used to activate buttons on a tv remote. I've tapped into the remote pcb and have leads soldered into the button connects I want to use. <br> <br> I'm really new to arduino and am having trouble getting started with altering the code. <br>I thought a while loop might work well and having the 'while' dependent be the high/low state of the LEDs. <br> <br>Any input would be extremely appreciated

About This Instructable

15,254views

36favorites

License:

Bio: I'm a U.S. Marine stationed in southern California. In the boredom of my off-hours, I tinker around with simple electronics and look for ... More »
More by samlynn79:8-LED Larson Scanner with Arduino 
Add instructable to: