Introduction: Bouncing Multicolored LED Line

This is an arduino controlled project and uses leds, jumper wires, and a breadboard. This is one of my first attempts on programming arduino and I am pleased with the outcome. I'm ten years old and I just started programming 2 weeks ago.

Step 1: Parts Check

Let's make sure we have all the correct parts. We need a large breadboard, 4 green LEDs, 4 yellow LEDs, 3 red LEDs, an arduino, and  about 25 jumper wires.  The arduino I used was the UNO smd, but it might work with older or newer versions also.

Step 2: Placing the LEDs on the Breadboard

Next, let's place the LED's on the breadboard.  Make sure to put the long side of the LED (positive side) to the left on every one.  The order that you put them is 4 green, 4 yellow, and then 3 red. Put 1 pin spacing inbetween each LED.

Step 3: Wiring the Positive

Now, we are going to wire the positive side on the LEDs to the digital pins on the arduino.  For this we will take a  jumper wire and put it at the pin above theleftside of the first green LED and connect the other side to digital pin 3.  We will do the same for the second green LED at digital pin 4 and so forth and so on.

Step 4: Connecting the Negatives

Next, we will be connecting the negative terminals in each LED together and then connect them all to the negative on the arduino.  First, we will take a jumper wire and connect one of the ends to the pin in the back of the first LED and the other two pins behind the second LED.  Then we will take another jumper wire and put it 1 pin behind the second LED and the other two pins behind the third LED.  Repeat.  After done, take one jumper wire and put one end 2 pins behind the first LED and the other in "GND".

Note : I switched Arduinos for the photo.

Step 5: The Code

You're almost there! Just copy this code, download it to the arduino, and you're done.

#define LED01 13 // says led is at # 13
#define LED02 12
#define LED03 11
#define LED04 10
#define LED05 9
#define LED06 8
#define LED07 7
#define LED08 6
#define LED09 5
#define LED10 4
#define LED11 3

void setup()
{
pinMode(LED01, OUTPUT); // digital pin is output
pinMode(LED02, OUTPUT); // digital pin is output
pinMode(LED03, OUTPUT); // digital pin is output
pinMode(LED04, OUTPUT); // digital pin is output
pinMode(LED05, OUTPUT); // digital pin is output
pinMode(LED06, OUTPUT); // digital pin is output
pinMode(LED07, OUTPUT); // digital pin is output
pinMode(LED08, OUTPUT); // digital pin is output
pinMode(LED09, OUTPUT); // digital pin is output
pinMode(LED10, OUTPUT); // digital pin is output
pinMode(LED11, OUTPUT); // digital pin is output

}

