You are on page 1of 13

ACTIVITY NO.

2
LED CHASER
LED CHASER
What is LED Chaser?

This is the circuit of a simple LED chaser. The LEDs lights one
by one for a period of 1second and the cycle repeats giving
the running light appearance. The circuit uses two ICs (one
is 555) to drive the LEDs. In this case arduino is used for
controlling the behavior of the LEDs
Steps on making an LED chaser using an
Arduino uno
Prepare the materials needed

10 LED bulbs 10 220 ohms Jumper cables


resistor

Arduino IDE
Breadboard and Arduino
Steps on making an LED chaser using an
Arduino uno
Connect the ground of the arduino to the ground rail of the breadboard using a jumper cable

In here the ground rail


is connected to the
bottom row
Steps on making an LED chaser using an
Arduino uno
Connect pin 13 to the vertical columns of the breadboard using jumper cables
Connect the resistor in series with pin 13
Connect the anode (longer leg) of the LED to the remaining lead of the resistor and connect the
cathode to the ground rail of the breadboard
Steps on making an LED chaser using an
Arduino uno
Repeat the previous process through pin 4 (containing 10 LEDs)

Connect the remaining You can use In this case we use a


pins to the columns variety of jumper cable to connect
colors the ground rails
Steps on making an LED chaser using an
Arduino uno
Open Arduino IDE
Steps on making an LED chaser using an
Arduino uno
To get you started , open File > Examples > 1. Basic > Bareminimum
Steps on making an LED chaser using an
Arduino uno
Before void setup, set first the integers.
Integers can store number, in this case we store the number that corresponds to the pins of
the arduino.

Do this through pin 4.


You can do this in any order
but you can only do it before
void setup to recognize this
integers as global variables

13 is the value of the pin 13 of the


arduino and we named it “led”
Steps on making an LED chaser using an
Arduino uno
Now let’s go to void setup. Setup is used it to initialize variables, pin modes, start using
libraries, etc.
Between the brackets {} of the setup, type pinMode (). Remember: Arduino are case
sensitive. Bertween the parenthesis of the pinMode write the set integers or variable and
declare that integers in accordance with their behavior.

Do this through
“led10” or pin 4

Note: Make sure the


In this picture we set pinMode are inside the
pin 13 or “led” as an bracket of the void setup
output
Steps on making an LED chaser using an
Arduino uno
Next, lets go to void loop
To make an led chaser, we will say to the arduino to set the pin 13 “HIGH” for 1
second to light up the LED on pin 13 for 1 second, then set the pin 13 “LOW” and
set the pin 12 “HIGH” for 1 second to turn the LED off on Pin 13 and turn the led on
on Pin 12 for 1 second, and so on.

Do this through pin 4.


The order of the code is
important

For pin13 and pin12


Steps on making an LED chaser using an
Arduino uno
Compile the code for errors.

This means your


code has no error,
and you are good to
upload it to your
arduino

This means your code has errors, you must find out what is
wrong with your code and correct it before uploading (In
this case I forgot to put a semicolon to the pinMODE)
Steps on making an LED chaser using an
Arduino uno
Upload the code

upload

This means your code is


uploaded, and you will
see actions right away

You might also like