Skip to main content

xPlora: Running Lights

Running Lights

Introduction

I bet we all love holidays. Christmas is my favorite holiday of the year. We love Christmas because we get to travel to our hometowns, spend time with loved ones and eat lots of delicious foods…..but what I like about Christmas is the decorations; the colorful ribbons, flowers, balloons and my favorite… the Christmas running lights. With these lights put up in our homes, shops, supermarkets, malls and public places, they are very eye catching and mind blowing as they run around in different patterns.

Christmas running lights also known as LED chasers are built in such a way that multiple LEDs flash on and off for a period of time, forming different patterns such as scrolling, dimming and when looked carefully, they look like they are chasing each other in one direction.

Things to learn

In this lesson you will learn :

More about LEDs

  1. Digital loops
  2. How to connect multiple LEDs
  3. More about LEDs

In Unda Xplora Project 1 : Flashing Light project, we learnt how LEDs work and how to connect them. In this project, we will learn how to connect multiple LEDs.

But first, a bit more about LEDs.

LEDs come in different shapes, colors, sizes and brightness. The different characteristics allow you to use them for different purposes e.g. How big or small do you want your LEDs to be.

Size

LEDs are available in different sizes. The most common sizes are 3mm, 5mm, 8mm and 10mm. The size refers to the outside diameter of the LED. 5mm LED is the standard and most common LED. 3mm LED is the smallest and great for use in small fitting projects while 8mm and 10mm LEDs are best for bright projects.

logo

Shape

LEDs also come in different shapes. Common shapes include flat, dome, cylindrical and round shape. They are used in different applications for different purposes example a dome shaped LED helps reflect light out of the top, the round one reflects light out uniformly while the rectangular shape is great for side viewing.

logo

Colors

Light emitting diodes are available in a wide range of colors. The most common ones being red, orange, green, yellow, blue and white.

logo

Digital Loops

What is a loop?

A loop just like the name suggests is an instruction that repeats again and again.

Unlike human beings, a computer never gets tired or bored and can keep doing a certain task no matter how many times you tell it.

When you need to repeat the same instruction over and over again, we use a loop. A loop can repeat an instruction for a number of times or until a certain condition is met.

logo

In UNDA project 1, we learnt that a computer sends digital instructions of 1’s and 0’s that is ON and OFF.

Hence, a digital loop is an ON(1) and OFF(0) instruction that repeats again and again. In our running lights project, the LEDs will turn on and off and repeat again and again.

logo

Basic Circuit

In the first project, we connected a single LED through a battery and a resistor

For multiple LEDs, the circuit is a bit different but the same rules apply. To connect our multiple LEDs, we connect each LED to a battery power supply through a resistor as in the diagram below.

logo

To switch the multiple LEDs ON and OFF repeatedly, we connect the LEDs to multiple pins on the Unda Make to send on and off instructions.

logo

Digital control

What instructions will be sent from the computer?

For the multiple LEDs to turn on and off, the computer will send instruction to each LED that is;

Turn on red LED
Wait
Switch off red LED
wait
Turn on yellow LED
Wait
Switch off yellow LED
Wait
Switch on blue LED
Wait
Switch off blue LED
wait

Continue until LED green is turned on and off then repeats again to red LED repeats for a number of times or endlessly.

Unda Xplora digital output

In this project we will use digital output pins 3, 5,6, 10 and 11. These pins will each send a 1 or 0 to the LEDs connected to them.

Pin D3 will send ON and OFF to Green LED.
Pin D5 will send ON and OFF to Orange LED.
Pin D6 will send ON and OFF to Blue LED.
Pin D10 will send ON and OFF to Yellow LED.
Pin D11 will send ON and OFF to Red LED.

Build the project

In this section we are going to build the flashing light circuit on the UNDA.Xplora breadboard.

Components

Below are the components used in this project.

ComponentDescription
5 x LED
LEDs
5 x resistor (220 ohms)
resistors
6 x jumper wire
jumper wires
1 x battery connector
battery connector
1 x battery
battery
1 x Unda Xplora
undaXplora

Step 1

