8-LED Larson Scanner With Arduino

16,186

36

21

Posted

Introduction: 8-LED Larson Scanner With Arduino

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();
}
}

}

2 People Made This Project!

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

19 Comments

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)

"Yes, but..." is my answer. Your car power is the worst DC source possible. Not for stuff like running your lights, but for sensitive electronics. Using a 7805 regulator protects your nano in more ways than one. In addition to the obvious, when coupled with input ceramic & output electrolytic caps, it will suppress a lot of the noise on your car's DEC bus.

They also make a cheaper fuse than the nano itself, but it you use a protection diode, even that is a limited risk (see attached)

From the official Arduino Nano page:

Power:

The Arduino Nano can be powered via the Mini-B USB connection,
6-20V unregulated external power supply (pin 30), or 5V regulated
external power supply (pin 27). The power source is automatically selected to the highest voltage source.

78xx-protection-diode[1].jpg

Hi,

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!

Now, we can design the LED array based on the forward voltage & current of the led as on datasheet.

I'm intrigued by your project, but what does it do? What's a Larson scanner?

It was originally used in the original "Battlestar Galactica" TV series (also created by Glen Larson) as the "eye" of the Cylons

user

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.
BTW, I'm just old enough to have watched Knight Rider!

is it possible to make a larson scanner with more than 8 leds?
arduino mega has 54 input/output pins so i was thinking a 30led or 50led larson scanner.
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
can i use somethink like this

{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW},

{ HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW},

{ HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW},

and so on?


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
is this possible to do using this

{ HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},

{ HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},

{ HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},

{ HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},

{ LOW, HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},

{ LOW, LOW, HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW},
....... and eventually keep scanning like this :

{ HIGH, HIGH, HIGH, HIGH, LOW, LOW, LOW, LOW, HIGH, HIGH, HIGH, HIGH,

LOW, LOW, LOW, LOW},

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

IMG_0410.JPG