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?
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
Important things to learn
1.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
2. 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.
3.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
Building the flashing light bulb project
For a simple LED circuit, you simply connect your battery, switch, resistor and LED.
Unda Make Digital Output
The Unda Make digital output has only two states: ON and OFF. These two states can only be thought as HIGH or LOW. When an LED is connected to one of these pins, the pin can only perform two jobs: turning on the LED and turning off the LED.
Let’s build it;
- Place the Resistor and the LED on the breadboard.
- Connector a jumper wire between port 2 and one side of the resistor.
- Put a breadboard wire between the other side of the resistor and the anode of the LED.
- Connect a jumper wire between cathode of the LED and GND port.
It’s time to run the project
- Open projects.
- Select project 1 – FlashingLights.
- If the Kit is powered off, powerit on.
- Press center key to upload.
- On the upload dialog box,press the left key to upload.
- The project should run after upload is 100% complete
Watch this video on how to make.
What did you observe?
Once the project has uploaded and running, you will observe that the LED will flash on for half a second, that is, 500 milliseconds and off for 500 milliseconds. This will flash repeatedly as long as the power is on.
If the LED does not flash, make sure you have connected the circuit correctly.
For the LED to flash on and off, the positive leg of the LED is attached to D4, which is a digital output pin. Our small computer, Unda Make sends the first instruction to turn the voltage high, turning LED on and the second instruction to turn the voltage low, turning LED off. This instruction is repeated over and over without an end.
This simply means we have replaced the manual switch with a computer that sends instructions to control and switch the LED ON and OFF forever.
Now that you have understood what has happened, upload and run project 2 and project 3 . Observe what happens.
Quiz
Feedback is closed.