Connecting the Green LED on the breadboard

Running Lights

  1. Placing the LED: Take a green LED from your Unda Xplora kit. Now place the Green LED as shown in the diagram above, with the negative leg (the shorter leg) on the bottom negative terminal and the positive leg (the longer leg) on pin b28 on the breadboard.
  2. Placing the resistor: Take one 220 ohm resistor and place it on the breadboard, with one of its leg next to the positive leg of the Green LED at pin d28 and the other leg placed at pin f28 of the breadboard.
  3. Connecting a jumper wire: Pick a jumper wire of any color of your choice and connect it from pin D3 to one side of the resistor at pin h28 of the breadboard.

Step 2

Connecting an Orange LED on the breadboard

Running Lights

  1. Placing the LED: Take an Orange LED from your Unda Xplora kit. Now place the Orange LED as shown in the diagram above, with the negative leg on the bottom negative terminal and the positive leg on pin b21 on the breadboard.
  2. Placing the resistor: Take one 220 ohm resistor and place it on the breadboard, with one of its leg next to the positive leg of the Green LED at pin d21 and the other leg placed at pin f21 of the breadboard.
  3. Connecting a jumper wire: Pick a jumper wire of any color of your choice and connect it from pin D5 to one side of the resistor at pin h21 of the breadboard.

Step 3

Connecting a Blue LED on the breadboard

Running Lights

  1. Placing the LED: Take a blue LED from your Unda Xplora kit. Now place the Blue LED as shown in the diagram above, with the negative leg (the shorter leg) on the bottom negative terminal and the positive leg(the longer leg) on pin b15 on the breadboard.
  2. Placing the resistor: Take one 220 ohm resistor and place it on the breadboard, with one of its leg next to the positive leg of the Blue LED at pin d15 and the other leg placed at pin f15 of the breadboard.
  3. Connecting the jumper wire: Pick a jumper wire of any color of your choice and connect it from pin D6 to one side of the resistor at pin h15 of the breadboard.

Step 4

Connecting a Yellow LED on the breadboard

Running Lights

  1. Placing the LED: Take a Yellow LED from your Unda Xplora kit. Now place the Yellow LED as shown in the diagram above, with the negative leg on the bottom negative terminal and the positive leg on pin b9 on the breadboard.
  2. Placing the resistor: Take one 220 ohm resistor and place it on the breadboard, with one of its leg next to the positive leg of the Yellow LED at pin d9 and the other leg placed at pin f9 of the breadboard.
  3. Connecting the jumper wire: Pick a jumper wire of any color of your choice and connect it from pin D10 to one side of the resistor at pin h9 of the breadboard.

Step 5

Connecting a Red LED on the breadboard

Running Lights

  1. Placing the LED: Take a Red LED from your Unda Xplora kit. Now place the Red LED as shown in the diagram above, with the negative leg on the bottom negative terminal and the positive leg on pin b3 on the breadboard.
  2. Placing the resistor: Take one 220 ohm resistor and place it on the breadboard, with one of its leg next to the positive leg of the Red LED at pin d3 and the other leg placed at pin f3 of the breadboard.
  3. Connecting a jumper wire: Pick a jumper wire of any color of your choice and connect it from pin D11 to one side of the resistor at pin h3 of the breadboard.

Step 6

Connect a jumper wire to negative terminal

Running Lights

  1. Connecting to Ground: Pick a jumper wire of any color of your choice. Connect one pin of the jumper from GND pin of the kit and then connect the other pin to the bottom breadboard negative rail.

Run the Project

Once you are done with building the project, connect the battery to the the battery connector and then plug it to the power port of your Unda Xplora to power it on.

Follow the steps below to load up the Running Lights Project.

Open Project

From the main window open the projects

Open Project

Observation

Once the project has uploaded and running you will observe that the LEDs light up one after another starting with Green, Orange, Blue, yellow and Red for a period of time and the cycle repeats itself giving the running light appearance. The LEDs will flash repeatedly as long as the power is on.

If the LEDs does not flash, make sure you have connected the circuit correctly.

(back to top)