Basics
Basics
LED
Light Emitting Diodes are great for projects because they provide
visual entertainment. LEDs use a special material which emits light when
current flows through it. Unlike light bulbs, LEDs never burn out unless
their current limit is passed. A current of 0.02 Amps (20 mA) to 0.04 Amps
(40 mA) is a good range for LEDs. They have a positive leg and a negative
leg just like regular diodes. To find the positive side of an LED, look for a
line in the metal inside the LED. It may be difficult to see the line. This line
is closest to the positive side of the LED. Another way of finding the
positive side is to find a flat spot on the edge of the LED. This flat spot is on
the negative side.
Resistors
Resistors are components that have a predetermined resistance.
Resistance determines how much current will flow through a component.
Resistors are used to control voltages and currents. A very high resistance
allows very little current to flow. Air has very high resistance. Current
almost never flows through air. (Sparks and lightning are brief displays of
current flow through air. The light is created as the current burns parts of the
air.) A low resistance allows a large amount of current to flow. Metals have
very low resistance. That is why wires are made of metal. They allow
current to flow from one point to another point without any resistance. Wires
are usually covered with rubber or plastic. This keeps the wires from coming
in contact with other wires and creating short circuits. High voltage power
lines are covered with thick layers of plastic to make them safe, but they
become very dangerous when the line breaks and the wire is exposed and is
no longer separated from other things by insulation.
Variable Resistors
Variable resistors are also common components. They have a dial or a
knob that allows you to change the resistance. This is very useful for many
situations. Volume controls are variable resistors. When you change the
volume you are changing the resistance which changes the current. Making
the resistance higher will let less current flow so the volume goes down.
Making the resistance lower will let more current flow so the volume goes
up. The value of a variable resistor is given as it’s highest resistance value.
For example, a 500 ohm variable resistor can have a resistance of anywhere
between 0 ohms and 500 ohms. A variable resistor may also be called a
potentiometer (pot for short).
Switches
Switches are devices that create a short circuit or an open circuit
depending on the position of the switch. For a light switch, ON means short
circuit (current flows through the switch, lights light up and people dance.)
When the switch is OFF, that means there is an open circuit (no current
flows, lights go out and people settle down. This effect on people is used by
some teachers to gain control of loud classes.)
When the switch is ON it looks and acts like a wire. When the switch is OFF
there is no connection.
To build our projects, we will use a breadboard like the one shown below.
The bread board has many strips of metal (copper usually) which run
underneath the board. The metal strips are laid out as shown below.
These strips connect the holes on the top of the board. This makes it easy to
connect components together to build circuits. To use the bread board, the
legs of components are placed in the holes. The holes are made so that they
will hold the component in place. Each hole is connected to one of the metal
strips running underneath the hole.
Each strip forms a node. A node is a point in a circuit where two components
are connected. Connections between different components are formed by
putting their legs in a common node. On the bread board, a node is the row
of holes that are connected by the strip of metal underneath.
The long top and bottom row of holes are usually used for power supply
connections. The row with the blue strip beside it is used for the negative
voltage (usually ground) and the row with the red strip beside it is used for
the positive voltage.
The circuit is built by placing components and connecting them together
with jumper wires. Then when a path is formed from the positive supply
node to the negative supply node through wires and components, we can
turn on the power and current flows through the path and the circuit comes
alive.
For chips with many legs (ICs), place them in the middle of the board
(across the middle dividing line) so that half of the legs are on one side of
the middle line and half are on the other side.
A completed circuit might look like the following. This circuit uses two
small breadboards.
Transistors and LEDs
Now we know enough that we can start to build circuits. But first we
will look a little closer at a component that was introduced in Section 1.2.
The LED
An LED is the device shown above. Besides red, they can also be
yellow, green and blue. The letters LED stand for Light Emitting Diode. If
you are unfamiliar with diodes, take a moment to review the components in
Basic Components, Section 1.2. The important thing to remember about
diodes (including LEDs) is that current can only flow in one direction.
So first of all we will make our LED light up by setting up the circuit below.
Step 1.) First you have to find the positive leg of the LED. The easiest way
to do this is to look for the leg that is longer.
Step 2.) Once you know which side is positive, put the LED on your
breadboard so the positive leg is in one row and the negative leg is in
another row. (In the picture below the rows are vertical.)
Step 3.) Place one leg of a 2.2k ohm resistor (does not matter which leg) in
the same row as the negative leg of the LED. Then place the other leg of the
resistor in an empty row.
Step 4.) Unplug the power supply adapter from the power supply. Next, put
the ground (black wire) end of the power supply adapter in the sideways row
with the blue stripe beside it. Then put the positive (red wire) end of the
power supply adapter in the sideways row with the red stripe beside it.
Step 5.) Use a short jumper wire (use red since it will be connected to the
positive voltage) to go from the positive power row (the one with the red
stripe beside it) to the positive leg of the LED (not in the same hole, but in
the same row). Use another short jumper wire (use black) to go from the
ground row to the resistor (the leg that is not connected to the LED). Refer
to the picture below if necessary.
Now plug the power supply into the wall and then plug the other end into the
power supply adapter and the LED should light up. Current is flowing from
the positive leg of the LED through the LED to the negative leg. Try turning
the LED around. It should not light up. No current can flow from the
negative leg of the LED to the positive leg.
People often think that the resistor must come first in the path from
positive to negative, to limit the amount of current flowing through the LED.
But, the current is limited by the resistor no matter where the resistor is.
Even when you first turn on the power, the current will be limited to a
certain amount, and can be found using ohm’s law.
Revisiting Ohm's Law
Ohm's Law can be used with resistors to find the current flowing
through a circuit. The law is I = VD/R (where I = current, VD = voltage
across resistor, and R = resistance). For the circuit above we can only use
Ohm's law for the resistor so we must use the fact that when the LED is on,
there is a 1.4 voltage drop across it. This means that if the positive leg is
connected to 12 volts, the negative leg will be at 10.6 volts. Now we know
the voltage on both sides of the resistor and can use Ohm's law to calculate
the current. The current is (10.6 - 0) / 2200 = 0.0048 Amperes = 4.8 mA
This is the current flowing through the path from 12V to GND. This
means that 4.8 mA is flowing through the LED and the resistor. If we want
to change the current flowing through the LED (changing the brightness) we
can change the resistor. A smaller resistor will let more current flow and a
larger resistor will let less current flow. Be careful when using smaller
resistors because they will get hot.
Next, we want to be able to turn the LED on and off without changing
the circuit. To do this we will learn to use another electronic component, the
transistor.
The Transistor
Transistors are basic components in all of today's electronics. They are
just simple switches that we can use to turn things on and off. Even though
they are simple, they are the most important electrical component. For
example, transistors are almost the only components used to build a Pentium
processor. A single Pentium chip has about 3.5 million transistors. The ones
in the Pentium are smaller than the ones we will use but they work the same
way.
Transistor Symbol
The following symbol is used in circuit drawings (schematics) to
represent a transistor.
Basic Circuit
The Base (B) is the On/Off switch for the transistor. If a current is
flowing to the Base, there will be a path from the Collector (C) to the
Emitter (E) where current can flow (The Switch is On.) If there is no current
flowing to the Base, then no current can flow from the Collector to the
Emitter. (The Switch is Off.)
Below is the basic circuit we will use for all of our transistors.
To build this circuit we only need to add the transistor and another resistor to
the circuit we built above for the LED. Unplug the power supply from the
power supply adapter before making any changes on the breadboard. To put
the transistor in the breadboard, seperate the legs slightly and place it on the
breadboard so each leg is in a different row. The collector leg should be in
the same row as the leg of the resistor that is connected to ground (with the
black jumper wire). Next move the jumper wire going from ground to the
2.2k ohm resistor to the Emitter of the transistor.
Next place one leg of the 100k ohm resistor in the row with the Base
of the transistor and the other leg in an empty row and your breadboard
should look like the picture below.
Now put one end of a yellow jumper wire in the positive row (beside
the red line) and the other end in the row with the leg of the 100k ohm
resistor (the end not connected to the Base). Reconnect the power supply and
the transistor will come on and the LED will light up. Now move the one
end of the yellow jumper wire from the positive row to the ground row
(beside the blue line). As soon as you remove the yellow jumper wire from
the positive power supply, there is no current flowing to the base. This
makes the transistor turn off and current can not flow through the LED. As
we will see later, there is very little current flowing through the 100k
resistor. This is very important because it means we can control a large
current in one part of the circuit (the current flowing through the LED) with
only a small current from the input.
Back to Ohm's Law
We want to use Ohm's law to find the current in the path from the
Input to the Base of the transistor and the current flowing through the LED.
To do this we need to use two basic facts about the transistor.
1.) If the transistor is on, then the Base voltage is 0.6 volts higher than
the Emitter voltage.
2.) If the transistor is on, the Collector voltage is 0.2 volts higher than
the Emitter voltage.
So the current flowing through the 100k resistor is (12 - 0.6) / 100000 =
0.000114 A = 0.114 mA.
The current flowing through the 2.2k ohm resistor is (10.6 - 0.2) / 2200 =
0.0047 A = 4.7 mA.
Input Output
1 0
0 1
Connect the output of the first inverter to the input of the second
inverter by putting one end of a jumper wire in the same row of holes as the
2.2k ohm resistor and the Collector of the transistor (the output of the first
inverter) and putting the other end in the same row of holes as the leg of the
100k ohm resistor of the second inverter (the input to the second inverter).
Here is how to check if you built it correctly. Connect the first inverter
input (the yellow jumper wire) to 12V (the positive row). The LED in the
first inverter should come on and the LED in the second inverter should stay
off. Then connect the first inverter input to 0V (the ground row). (You are
turning off the switch of the first inverter.) The first LED should go off and
the second LED should come on. If this does not happen, check to make sure
no metal parts are touching. Check to make sure all the parts are connected
correctly.
The input can either be connected to 12V or 0V. When the Inverter
Input is 12V, the transistor in the first inverter will turn on and the LED will
come on and the Inverter Output voltage will be 0.2V. The first Inverter
Output is connected to the input of the second inverter. The 0.2V at the input
of the second inverter is small enough that the second transistor is turned off.
The circuit voltages are shown in the diagram below.
When the Inverter Input is connected to 0V, the transistor in the first
inverter is turned off and the LED will get very dim. There is a small amount
of current still flowing through the LED to the second inverter. The voltage
at the first Inverter Output will go up, forcing the second inverter transistor
to come on. When the second inverter transistor comes on, the second
inverter LED will come on. To find the voltage at the output of the first
inverter (10.4V), use Ohm's law. There is no current flowing through the
transistor in the first inverter so the path of the current is through the first
LED, through the 2.2k resistor, through the 100k resistor, through the second
transistor to ground. The voltage at the negative side of the first LED is fixed
at 10.6V by the LED. The voltage at the second transistor base is fixed at
0.6V by the transistor. Then given those two voltages, you should be able to
find the voltage at the point in the middle (10.4V) using Ohm’s law. (Hint:
First find the current and then work through Form 1 of ohm’s law to find the
voltage at the point between the 2.2k resistor and the 100k resistor.)
Switch the input back and forth from 0V to 12V and you can see that
when the first stage is on, the second stage is off. This demonstrates the
inverting action of the Inverter.
Introduction
The picture above on the left shows two typical capacitors. Capacitors
usually have two legs. One leg is the positive leg and the other is the
negative leg. The positive leg is the one that is longer. The picture on the
right is the symbol used for capacitors in circuit drawings (schematics).
When you put one in a circuit, you must make sure the positive leg and the
negative leg go in the right place. Capacitors do not always have a positive
leg and a negative leg. The smallest capacitors in this kit do not. It does not
matter which way you put them in a circuit.
We can control the speed of the capacitor's charging and discharging using
resistors.
Capacitors are given values based on how much electricity they can
store. Larger capacitors can store more energy and take more time to charge
and discharge. The values are given in Farads but a Farad is a really large
unit of measure for common capacitors. In this kit we have 2 33pf
capacitors, 2 10uf capacitors and 2 220uF capacitors. Pf means picofarad
and uf means microfarad. A picofarad is 0.000000000001 Farads. So the
33pf capacitor has a value of 33 picofarads or 0.000000000033 Farads. A
microfarad is 0.000001 Farads. So the 10uf capacitor is 0.00001 Farads and
the 220uF capacitor is 0.000220 Farads. If you do any calculations using the
value of the capacitor you have to use the Farad value rather than the
picofarad or microfarad value.
Capacitors are also rated by the maximum voltage they can take. This
value is always written on the larger can shaped capacitors. For example, the
220uF capacitors in this kit have a maximum voltage rating of 25 volts. If
you apply more than 25 volts to them they will die. We don’t have to worry
about that with this kit because our power supply can only put out 12 volts.
The 555 is made out of simple transistors that are about the same as
on / off switches. They do not have any sense of time. When you apply a
voltage they turn on and when you take away the voltage they turn off. So
by itself, the 555 can not create a pulse. The way the pulse is created is by
using some components in a circuit attached to the 555 (see the circuit
below). This circuit is made of a capacitor and a resistor. We can flip a
switch and start charging the capacitor. The resistor is used to control how
fast the capacitor charges. The bigger the resistance, the longer it takes to
charge the capacitor. The voltage in the capacitor can then be used as an
input to another switch. Since the voltage starts at 0, nothing happens to the
second switch. But eventually the capacitor will charge up to some point
where the second switch comes on.
The way the 555 timer works is that when you flip the first switch, the
Output pin goes to Vcc (the positive power supply voltage) and starts
charging the capacitor. When the capacitor voltage gets to 2/3 Vcc (that is
Vcc * 2/3) the second switch turns on which makes the output go to 0 volts.
Deep Details
Pin 2 (Trigger) is the 'on' switch for the pulse. The line over the word Trigger
tells us that the voltage levels are the opposite of what you would normally
expect. To turn the switch on you apply 0 volts to pin 2. The technical term
for this opposite behavior is 'Active Low'. It is common to see this 'Active
Low' behavior for IC inputs because of the inverting nature of transistor
circuits like we saw in the LED and Transistor Tutorial.
Pin 6 is the off switch for the pulse. We connect the positive side of the
capacitor to this pin and the negative side of the capacitor to ground. When
Pin 2 (Trigger) is at Vcc, the 555 holds Pin 7 at 0 volts (Note the inverted
voltage). When Pin 2 goes to 0 volts, the 555 stops holding Pin 7 at 0 volts.
Then the capacitor starts charging. The capacitor is charged through a
resistor connected to Vcc. The current starts flowing into the capacitor, and
the voltage in the capacitor starts to increase.
Pin 3 is the output (where the actual pulse comes out). The voltage on this
pin starts at 0 volts. When 0 volts is applied to the trigger (Pin 2), the 555
puts out Vcc on Pin 3 and holds it at Vcc until Pin 6 reaches 2/3 of Vcc (that
is Vcc * 2/3). Then the 555 pulls the voltage at Pin 3 to ground and you have
created a pulse. (Again notice the inverting action.) The voltage on Pin 7 is
also pulled to ground, connecting the capacitor to ground and discharging it.
To see the pulse we will use an LED connected to the 555 output, Pin 3.
When the output is 0 volts the LED will be off. When the output is Vcc the
LED will be on.
Before you start building the circuit, use jumper wires to connect the
red and blue power rows to the red and blue power rows on the other side of
the board. Then you will be able to easily reach Vcc and Ground lines from
both sides of the board. (If the wires are too short, use two wires joined
together in a row of holes for the positive power (Vcc) and two wires joined
together in a different row of holes for the ground.)
Connect the positive leg of the LED to a 330 ohm resistor and connect the
negative end of the LED to ground. Connect the other leg of the 330 ohm
resistor to the output, Pin 3.
Connect Pin 6 to the positive leg of the 220uF Capacitor (C = 220uF). (You
will need to bend the positive (long leg) up and out some so that the negative
leg can go in the breadboard.
Connect a wire to Pin 2 to use as the trigger. Start with Pin 2 connected to
Vcc.
Now connect the power. The LED will come on and stay on for about 2
seconds. Remove the wire connected to Pin 2 from Vcc. You should be able
to trigger the 555 again by touching the wire connected to pin 2 with your
finger or by connecting it to ground and removing it. (It should be about a 2
second pulse.)
Making it Oscillate
To trigger the 555 again, we connect Pin 6 to the trigger (Pin 2). As
the capacitor is discharging, the voltage in the capacitor gets lower and
lower. When it gets down to 1/3 Vcc this triggers Pin 2 causing Pin 3 to go
to Vcc and the LED to come on. The 555 disconnects Pin 7 from ground,
and the capacitor starts to charge up again through RA and RB.
Take out the jumper wire between Pin 6 and Pin 7 and replace it with a 2.2k
resistor (RB = 2.2K).
Use the jumper wire at pin 2 to connect Pin 2 to Pin 6.
Now reconnect the power and the LED should flash forever (as long as you
pay your electricity bill).
Formulas
These are the formulas we use for the 555 to control the length of the pulses.
t1 = charge time (how long the LED is on) = 0.693 * (RA + RB) * C
t1 and t2 are the time in seconds. C is the capacitor value in Farads. 220uF =
0.000220 F. So for our circuit we have:
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input
pin, connect the negative lead to the Ground pin and then when you turn on
the power, you get a 5 volt supply from the Output pin. This 5 volt output
will be used as Vcc in the following projects.
Connect the red wire from the power supply adapter to the input of the 7805.
Connect the black wire from the power supply adapter to the ground row
(with the blue line beside it). Run a black jumper wire from the ground row
to the ground of the 7805. Then use a yellow jumper to connect the 5 volt
output to the row of holes with the red stripe beside it. The breadboarded
circuit is shown below.
Sometimes the input supply line (the 12VDC above) may be noisy. To help
smooth out this noise and get a better 5 volt output, a capacitor is usually
added to the circuit, going between the input and ground (GND). Find the
220 uF capacitor and put the long leg (positive leg) in the row of holes with
the 12VDC line and put the short leg (negative leg) in ground (the row of
holes next to the blue line).