void loop()
{
digitalWrite(LED01, HIGH); // turns LED on
delay(30);
digitalWrite(LED02, HIGH); // turns LED on
delay(30);
digitalWrite(LED01, LOW); // turns LED off
delay(30);
digitalWrite(LED03, HIGH); // turns LED on
delay(30);
digitalWrite(LED02, LOW);
delay(30);
digitalWrite(LED04, HIGH); // turns LED on
delay(30);
digitalWrite(LED03, LOW);
delay(30);
digitalWrite(LED05, HIGH); // turns LED on
delay(30);
digitalWrite(LED04, LOW);
delay(30);
digitalWrite(LED06, HIGH); // turns LED on
delay(30);
digitalWrite(LED05, LOW);
delay(30);
digitalWrite(LED07, HIGH);
delay(30)
digitalWrite(LED06, LOW);
delay(30);
digitalWrite(LED08, HIGH); // turns LED on
delay(30);
digitalWrite(LED07, LOW);
delay(30);
digitalWrite(LED09, HIGH); // turns LED on
delay(30);
digitalWrite(LED08, LOW);
delay(30);
digitalWrite(LED10, HIGH); // turns LED on
delay(30);
digitalWrite(LED09, LOW);
delay(30);
digitalWrite(LED11, HIGH); // turns LED on
delay(30);
digitalWrite(LED10, LOW);
delay(30);
digitalWrite(LED11, LOW);
delay(30);
digitalWrite(LED11, HIGH);
delay(30);
digitalWrite(LED10, HIGH);
delay(30);
digitalWrite(LED11, LOW);
delay(30);
digitalWrite(LED09, HIGH);
delay(30);
digitalWrite(LED10, LOW);
delay(30);
digitalWrite(LED08, HIGH);
delay(30);
digitalWrite(LED09, LOW);
delay(30);
digitalWrite(LED07, HIGH);
delay(30);
digitalWrite(LED08, LOW);
delay(30);
digitalWrite(LED06, HIGH);
delay(30);
digitalWrite(LED07, LOW);
delay(30);
digitalWrite(LED05, HIGH);
delay(30);
digitalWrite(LED06, LOW);
delay(30);
digitalWrite(LED04, HIGH);
delay(30);
digitalWrite(LED05, LOW);
delay(30);
digitalWrite(LED03, HIGH);
delay(30);
digitalWrite(LED04, LOW);
delay(30);
digitalWrite(LED02, HIGH);
delay(30);
digitalWrite(LED03, LOW);
delay(30);
digitalWrite(LED01, HIGH);
delay(30);
digitalWrite(LED02, LOW);
delay(30);
digitalWrite(LED01, HIGH);
}

Comments

author
chough42 (author)2011-07-31

I just made your project -- my second Arduino project to date. Actually, my son and I made it together -- it's beautiful really, a ten-year-old (you) teaching a thirty-six-year-old (me) teaching a seven-year-old (my son) electronics... and all thanks to open source hardware and software.

We did find a bug around line 54 (I think)...
digitalWrite(LED06, LOW);
delay(30);

Should insert:

digitalWrite(LED07, HIGH);
delay(30);

...which was great, because it was that bug that made all of this click for my son. We were playing with the timing, mainly making it faster. Finally, we slowed it down to one instruction per second and noticed the one LED wasn't lighting. This allowed me to show him, line by line, each instruction as it triggered. We found the error, fixed the code, and high-fived.

Anyway, thanks for the 'ible.' And make sure to tell your dad or mom that some other random dad said you're great. Thanks for the lesson.  Seriously.

author
Welsh is best (author)2012-06-08

funny afrjruswrsrjnstga

author
CreativeTinker (author)2011-08-11

Fantastic you guys and gals. Keep it up!

author
alexw2150 (author)2011-06-20

You should add a shift register.

author
Qtechknow (author)alexw21502011-06-23

What is a shift register and what would it do for this project?

author
Vcent (author)Qtechknow2011-07-15

I would reccomend you google them - Google, your first stop for answers ;)
Now, since im such a nice dude - http://en.wikipedia.org/wiki/File:4-Bit_PISO_Shift_Register_Seq.gif
& http://en.wikipedia.org/wiki/Shift_register

Basically you send it a load of 0s & 1s to one pin, and it sends each of them out to a dedicated pin -
So if i send the sequence 100 000 00 to my shift register on its "in" pin - the 8 outs would then be configured like this :
Pin 1 : ON(1);
pin 2-8 : OFF (0);

This can ofc be varied like you want to - Shift registers are usefull if you want to save pins :)

author
alexw2150 (author)2011-06-20

Nice work. I'm about your age and I did something similar to this, but I added a variable resistor to change the speed.

About This Instructable

10,856views

12favorites

License:

Bio: White House Maker Faire // 16 years old // CEO of Qtechknow, maker and electronics enthusiast, I teach Arduino classes, and put making into schools! My successful ... More »
More by Qtechknow:NFC Door Lock with the Qduino Mini (under $100)Qtechknow Robot Obstacle CourseYour Image on an Arduino! - TFT LCD Screen Guide
Add instructable to: