• No results found

6 high low led

N/A
N/A
Protected

Academic year: 2020

Share "6 high low led"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

Needed  Boe-Bot

 Computer with BASIC Stamp Editor program  USB cable

 LED

 470  resistor (yellow-violet-brown)

Lesson 7: High/Low LED Driver

Let’s go back to Lesson 3 where we had the Boe-Bot simulate a shuttle launch countdown (have the students pull up the program from their computers). At this point, your program should count down correctly, but we want it to acknowledge the completed countdown and the launch of the shuttle with something visual. Let’s simulate the shuttle launching by turning on an LED.

Building the circuitry

Before we jump right into turning on the LED, we need to

understand a little bit about the circuitry needed to make the LED turn on.

The first component of the circuitry setup is the resistor. In a later class we will go into further detail on what a resistor is, but just know that there are many sizes of resistors that limit the flow of current through an electrical circuit. When turning on an LED, a resistor must be in place; otherwise, we run the risk of supplying too much current that will in turn burn up the LED. As you can see, each resistor has a specific color coding. Each color stripe indicates information about the total value of the resistor. The following resistor table helps you to know the size of the resistor being used.

By using the chart, you can determine the resistance of a resistor from its color stripes. The first stripe corresponds to the first digit, the second stripe relates to the second digit, and the third stripe corresponds to the number of zeros to the right of the second digit. The forth stripe is the tolerance of the resistor. The tolerance stripe is always a metallic color like gold or silver, so it is usually easy to distinguish which side of the resistor should be your first stripe. For example, a 470 (“” = the Greek letter omega, which is used to represent ohms, the units of resistance) resistor would be yellow-violet-brown with a metallic fourth stripe, where yellow represents a 4, violet represents a 7, and brown

represents one 0 that follows the resistor values. Purring them all together, we must have a resistor of “470” ohms.

Now let’s figure out a 220 resistor’s color stripes. 2 – Red 2 – Red One 0 – Brown

(2)

The next component that needs discussing is the breadboard. The breadboard is the white board with all the holes in it. The following graphic shows very briefly how a breadboard works.

*INSERT VIDEO OF BREADBOARD HERE*

The third and final component to be discussed is the LED itself. The flow of current through the LED is unidirectional (meaning it can only travel in one direction), thus the LED must be positioned in the circuit properly.

How can you tell if the LED is set up properly? There are two visual ways of determining the direction that an LED allows current to flow in:

1. The length of the leads

*LED PICTURE WITH LEADS*

The short lead is connected to the lower potential (ground). 2. The LED plastic casing

*LED PICTURE WITH TOP*

(3)

How do you turn on an LED?

On the left is a schematic of a simple circuit required to light the LED. The picture on the right is the circuit assembled on the Boe-Bot breadboard. (The arrows for the LED are off.)

470 Ohm

LED

Vss Vdd

Notice how the resistor is plugged into the Vdd pin. The Vdd pin supplies the circuit with a regulated voltage of 5 V (“V” stands for volts, the standard unit for voltage). If the resistor was plugged into a pin associated with Vin, then the circuit would be supplied with the voltage value associated with the power source. For instance, if you have 4 new AA batteries powering your Boe-Bot, each of which contains approximately 1.5 V, then Vin would supply 6 V.

What if we want to control the LED when it turns on, how long it stays on, and so forth?

To do so, we need to incorporate the circuit into a program. Move the power lead to one of the pin numbers (The pin you place it in is arbitrary as long as you make sure you indicate the appropriate pin in your program. If you put the lead in pin 7, make sure your program uses pin 7). The microcontroller can now control when the pin is acting as a power source.

On the left is a schematic of a simple circuit required to light the LED. The picture on the right is the circuit assembled on the Boe-Bot breadboard. (The arrows for the LED are off.)

470 Ohm

LED

Vss Pin

0

Notice from the picture how the resistor is plugged into pin 1. Each of the numbered pins in this column can individually be supplied with 5 V when turned on in a PBASIC program.

(4)

a line of code that turns on the LED. This requires the HIGH command. The line of code should be as follows:

HIGH #

where the # is the pin number that the resistor is plugged into.

This program, used in conjunction with the circuit we just built, will light an LED by sending a high signal (5 V) to a pin. This voltage then passes through the resistor and the LED and then “sinks” to the ground.

LED Discussion

You may be wondering, “Why is the resistor in front? What if I put the resistor after the LED?”

Well let’s see what happens when you hook up the following:

470 Ohm LED

Vss Pin

0

(5)

What happened? Why did the LED not light up? The real question should be: What is an LED?

LED stands for Light Emitting Diode. So it is a diode that gives off light. But what is a diode?

The most common function of a diode is to allow an electric current to travel in one direction and to block current in the opposite direction. This means that in our case, the electricity is “blocked” because of the direction of our LED.

Pull out just the LED and “flip” the leads around so that the LED is still in front of the resistor as shown below.

470 Ohm

LED

Vss Pin

X

Now try your program and circuit. This time, your program should work.

This demonstrates how you can turn on an LED using a high signal.

*Just make sure you pay attention to the direction of the current flow and the LED.*

Now that we know how to turn ON an LED using the HIGH command, we need to know how to turn the LED off. This is done by using the LOW command to make the pin output a voltage of 0 V.

The following simple program will make an LED blink in the pattern of 1 second on, 1 second off.

LED Direction:

LED

Vss 5v

This diagram shows that the current is allowed to flow from higher potential (5v) to the lower potential (ground). The LED allows this current to pass through.

LED

Vss 5v

(6)

References

Related documents

For example, if you are using a low impedance (20,000 ohms per volt) analog meter on the 20 volt scale (the voltmeter represents 400,000 ohms resistance to the circuit) to

All of the participants were faculty members, currently working in a higher education setting, teaching adapted physical activity / education courses and, finally, were

10 Goodbye Letters To Coworkers Word PDF goodbye letter for co workers sample free farewell and saying goodbye to colleagues goodbye letter examples?. Make review easy about my

Objetivo: Caracterização das espécies de Candida, na flora oral de crianças infectadas pelo HIV-1, identificadas antes e após a introdução da terapêutica com inibidores

As an important stakeholder, the University of Strasbourg must take concrete measures in research, teaching and innovation as well as in its own running and campus life. The

You can connect any of our sensors in any combination to monitor temperature, humidity, water leakage, Airflow including long term graphing, security, detect AC Power Line

A Monte Carlo simulation method was subsequently used to extrapolate the survival rate for up to 600 months, to derive the life expectancy for different types of occupational

The physics of the strongly interacting Hubbard chain (with t/U  1) at finite temperatures undergoes a crossover to a spin incoherent regime when the temperature is very small