Arduino Led Pendulum

6.2K183

Intro: Arduino Led Pendulum

PLEASE VOTE FROM THE BOTTOM OF YOUR HEART!


This is an extremely, absolutely and fantastically simple arduino project for beginers like me

STEP 1: Getting the Parts

parts needed-
- An arduino board(arduino uno preferable for starters)-don't worry if u have other and a to b cable.
get it here(for Indians)- http://shop.sumeetinstruments.com/index.php?route=product/product&path=69_70&product_id=374

- A breadboard
- 7 pieces of wires(preferably differently coloured and more than 6 inches in length)- jumper/solid core preferable
- 6 leds (any color)

tools needed-
- wire stripper and cutter/or pliers (you don't need them if you have a pair of strong jaws like me) :)

STEP 2: Putting Up the Wires

-Strip both ends of wires
-insert one end of each wire into sockets numbered
 -Gnd(black wire in my case)-this will be the common ground connection
 - 13  (green wire in my case)
 - 12  (yellow wire in my case)
 - ~11  (orange wire in my case)
 - ~10  (red wire in my case)
 - 9    (brown wire in my case)
 - 8    (brown wire in my case)

STEP 3: Hooking Up Wires to the Breadboard

- hook up the wire connected to gnd(black in my case) to the common vertical line on the the sides of the breadboard
- connect other wires to different horizontal lines at at-least 3 lines left in between(just for convenience)


Confused?-see image

STEP 4: Write, Compile and Run the Sketch

open the arduino software
copy and paste the following sketch-

int led1 = 13;
int led2 = 12;
int led3 = 11;
int led4 = 10;
int led5 = 9;
int led6 = 8;


// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pins as outputs.
pinMode(led1, OUTPUT);    
pinMode(led2, OUTPUT);    
pinMode(led3, OUTPUT);    
pinMode(led4, OUTPUT);    
pinMode(led5, OUTPUT);    
pinMode(led6, OUTPUT);    

}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led1, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led6, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
  digitalWrite(led2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led1, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
  digitalWrite(led3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led2, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
  digitalWrite(led4, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led3, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
  digitalWrite(led5, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led4, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
  digitalWrite(led6, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led5, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
  digitalWrite(led6, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);  

  digitalWrite(led5, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);  
  digitalWrite(led6, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
  digitalWrite(led4, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);  
  digitalWrite(led5, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
  digitalWrite(led3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);  
  digitalWrite(led4, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
  digitalWrite(led2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);  
  digitalWrite(led3, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
digitalWrite(led2, LOW);    // turn the LED off by making the voltage LOW
  delay(100);



}


- connect the arduino board
- select board model and com port
- finally upload the sketch to the arduino

STEP 5: Finally Get Going


you are now on and you will see the program running as you apply a power source(like usb connection, etc.)

STEP 6: Hook Up the LED

- Put up the shorter end(-ve) of each led to the common ground line on the vertical line
- put up the longer end(+ve) of each led to the respective coloured wire connected horizontal line

Comments

You should put resistors at each LED.