Introduction
Everywhere around us are small but powerful bulbs. In our household appliances, in our phones, in our cars etc. They flash on and off to draw our attention like in an M-Pesa shop advertising, warn us in case of an emergency as a flashing beacon in ambulances, police cars or as decoration during Christmas.
These tiny light bulbs are called LEDs – said as (ell-ee-dees). The word LED stands for “Light Emitting diodes”. LEDs are very bright, require a lot less power, come in many colors and that’s why everyone loves them.
Now that you know about LEDs, can you think of other places where they are used?
Things to learn
In this lesson, you will learn about:
- How LEDs work
- What are Resistors and how they work
- How to automatically turn on and off an LED
LED Lighting
The way that LEDs light work is not that different from how the other bulbs in our homes work. Instead of heating a wire to produce light, a LED is made up of a semiconductor material that gives lots of light when power is passed through.
Polarity is Key
In the electronics rule book, polarity means that electricity can only flow in one direction. An LED has two legs with the long leg as positive, known as anode and short leg as negative, known as cathode. Electricity will flow from the positive to the negative and never the opposite.
If you connect it backward, it will not work
Resistors
To prevent the LED from being damaged by excess power, a resistor should be connected. Just as the name, resistors “resist” the flow of electricity and the level depends on the value. The higher the value of the resistor, the more it resists and the less the current will flow.
Resistors have different colored stripes that tell the value of the resistor. The unit of the resistance is called ohm.
For this lesson we are going to use a 220 Ohms Resistor.
Digital Control
A simple way to switch on or off a lamp is to use a manual switch like in our homes. However we are learning to be digital inventors and in this lesson we are going to learn how to control our lamp automatically to achieve our flashing light goal.
How does digital control works ?
Our computers understand zeros and ones and by sending a command 0 we turn off power and a command 1 we turn on power.
Quiz
Basic Circuit
To build a simple LED circuit, we usually connect a battery, resistor and LED as shown in the diagram below.
In this project, we will connect the LED to the Unda Xplora digital output port as shown below. The output ports has only two states: ON and OFF that can be thought as HIGH or LOW. When an LED is connected to any of the output ports, the port can only perform two jobs: turning on the LED and turning off the LED.
We will connect the LED to digital port, D2
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.
1 x LED | |
1 x resistor (220 ohms) | |
2 x jumper wire | |
1 x Unda Xplora |
Step 1
Place an LED on the breadboard
- Placing the LED on the breadboard: Take an Led from your Unda Xplora kit. The kit has red, blue, yellow, green LEDs. We will use a blue one for this project. Identify the positive leg and the negative leg on the LED. The positive leg is the longer one and the negative leg is the shorter one. Now connect the LED as shown in the diagram above with the negative leg on the negative terminal and positive leg on pin b25 on the breadboard.
Step 2
Connect a 220 ohm resistor
- Connecting a 220 ohm resistor – Take a 220 ohm resistor from the components casing. Connect one end of the resistor from positive leg of the LED at c25 on the breadboard. Resistors don’t have positive(+) or negative(-) sides, either side will do. Connect the other side of the resistor across the breadboard to f25 as shown above.
Step 3
Connect the jumper wire to digital output, D2
- Connecting jumper wire to D2- Pick a jumper wire of any colour from your Kit. Connect the jumper wire from one end of the resistor at h25. Plug the other side of the jumper wire into digital port D2.
Step 4
Connect jumper wire to ground
- Connecting jumper wire to GND – Pick another jumper wire, any colour will do. Plug one end of the jumper wire to the ground pin(GND) on the kit. Connect the other end of the jumper wire to any pin on the negative terminal marked with the blue line.
Run the Project
Once you are done building the circuit, go back to the Project main window and click on the Load option. Select the Load Project option and the click on Yes to run the project and once the project has been uploaded observe what happens.
Select the Play option and try out the different options available. Try out each option and for each option observe what happens to the LED and note the difference between the options.
Observation
Once you have pressed the Load Project, you observe that the LED turns on and then turns off continuously (this is what we call blinking).
Once you have seen that the LED blinks, head over to the Play Section and you will find there are 6 different options.
When you press the Fast Blink option you realize that the LED blinks at a very fast rate that before and for the Slow Blink option the blinking rate of the LED becomes much slower.
What about the other options? Try them out and observe the difference.
Feedback is closed.