Instructables

Arduino Cylon Scanning Eye

Picture of Arduino Cylon Scanning Eye
IMG_2068.JPG
cylonscannerbreadboard.JPG
This is a Larson Scanner which is what is used to make the eyes of the centurion cylons in Battlestar Galactica. I used 11 red LEDs and an Arduino UNO to make it. All of the materials used for it were the following:

- Arduino UNO
- Red LEDs x11
- 1K ohm resistors x11
- A 10K potentiometer
- Lots of hookup wire

To make it more customizable, and to add some input for it I added a potentiometer to control the speed of the scanning. Here is a video:

To build the circuit doesn't take much time or knowledge. Just connect the LED's cathode to ground on the breadboard. Then connect  each LED to a resistor on the breadboard, and make the resistors connect to the Arduino pins. Connect them in order with the line of LEDs in accordance with the numbers of the pins. Start with pin 2 and connect them in order. Then connect the ground pin on the Arduino to the ground rail on the breadboard to connect all the LEDs to Ground. Then all of the LEDs are connected and its time for the potentiometer to be connected.

To connect the potentiometer take the outer two wires and connect one to ground and one to 5v. Which one doesn't matter the only difference is that you will have to turn the potentiometer a different way. Then the middle wire you want to connect to pin A0 on the Arduino. Now the connections are all done and its time to move on to the programming!


Here is the code:


int ledPins[] = {
  2,3,4,5,6,7,8,9,10,11,12 };                                              // make an array of the pin numbers
int pinCount = 11;                                                              // variable for number of LEDs
int timer = 10;                                                                      // delay in between LED on and off

void setup() {
  for (int thisPin = 0; thisPin < pinCount; thisPin++) {    //for loop to setup all of the pins in the array ledPins
    pinMode(ledPins[thisPin], OUTPUT);
  }

}

void loop() {
  for(int thisPin = 0; thisPin < pinCount; thisPin++) {         //for loop to go through all LEDs in array and turn them on
    timer = analogRead(A0) / 2;                                             //and off until end of line in one direction
    digitalWrite(ledPins[thisPin], HIGH);
    digitalWrite(ledPins[thisPin] +1, HIGH);
    digitalWrite(ledPins[thisPin] + 2, HIGH);
    delay(timer);
    timer = analogRead(A0) / 2;                                 // Read the potentiometer value and divide by two to get delay
    digitalWrite(ledPins[thisPin], LOW);
    digitalWrite(ledPins[thisPin] + 1, LOW);
    digitalWrite(ledPins[thisPin] + 2, LOW);
    timer = analogRead(A0) / 2;

  }

  for (int thisPin = pinCount - 1; thisPin >= 0; thisPin--) {   //for loop to go through all LEDs again in opposite direction
    timer = analogRead(A0) / 2;
    digitalWrite(ledPins[thisPin], HIGH);
    digitalWrite(ledPins[thisPin] - 1, HIGH);
    digitalWrite(ledPins[thisPin] - 2, HIGH);
    delay(timer);
    timer = analogRead(A0) / 2;
    digitalWrite(ledPins[thisPin], LOW);
    digitalWrite(ledPins[thisPin] - 1 , LOW);
    digitalWrite(ledPins[thisPin] - 2, LOW);
    timer = analogRead(A0) / 2;
  
  

  }
}
Sandman_Logan5 (author) 5 months ago
Not sure what you mean. Do you mean what changes in code or hardware?
agis685 months ago
what about if i place 16 leds....what changes i have to pay attention ?


thanks
Sandman_Logan5 (author) 8 months ago
Thanks. I tried to do that for that same reason but didn't have what I needed to do it. Once I get a lens or film like that hopefully it will create the wanted effect.
putting some form of lenses infront of the LEDs might make the scanning motion smoother and more like that in the show. nice idea and good work.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!