Вы находитесь на странице: 1из 26

Porcupine

Series

The Line Follower


A (not so) brief introduction
Salvador Garcia
Jul. 29, 2009

Copyright©, 2007, 2009 Noemi and Salvador Garcia

Some material was copied from diverse sources on the ‘Net. Links to source, specifically the circuits and the
pictures at the end of this text, provided where possible. Copyright covers all original text and images.
Images, pictures and text obtained from external sources is clearly indicated and copyrighted by their
original owner/designers.

Introduction
The Line Follower described here is a BEAM robot that is powered by batteries. What is
a Line Follower? This is a type of robot that follows a line that is placed or painted on the
ground. This type of robot generally has two types of sensors. The first kind alerts the
robot when it bumps into something. When that happens the robot usually backs away,
changes direction and moves forward again. The second type of sensors are “eyes” that
are located on the bottom of the robot, facing the surface on which it is placed. These
eyes keep a lookout for the line and help guide the robot when the line changes direction.
The object of a Line Follower is to follow a line that is drawn, painted or taped on the
surface where it moves. It should follow this line even though the line curves, turns or
goes through certain types of obstacles. The better the robot, the more accurate it will be

1
and the faster it will be able to move while following the line. Some Line Followers are
put to the test by having them follow lines that intersect or have gaps in them. The robot
presented in this text follows the BEAM philosophy, although not 100%, IMHO.
What is BEAM? BEAM is a certain way of thinking when building a robot. Most robots
are built around a central “thinking” device. We could call it a very simple brain. Those
that know about electronics call it a “processor”. The whole idea of a robot that uses a
processor is that the builder assembles a bunch of instructions that tell the processor what
to do. This bunch of instructions is called a “program” and this program is what tells the
robot how to behave and react to external events.
The BEAM philosophy is a group of concepts that describe a robot. This technology was
patented by Mark Tilden. In 1989 he started experimenting with a methodology that
could be used to design simple robots that did not use a processor, but still exhibited
certain behaviors that were previously thought to need a central processing unit. He
always saw the possibility of a machine using simple components (that is, no processor)
and exhibiting life-like behaviors. BEAM tells us that a robot doesn’t really need a brain
to behave a certain way. It goes further by saying that the simplest type of robot should
react to its surrounding very much like animals do, specifically insects.
Ok, pop quiz! What happens when you see a fly sitting somewhere and try to grab it with
your hand?
It flies away!
The fly knows that something is getting close to it and reacts by flying away (better safe
than sorry!) The idea of BEAM robotics is that the robot, without using a processor
should have some behaviors that are similar to those of insects or other animals. And so,
that gives us the meaning of the first letter, “B”. It stands for “Biology” which is the
study of living things.
The “E” stands for electronics. Of course, a robot is a thingy made out of electronic
components. BEAM tells us that a robot should use electronic components to make it
behave in some ways like an insect or other living things.
Of course, nobody likes an ugly robot! The robots that we build should look nice, isn’t
that what we want? Yes!!! So the “A” in BEAM stands for aesthetics. Whoa!! I can
barely pronounce that! How was that again and what does that mean?
No problem! Today we all learn a new word:
Aesthetics – as-the-tics – “The study and philosophy of the quality and nature of sensory
responses related to, but not limited by, the concept of beauty.” (Found on various sites
by Googling “aesthetics”) Ok, that did not help; can you repeat that in English? Sure! It
simply means having the ability to look nice. Is that something we want for our robots?
Well, BEAM wants that too!
Now we just need the last letter, “M”. This stands for mechanics. A robot needs
electronics to have it do something, but without a motor, what exactly is it supposed to
do? Mechanics describes the motors, wheels and other stuff that make the robot move.
So now we have a complete BEAM robot! A simple electronic thingy that does
something that mimics a living being and looks nice. I like that!

2
There are thousands of web sites that talk
If you are like Johnny Five and want about BEAM, The one mentioned in the
“More input!” here is a web site that talks box is just one of them.
more about BEAM robotics.
The robot discussed in this text, being
http://en.wikipedia.org/wiki/BEAM_robotics
battery powered, might wander a bit from
the true definition of a BEAM robot. Batteries do not occur naturally; after all, when was
the last time you saw an animal or insect with a battery? (Electric eels and other animals
that produce electricity don’t count because they don’t use it to power themselves☺) A
true BEAM robot could be considered one that mimics nature in its search for food and if
not found, it will simply cease to be, sort of. In all other regards this Line Follower can be
considered a BEAM robot, especially since it does not have an organized brain, that is, it
does not have any kind of processor.
This brings me to another discussion. Many, if not most Line Followers, do have a
processor. I do not discuss these here for two reasons:
1. A processor based Line Follower is not considered a BEAM robot, so it would be
more appropriate for this robot to have its own document.
2. A processor based Line Follower is far more complex than a non-processor robot
and would completely dominate this text.
I want to keep the Line Follower in this text simple. Even attempting to describe a
processor based Line Follower would involve areas such as processor interfacing and
software design, debugging and deployment. On the other hand, a non-processor based
Line Follower is much simpler and I am sure that the reading will be much lighter.

Although a Line Follower’s purpose in life is to Want to know more about processor
follow a line, other issues have to be discussed. based Line Followers?
For example, if the track that it is following is
Google: processor line follower robots
on a table, it should also have some form of
detecting the edge of the table so it won’t fall
off. If the robot is moving fast, it has to have fast reflexes so that if the line turns it will
be able to compensate its direction so it won’t leave the track. All of us use light to see.
The Line Follower is no exception. It needs light to see, but sometimes if an external light
source is strong enough it might confuse the robot. If the robot is doing its preferred
activity outdoors, a whole set of issues have to dealt with, such as sunlight, dust, uneven
terrain and others that I haven’t thought of.
The Line Follower in this text may not be able to handle all the conditions listed above,
but as long as it follows the line I’ll be happy.
Most, if not all Line Followers, are battery powered. They must have a way to define the
direction in which they must go. They must also be able to accept input from the external
world and use that input to decide what to do next.
The main components of a Line Follower are listed here:
1. The electronics 2. The motors
3. The batteries 4. The sensors

3
What makes up a Line Follower?

Fig. 1

Electronic Components
Before we get into the nitty-gritty (i.e. good stuff) I have to present a description of some
of the components, albeit a very simplified one. The sections that follow present various
aspects of the robot, including electronic diagrams, circuits and high and low level
descriptions of how the robot works. Before we get to these topics we need to have a
basic understanding of the electronics components that are used to make up the robot. We
won’t get too in-depth, presenting the minimum amount of information needed to
describe the component.
The basic introduction to the different components that are used and referenced in this
document serves to give you a running start. If you are already familiar with them you
can skim over this section or skip it completely. In most cases, this type of information is
relegated to a glossary or appendix at the end of the document, but I think that it is
important enough to be presented as a section of this document before we start discussing
the technical details of the robot.
Each component, depending on its make-up affects the flow of current or voltage that is
circulating within the circuit. By carefully affecting these, the circuit can do useful tasks.
Energy can be discussed in terms of voltage and current. A bit confusing I guess. Both of
these terms are used when talking about electricity (electrical energy). The voltage can be
seen as the potential while the current can be seen as the flow of electricity. Imagine that
the voltage is the size, for example, of a car and the current is how fast it is going.

4
Another way to imagine this is that voltage is the depth of a river while current is the
speed at which the water flows.
The information that follows presents the schematic symbol for the component, a few
images and a general and basic description. The “schematic symbol” is a standard
graphical representation of the component and is used commonly in electronic diagrams.
Most of the images have been modified from the original to fit the limited space that I
reserved for them. Whenever possible a source URL of the original image is provided.
One consideration is that this standard is not worldwide, so differing countries may have
their own standard.

Capacitor

Ceramic disc Ceramic Electrolytic Tantalum


monolithic
Image sources: http://www.bikudo.com/photo_stock/709032.JPG
http://www.solarbotics.com/products/cp0.001uf/
http://www.solarbotics.com/assets/images/cp3300uf/cp3300uf_pl.jpg
http://www.solarbotics.com/products/cp6.8uf/

Capacitors come in all shapes and sizes and are used for different purposes and have
different names depending on its purpose. The electrolytic capacitors are the ones that
look like cylinders or tubes and usually have a plastic coating, like the one shown in the
image above. When the capacitor is connected to a power source it stores energy. How
much it stores and how long it takes to do this depends on what kind of electrolytic
capacitor it is and there are lots of these capacitors. Oh, and a nick name for these is
“cap”, so if I say “cap” or ”caps” I am referring to a capacitor.
One important difference between different kinds of capacitors that I need to mention is
their polarity. The polarity refers to the positive and negative charge of the power source.
Looking at the images of the capacitors above, the electrolytic and tantalum capacitors
have polarity while the two ceramic capacitors do not. We can connect the ceramic disc
capacitors any way you want, but must be very careful with the tantalum and electrolytic
capacitors because they have a positive lead and a negative lead which must be connected
correctly in the circuit. Electrolytic caps have a black line running down its side with a
rectangle inside the line. This marks the negative lead as represented by the “rectangle”
which is actually a minus sign. Both tantalum and electrolytic capacitors have some sort
of marking that tells which lead is the negative (or perhaps the positive). If the
component is small, use a magnifying glass to careful inspect the cap’s surface looking
for such markings. Another telltale sign of their polarity is the length of the leads. The
shorter of the two denotes the negative lead. If both leads are the same size then it is
likely (but not guaranteed) that the cap does not have a polarity.

5
Of course, I have only made mention of 4 different types of capacitors, as illustrated
above, but there are others types, so always check to see whether the cap you need to use
has a polarity and if it does, always be careful to connect it the right way.

Want to know more about capacitors?


The schematic symbols shown above are for
Have a look at this Web page: different types of capacitors. The first (furthest
left) is simply two parallel lines. This is
http://en.wikipedia.org/wiki/Capacitor
commonly used for non-polarized capacitors.
How can I tell the difference between a normal
capacitor and a polarized one by looking at the symbol? Easy. Note that the symbols for
polarized caps have a tiny plus sign on it and the line at the bottom is curved (rightmost
symbol). The plus tells us that this is the positive side of the capacitor and the curved line
tells us that it is the negative side. The symbol in the middle has the bottom line thicker
than the top one, also indicating a polarized cap. We have to be careful how we connect
this cap in the circuit because it isn’t the same one way or the other. Sometimes the
symbol does not have a curved line, but instead it has a minus sign. In some other cases it
doesn’t have any signs, only the curved line. If both lines of the symbol are straight, have
the same thickness and there aren’t any plus or minus signs then most likely it is a non
polarized cap.

The Mighty Transistor

Image sources: http://www.compucanjes.com/prod_images/0000014727_1.jpg


http://www.reuk.co.uk/OtherImages/labelled-transistor.jpg
http://personal.ee.surrey.ac.uk/Personal/H.M/UGLabs/images/bjt_package1.jpg

Imagine that a transistor is a switch. It is used to activate, or using the correct term, drive
other circuits that need more current. One of the functions of the solar engine, as
described, is to monitor the energy level of the capacitor and when it reaches a certain
threshold it should activate the circuit that includes the motor. In this case, the transistor
is the component that is responsible for activating, or in this case, switching the motor
ON. The transistor has three wires or legs that are called leads. Each lead has a name:
Base, Collector and Emitter. The base is normally used to receive the lower current.
Although the current may be too low to activate the second circuit, it is powerful enough
to switch the transistor to an ON state. The collector and emitter are connected to the
second circuit that is driven by the base current.
There are two basic kinds of transistors: NPN and PNP where P is “positive” and N is
“negative”. Beware when buying transistors. The NPN and PNP type are not
interchangeable. Also use care in identifying the Base, Collector and Emitter of the
physical device and in the schematic.

6
Want to know more about transistors?
The schematic symbol is shown above and
Have a look at this Web page: differs slightly for NPN and PNP transistors.
The NPN transistor will have a small arrow
http://en.wikipedia.org/wiki/Transistor
that point away from the center line while a
PNP transistor symbol will have the arrow
pointing towards the center line. The symbol is basically the two angled line, being the
emitter and collector that meet at the center line. The straight line meets the center line at
a 90 degree angle is the base. Note that the symbol can be drawn with the base on the
right or the left side. The symbol presented above shows the base on the right side, but
this is not a fixed rule. Also, note that the emitter is the lead that has the arrow pointing in
or out, but there is no rule that says that the symbol needs to have at the bottom. Don’t
assume it is the emitter simply because it is the bottom lead of the symbol.
Also use Google images to search for transistor symbol to see how this symbol can vary
depending on the transistor type.

Resistor

Image sources: http://www.azx.ph/images/categories/Carbon_Film_Resistors.jpg


http://upload.wikimedia.org/wikipedia/commons/e/e3/3_Resistors.jpg
http://www.pittjug.org/b2b/pics/Flameproof_Acid_Metal_Film_Resistors.jpg

The resistor is used to restrict the flow of current. It gets its name from its main purpose
to “resist” current. We can see the resistor as a tool to control the amount of current that
goes through a specific circuit. This is something we want to do if a component may be
damaged by an excess of current. Another use for this component is to divide the voltage.
Whereas 5 volts, for example, might be appropriate in some cases, there may be specific
cases when the circuit might need a fraction of this voltage. The resistor is helpful in this
scenario.
Resistors come in different values and ratings. The value is measured in Ohms and rating
is mostly measured in Watts. Their values can range from 10-12 Ohms and the rating can
go from 1/8 Watts to over 10 Watts. The rating determines their physical size: a small
resistor will have a small rating and a large resistor will have a larger rating.

Want to know more about resistors?


The schematic symbol for the resistor is a small
Have a look at this Web page: set of zigzag lines, as the illustration above
shows. This is representative of its function. We
http://en.wikipedia.org/wiki/Resistor
can imagine ourselves racing at 100MPH when
the road is straight, but most likely we will have
to slow down if we encounter a small stretch or road that is zigzagged in a similar way,
thus illustrating the main function of the resistor.

7
Variable Resistor

Image sources: http://media.digikey.com/photos/CTS%20Photos/201U%20SERIES.jpg


http://media.digikey.com/photos/Ohmite%20Photos/RHS%20SERIES.jpg
http://www.westfloridacomponents.com/mm5/graphics/p113.jpg

A variable resistor is a device whose resistance can be adjusted by rotating a knob or slit
that allows us to determine how much resistance will be applied to the current that goes
through it. The variable resistor is also known as a “pot”, “trim pot” or “potentiometer”
(the origin of the shorter name “pot”). The amount of resistance that the pot will put up
depends on how far we turn the trimmer (or wiper or shaft) in a certain direction. At one
extreme the pot may offer so little resistance that it will behave like a plain old wire, that
is, no noticeable resistance at all. If turned to the other extreme, depending on the pot’s
value, it may offer so much resistance that nothing will get through and it will behave as
though we simply cut the wire.
The variable resistor comes in varying values and ratings. The values are measured in
Ohms and the rating is mostly measured in Watts. Variable resistor values usually start at
a higher level than those of standard resistors. Their minimum value can be anywhere
from 0 to 100 Ohms while their highest value will the specification value. Tiny trimmer
pots can’t handle too much power, so their Watt rating is low. The bigger and clumsier
pots support more power and are commonly used as volume controls.

Want to know more about variable


The symbol for a variable resistor is a
resistors? Have a look at this Web page: combination of the standard resistor symbol
and an arrow. It has the zig-zag lines that
http://en.wikipedia.org/wiki/Potentiometer
symbolize a resistance. The difference
between this symbol and other resistor
symbols is the circle around it and the arrow that points to the center of the symbol. The
circle, which is optional, along with the arrow clearly indicates that it is a trim pot. In
some cases, the arrow points towards the main symbol while in other cases the arrow run
at a diagonal through the main symbol. Mileages may vary☺.

Diode

Image sources: http://mustangsva.co.uk/wp-content/uploads/2009/04/diode.gif


http://www.kato-unitrack.co.uk/images/dcc_images_new/diode.jpg
http://www.pinpartshop.com/images/photos/8_elektronics/1N4148_Diode.jpg

A diode is an electronic component that lets current flow one way. An LED is a diode at
heart. The diode works basically like a traffic cop, determining what traffic gets through.
For example, what happens if you place batteries backwards? Chances are this might

8
damage the electronics. A diode can be placed between the battery and the electronics.
When the diode senses that there is a voltage in the right spot (batteries placed correctly)
it lets the current through and the circuit works, but if the batteries are backwards, the
current is in the wrong spot, so the diode does not let it through. This is why when you
connect an LED backwards it does not light. It knows that the current is in the wrong end
and does not let it through, so there is no light!

The diode’s symbol tells us the direction of current flow. Look at


the symbol, it resembles an arrow. The arrow points in the
direction of the current flow. Let’s take a quick example. When we
use an LED to indicate the state of an output we connect the output
of the circuit to a resistor then the LED and finally to ground, as the illustration shows.
This will cause the LED to light whenever there is a HI state at the output. We’ll assume
that a HI state is Vcc and a LO state is Ground, meaning that Vcc will be of a higher
voltage than ground.
When the output of the circuit is a LO state we can see that there is a LO state on both
sides of the diode. Since we can say that both sides have equal voltage, the diode will not
let current through. Applying this to our LED it simply means that the LED will not light.
Now, if the output of the circuit is a HI state we can say that the anode (a) of the diode
has a higher voltage (HI = Vcc) than the cathode (k) (Vcc > Gnd). Now that this
condition is met the diode will let current through and as a result our LED will light.
What we need to remember is that a diode will let current through if the voltage present
at the anode is higher than the voltage present at the cathode.
The symbol presented above clearly indicates which are the cathode (K) and the anode
(A), although some, if not many, schematics do not include these labels. One easy way to
remember is that the anode (A) has a triangular look to it, like the letter “A” with a flat
line on top and the cathode (K) tends to resemble the letter “K”. Most, if not all, diodes
usually have a silver or black line near one of the lead. This is used to identify the
cathode. This line can be viewed as the straight vertical line of the “K”.

74AC240

Image sources: http://www.solarbotics.com/assets/images/74ac240/74ac240_pl.jpg


http://media.digikey.com/photos/Coto%20Tech%20Photos/8L%20SERIES.jpg
http://www.techbotics.com/acatalog/IC.jpg

This integrated circuit comes in a 20 pin DIP (Dual Inline Package). Vcc is pin 20 and
ground is pin 10.
This is an Advanced CMOS (AC) integrated circuit (IC or chip). CMOS is a fabrication
method and usually describes a group of ICs whose input is a defined state and whose
output is a state that is the result of some function of the input. The function depends on
what type of processing is done by the chip. The state is usually either no voltage (0 Volts

9
or sometimes known as “ground”) or some voltage, typically, but not necessarily 5 Volts,
known as Vcc.
Note the letters within the name of the chip: 74AC240. What do these mean? This is a
Advanced CMOS chip! What is CMOS and why is that important? While it gets too
complicated to explain CMOS (it stands for Complementary Metal Oxide
Semiconductor) in detail, suffice to say that this indicates how the chip is made and the
materials used in the fabrication process. More importantly, it tells the designer what
design considerations s/he must take into account when handling the chip and designing
the circuit for it. If you look at the data sheet you’ll see a list of ‘240s each with a
different set of letters within the name and after it. The letters after it tell that designer
what the exterior of the chip looks like. This way the design of the circuit and the printed
circuit board (PCB) will accommodate the correct chip package.
The advantage of CMOS is that it can use a varying input voltage on the input signals and
a varying voltage to power it. Non CMOS chips, such as TTL (Transistor Transistor
Logic) have strict power guidelines where the input power can’t vary very much from a
given voltage. It also has one big disadvantage: It is very delicate and can be easily
damaged by static electricity.
CMOS chips should not be handled using your hands without being properly grounded. It
should always be handled using the foam or packaging where it was shipped and special
chip holder when taking it out of its packaging and inserting it into the circuit. Could you
use your hands to handle the plastic chip when inserting it into the circuit? Well, yes you
can, just don’t touch any of the pins. But why risk it? The IC is small and human fingers
are large so there is always a chance of touching a pin and that could be disastrous to the
chip. If you need to handle the chip directly with your fingers, get an antistatic wrist band
and make sure that you are grounded. This could help in protecting the chip.
There are many kinds of ‘240 chips. One way to determine the difference between them
is to look at the letters between the “74” and the “240”. These letters describe how the
chip operates. While all ‘240s essentially do the same thing, each may have some
differences that must be taken into account. For example, the chip presented here has the
letters “AC” (Advanced CMOS). This tells us that this chip works with a voltage of 2 to 6
volts. It also lets us know that this is a CMOS component, so we have to be very careful
how we handle it because the static electricity in our bodies can damage it.
If these letters were “ACT” then this would mean that the chip, while being a CMOS
device, works with a voltage of 4.5 to 5.5 Volts and is compatible with TTL components.
Note how the “ACT” version is stricter. These voltages refer to the energy used to power
the chip as well as to define the state of the input and output. So, what happens if I use a
voltage of 6 Volts on a ‘240 that has the letters “ACT”? Most likely I will damage the
chip. There are other designations, so when you see this chip used in a circuit or part list,
beware of the letters that are used to describe it. All ‘240s are not created equal.

Want to know more about CMOS?


The 240 is a chip that inverts the input state. If
Have a look at this Web page: the input state is 5 Volts then the output is 0
Volts and if the input state is 0 Volts then the
http://en.wikipedia.org/wiki/CMOS
output state is 5 Volts. Since some of these chips
might use different voltages to represent the

10
states, a more common way to refer to the states is either 0 and 1 or low (LO) and high
(HI). A 0 or LO state represents the 0 voltage and the 1 or HI state represents the 5 Volts
(or whatever it may be if different). The formal name of this chip is “Octal buffer/line
driver with Tri-sate outputs”. The “Octal” designator tells us that there are 8 inverters in
the chip and the “tri-state” designator tells us that the output state can be 3 states: HI, LO
and Hi-Z.
Hi-Z (pronounced hi-zee) is a high impedance state that allows the output to be
electrically disconnected from the rest of the circuit. This third state is useful when the
chip’s outputs need to be disabled so that nothing is seen there.
The AC240 makes use of two control lines, called “output enable 1” (/OE1) and “output
enable 2” (/OE2). Each output enable control line allows the circuit to disable the 8
outputs as 2 groups of 4 outputs. This flexibility allows the designer to disable the output
of the AC240 in groups of 4. This is useful when the 4 outputs need to work
independently of the other 4.
How does the /OE pin work? First we take into account that it is an input pin and since
the bar is present, it is active when a LO state is present. This means that if a LO state is
present the output of the inverters is enabled. We know it is an input pin because if we
look at the schematic symbol presented below we can see that the /OE pins go into of the
sides of the triangle symbol. Any connection made to any of the triangle’s sides
represents an input and the connection made to the pointy side with (or without) the circle
indicates an output. As already mentioned, the bar above the “OE” indicate that this pin is
activated with a LO state.

Items (a) and (b) show an inverter with a LO input state. We expect the output top be HI as is the case with (a) because
the /OE pin is LO, thus allowing the inverter to have an output. However, with item (b) /OE is HI, so the inverter is
disabled so there is no output. Technically, the output can be HI, LO or nothing. The nothing state is commonly known
as high impedance state or Hi-Z for short (pronounced hi-zee).

This chip is used when the output needs to drive a device that needs a higher current than
what is originally available. In some cases, this chip is used to boost the signal in
preparation to be sent over a long cable.

The generic schematic symbol is a rectangle with each pin


numbered and labeled. In some cases, when the schematic needs
to present only one of the inverters of the chip it can use the
symbol of the inverter, such as the example illustration shows.
The circle at the pointed end of the triangle indicates its function
(inverting) and the one above specifies that the output is enabled when a LO state is
present at the control line /OE1 on pin 1. The “bar” above “OE” confirms the necessary

11
state to activate, or “assert”, this control. The bar in the illustration is represented by the
“divide” or “forward slash” ( / ) in this document’s text.

555 Timer

Image sources: http://www.solarbotics.com/assets/images/lm555/lm555_pl.jpg


http://www.positiveoffset.com/Parts/555-CMOS-Timer.jpg
http://img2.allposters.com/images/TEE_ALLU/SLE555.jpg

Yes, the 555 Timer is so popular that there are t-shirts about it available.

Want to know more about the 555? Have


This is a chip that is commonly used when it
a look at this Web page: is necessary to generate an output state
every X seconds and is typically known as a
http://en.wikipedia.org/wiki/555_timer_IC
“timer” because of this characteristic.
Usually, the frequency of the output state, in
this case called a pulse, is a lot less than a second. A second can be broken up into a
1,000 different parts, meaning that the output frequency of the pulse can be a second
divided into 1,000. That is a small measurement of time. How fast can you count?
Usually you might be able to say 3 numbers in one second, now imagine counting so fast
that you can count up to 1,000 in one second! That is how small a second divided into
1,000 is. It even has a special name! It is called a millisecond. Yes, a millisecond is a
second divided into 1,000. So, this means that you need 1,000 milliseconds to make just
one second! The 555 can be programmed to trigger in 10, 50 or 500 milliseconds or
whatever is needed. The output state is called a pulse because once the 555 triggers and
outputs the state, it holds it for a certain amount of time and then turns it off.

The 555 has been used to do just about Need more input? Here is a tutorial:
everything. I sometimes tend to call it the “duct
tape” of ICs because of it broad range of uses. 555 Tutorial
This flexibility is because the design of this chip
allows the designer to connect to it capacitors and resistors to “configure” its behavior.
Using the right formulas given in the 555 datasheets, the designer can calculate which
capacitor(s) and resistor(s) are needed to achieve the desired results.
Let’s have a quick look at these formulas:

TH = 0.693 * (R1 + R2) * C1 (measured in seconds)


TL = 0.693 * R2 * C1 (also in seconds)
F = 1.44 / ((R1 + R2 + R2) * C1)
D = 1 – TL / TH
Basic circuit used, called “astable
mode” Note: Values are in Ohms and Farads

12
And their respective definitions:
TH – Time High. This is the time that the output is in a HI state.
TL – Time Low. This is the time that the output is in a LO state.
F – Frequency. This is the frequency of the period, that is, the number of times that the
TH and LH cycle repeats within one second
D – Duty cycle. This is the percentage (ratio) that the output is HI as compared to the
time it is LO.

Want to know more about the


The values of the resistors and capacitor determine
duty cycle? Have a look here: the time that the output is LO and HI, plus the
Duty cycle on Wikipedia frequency of the cycles. (One cycle includes 1 TL
and one TH.) By varying these values the designer
can experiment with different results and can adjust
both duration states. I recommend reading about the 555 before starting to experiment
because there are certain conventions that should be followed when selecting the values
for these components.
Also, there are many 555 calculators online that help in determining the two durations
(TH & TL), the frequency and the duty cycle. These are easy to find, just go to Google
and use the search phrase 555 calculators.

Relay

Image sources: http://www.germes-online.com/direct/dbimage/50264679/Relay.jpg


http://media.digikey.com/photos/Coto%20Tech%20Photos/8L%20SERIES.jpg
http://www.aeolus-online.com/catalog/pics/Relays_JQX_13F_LY_.jpg

A relay is an electronic component that contains switches inside. There are different
kinds of relays, able to toggle between two positions or being able to toggle more than
one switch. The description of relays involves the use of the terms “pole” and “throw”:

Illustration that shows various types of switches.

A description of these four types of relays follows.


Single pole single This is one switch that can only be in one position. This is the
throw (SPST) simplest kind of switch used to turn ON or OFF one device.
Single pole double This is one switch that has two possible positions. This can be

13
throw (SPDT) used to switch between two different devices, perhaps turning
one ON and the other OFF.
Double pole single These are two switches that each can be in only one position.
throw (DPST) This is similar to the first (SPST) except that it is used to turn
ON or OFF two devices. The switches can not be operated
independently.
Double pole double These are two switches where each one can be at one of either
throw (DPDT) two positions. Similar to the SPDT switch above, except that
there are two switches. The switches can not be operated
independently.
As mentioned before, a relay contains one or more switches inside of it. The switch, as
you can imagine is used to either turn ON or OFF whatever is connected to the relay, for
example a lamp or a motor. The question here is: If the switch is inside, how do we turn it
on? A-ha! Here lies the function of this component! The switch is turned ON or OFF by
applying a voltage to an input pin. For example, if we apply 5V (the rating of this relay)
to the input pins, the switch turns ON. If we remove the 5V then the relay will turn the
switch OFF. The next figure shows an example using a light bulb.
The relay has two components inside of it: The
coil and the switch. The input voltage causes
the coil to turn into a small electromagnet. The
switch is sensitive to magnetism, so when there
is input voltage applied to the relay it causes the
switch to move and make contact, turning it
ON. Notice how the light bulb is connected to
the battery. If the relay was not there, this
diagram could be a simple circuit, a light bulb
connected to a battery with a switch. This kind
of relay is called a single pole, single throw
because there is only one switch and one way to
turn it ON.
What if we had 2 light bulbs, one yellow and
the other green and wanted the switch to turn
the green bulb ON if it was flipped one way or
turn the yellow bulb OFF if the switch was
flipped the other way? This can be done using
the single pole, double throw relay. Typically
one switch is turned ON (or closed), but when a
voltage is applied the switch flips to the other
position turning OFF one bulb and turning ON
the other bulb.

14
Finally we come to the double pole, double
throw relay. Basically all this says is that this
relay has inside of it 2 single pole, double throw
relays like the one pictured above. The diagram
on the left may seem a bit confusing, but it
really is the same as the diagram above, except
that there are two pairs of light bulbs instead of
just one.

Want to know more about relays?


A few notes of caution: When we look for a
Have a look at this Web page: relay that our robot can use we really need to
make sure that a datasheet fro that particular
http://en.wikipedia.org/wiki/Relay
device is available. This document will contain
the information that we need so that we know the
pin out of that specific relay and the amount of current that the coil needs to activate the
switch. If we get the wrong information the relay may not work at all because of
improper connections and/or current.

Motor

Image sources: http://www.solar-world.com/images/MRE-140Lg.jpg


http://www.made-in-china.com/image/2f0j00SeTtVvzMCioCM/RC-Hobby-Motor.jpg
http://rsk.imageg.net/graphics/product_images/pRS1C-2265144w345.jpg

This schematic symbol used to represent a motor is a circle with the letter “M” inside of
it. Although there isn’t much to say about what a motor is for, there can be a lot said
about how these small DC hobby motors differ. When selecting a motor it is always
important to know how much current it will need to get started and to keep going.
Although this might not be of much concern in some designs, a robot needs to have
efficient motors so that the least amount of energy will be wasted or used.

Want to know more about motors?


When designing robots, the power source
Have a look at this Web page: needs special consideration because it is the
life of the robot. Batteries that last a long time
http://en.wikipedia.org/wiki/Electric_motor
must be coupled with efficient motors and
electronics so that precious energy is not
wasted. This is even more true when the robot is solar powered. In this case, energy is
extremely precious and should be used for the robot’s operation and not wasted in driving
an inefficient motor.

15
The motor is not polarized, meaning that its leads can electrically be connected either
way; however, the polarity of the power source controls the motor’s direction. A DC
motor has the capacity to spin in a forward or reverse direction just by switching polarity.
It is a good idea to have some modularity in the robot’s design so that the motor and its
connectors can be interchanged easily to correct a mishap when the robot moves in the
opposite direction that the designer intended.

Light Emitting Diode

Image sources: http://www.jameco.com – Jameco Part # 1555315


https://sawtus.com/sawtusshop/images/ThreeLEDs.gif
http://itp.nyu.edu/physcomp/uploads/leds.jpg

This is the diode and not just any old diode; it is a light emitting diode. How can I tell?
Do you see the arrows pointing towards the outside of the diode on the schematic
symbol? The arrows indicate light and their direction indicates whether the diode is
emitting or receiving light. As the schematic symbol clearly shows, light is coming from
the diode. If the arrows pointed towards the inside of the diode then this would tell us that
the diode is sensitive to light and can be used as a sensor to detect light levels.

Want to know more about LEDs?


These light emitting diodes are better known as
Have a look at these Web pages: LEDs (which happens to stand for Light Emitting
How LEDs work Diode). Another hint that this diode is related to
LEDs on Wikipedia light is the circle around it. A normal diode would
not have this circle; however I should mention
that the circle is not always used and that by itself (without the arrows) it is impossible to
tell whether it is an LED or a photo diode.
The symbol presented above clearly indicates which are the cathode (K) and the anode
(A), although some, if not many, schematics do not include these labels. One easy way to
remember is that the anode (A) has a triangular look to it, like the letter “A” with a flat
line on top and the cathode (K) tends to resemble the letter “K”. The anode is the longer
lead of the two, while the cathode is the shorter one.

Photo Transistor

Image http://media.digikey.com/photos/Panasonic%20Photos/PNZ102,PNZ108,PNZ109L.jpg
sources: http://rocky.digikey.com/weblib/Panasonic/Web%20Photos/New%20Photos/PNA1605F.jpg
https://www.egr.msu.edu/eceshop/Parts_Inventory/images/5mm%20photo%20transistor.jpg

16
This is the photo transistor. Normal transistors have three leads which are called the Base,
Emitter and Collector. As the above schematic symbol shows, the Base is missing. The
Base is the “input” that is used to drive the circuit that is connected to the Collector and
Emitter. When the circuit needs to active the load on the Collector and Emitter, it sends a
base current that is just enough to switch the transistor ON.

Want to know more about opto-


The photo transistor only has two leads, the
isolators? Have a look at this Web Emitter and the Collector. The third lead is
page: actually a light sensitive material that turns the
transistor ON whenever it is hit by a certain
http://en.wikipedia.org/wiki/Opto-isolator
level of light. This allows the Collector and
Emitter load to be switched ON depending on the light that strikes the physical device.
Photo transistors are used when we require that a circuit be controlled by the level of light
in the environment. The light-sensitive device acts as an eye, allowing the electronics to
make decisions based on visual cues. Another common use of this device is to count or
detect whenever a stream of light is turned ON or OFF. In some cases, the photo
transistor receives impulses of light generated by a transmitter, such as an IR (Infra Red)
diode.

When the transmitter and receiver pair is used More info on photo transistors on the
as one device, the resulting device is called an Solarbotics Encyclobeamia:
opto-isolator, short for optical isolator. In fact,
Photo transistors
some opto-isolators come packaged as an
integrated circuit.
The photo transistor is similar to the photo diode. The similarities in behavior are close
enough that most photo transistors are photo diodes. Even the photo transistor entry on
Wikipedia is the same entry as the one for the photo diode.

Integrated circuits

Image sources: http://www.hi-fi-insight.com


http://www.solarbotics.com/assets/images/1381/1381_pl.jpg
http://media.digikey.com/photos/National%20Semi%20Photos/14-20-DIP.jpg

This symbol is used to represent special circuits or components that are not simple stuff
like transistors and resistors. The triangle tells us that the component described is most
likely made up of many basic components. Here we care more about its function than its
makeup. It is often used to represent components that don’t have their own symbol.
Want to know more about integrated circuits? When this symbol is present in a
Have a look at these Web pages: schematic the designer can make the
http://en.wikipedia.org/wiki/Integrated_circuit assumption that it is a more complex
http://nobelprize.org/educational_games/physics component. Although not limited to

17
integrated circuits, this symbol is often used to represent a whole or a portion of the
physical integrated circuit (IC). For example, there are ICs that have more than one
circuit that has the same function. Instead of “wasting” resources on building one IC with
only one circuit, the IC is built with 2, 4 or even 8 circuits that perform the same task.
Although this might seem redundant, it is very practical when the designer needs two (or
more) circuits that perform the same task. By integrating more than one of these circuits
into one IC, the designer can include one IC in his or her design have more than one
identical circuit available. The symbol represents one circuit. The moral of this story is
that this symbol may represent one whole IC or it may represent one of the various
circuits within the IC.
A final note is that many ICs implement logic gates which have their own specific
symbols. The symbol shown above represents a generic IC (or one of its components)
that does not have a specific symbol to represent it.

How does it work?


Remember what BEAM told us? Keep it simple! The Line Follower described here is as
simple as it gets when it comes to this type of robot. Even so it is necessary to explain
and understand a few concepts.
The first is “How does it see the line?” The line can be either black or white with a
contrasting background. So if the line is of a light color (such as white) the background
should be dark. By the same token, if the line is dark (usually black) then the background
should be light (i.e. white). Some Line Followers either have a switch or automatically
determine which color is being used for what purpose. For this text, I’ll work with a black
line on a light colored background since it is easier to illustrate and on my printer’s toner
cartridge.
As much as we see using light, so does the robot. Our eyes don’t actually see the objects
in front of us; rather they see the light that is reflected off these objects. This can easily
be proved. At night stand near the light switch, turn it off and tell me what you see in the
next 3 seconds after you turn off the light. If you say “nothing”, how can this be? The
objects that are in front of you are still there, how is it that you can’t see them. Now turn
the lights back on. Ah, much better. Just like we need light to see whatever is in front of
us, the robot also needs light to “see” where the line is.
The advantage that we have is that our eyes can see in a multitude of light levels. The
light might be bright or it might be very dim. We might be indoors or outdoors. Our eyes
have the capability to adjust. Our eyes, working with our brain (for those lucky enough to
have one) can tell that that dark spot in front of us is a shadow and not a dark box. We
can tell what shape the table is even though it might look different when the light shines
on it from different angles. Unfortunately, the Line Follower can’t do that. It either sees
that there is light or that there isn’t. This is why the Line Follower’s sensor is actually
composed of two items: The light source and the light detector. By providing the robot
with its own light source we guarantee that it will follow the line much better than if we
rely on the natural light that is around the robot’s location.

18
To provide a light source we can use a light bulb, but it is far more common to use a LED
(Light Emitting Diode). LEDs come in various colors, but the one that is often used has a
color that we can’t see! This “color” is called infrared. We use infrared LEDs all the time.
Have you ever used a remote control to operate the TV, stereo, VCR, DVD player or any
other kind of electronic equipment? If you answered “Yes” then you have used an
infrared LED (IR LED). Get a remote control and locate the LED, usually located at the
front he remote, that is, the part that you “aim” at the electronic device that you want to
control. Some remotes have their IR LED concealed by a plastic cover, usually of a black
or dark red color. If the LED is visible, press any button on the remote while looking at
the LED. If the LED is covered, then just look at the front of the LED as you press any of
the remote’s buttons. Did you see anything? No? Of course not! We can’t see IR light!
But we can cheat <eg>. If you have a video camera, place it in front of the remote, with
the remote facing the front of the camera. Put the camera in “Camera mode” so you can
see the video on its small screen (assuming it has one). Now press the remote’s button
while still pointing straight at the lens of the video camera. Whoa! Did you see that? The
LED glows white! This is the IR light.
Our Line Follower uses 2 IR LEDs to light the way and two sensors to “see” the IR light.
The LEDs shine the light on the floor and the IR light is reflected off the floor and seen
by the sensors. The amount of light that the sensor sees depends on the color of the floor
where the IR light is shining. The electronics can determine where the robot is depending
on the amount of light that the sensors see.

The sensors detect whether the surface under them is either light or dark and report back to the electronics.

Fig. 2
Once the electronics determine where the robot is in relation to the line, they instruct the
motors to move a certain way to steer the robot and keep it on the line. This means that
the robot spends its ON time moving forward and adjusting the operation of its motors to
keep itself on the line even if that line turns or disappears for a short distance.

19
Additionally, the robot might have an additional bump sensor to tell it when it bumps into
something.
The speed of the Line Follower also determines how well it must detect the light. If the
Line Follower is slow then it has all the time in the world to process the information that
comes from the light sensors, but if it is fast it has to “think” fast otherwise the
electronics won’t have enough time to control the motors correctly. This will often result
in the Line Follower going off the track and not being able to follow the line at all.
This is similar when driving a car or bicycle. The driver usually has to slow down when a
curve comes up. If she or he keeps going at the faster speed, she or he might not be able
to take the turn and end up off the road. The big difference is that we can see up ahead to
know that a curve is coming and slow down. The robot won’t know until it is at the curve
by which time it may be too late to slow down, if it can even slow down.
Here is a Line Follower that is called Snail. Gee, I wonder why that name? It is not
known for its speed, but it is accurate, faithfully following the line that is underneath it.
The Snail is sold as a kit:
Snail line follower kit at Jameco

Can’t find the Snail robot?


All Line Followers have one thing in common: Their
Use this alternate search sensors and electronics work together to control the
link: motors. The sensors continuously update the electronics
as to what is going on and the electronics continuously
Snail robot Google search
adjust the motors to keep the robot on the line.
Notice how the electronics energize one or both motors. When moving in a straight line
the robot must energize both motors at the same time. When the robot turns towards the
left it energizes the right motor and, of course, when it turns towards the right it energizes
the left motor. When the robot is moving forward it must continuously energize one or
both motors so that it stays on the line. The sensors help it make those fine adjustments to
the speed of each motor.

The robot will not go in a straight line if the motors don’t spin at the same speed.

Fig. 3

20
This might pose another problem: What if one motor spins more than the other? When
the robot wants to move in a straight line it must energize both motors, but if one motor
goes faster than the other then it will cause the robot to move in the direction of the
slower moving motor. To a certain point, this can be resolved by introducing variable
resistors (more on this later) so that the designer can calibrate the robot so that both
motors will spin at the same speed when the robot wants to go straight. This solution is
not covered in detail in this text. You might want to do more research on the Web; there
is plenty of information regarding this and other issues that might come up.
Another such issue is the response time of the robot to turn slightly and the steepness of
the curve. If the curve is too steep, the robot may not react in time, resulting in the robot
going completely off the line and getting lost indefinitely. The number of sensors affects
this behavior. If the robot only has two or three sensors then it has to compensate by
moving slower to allow for the time it will read the line information and adjust its
motors’ speed. If we add more sensors the robot will have a faster response time and this
will allow it to move faster.
The robot presented in this text has only two sensors which perform their job adequately
enough, but only by sacrificing speed and precision. If we want our robot to move faster
we need to change our design strategy. We can either make the electronics more
complicated or we can use a processor. Of course, by using a processor we move farther
away from the BEAM philosophy. One such robot (among many) is the 3Pi line follower
robot by Pololu. This particular robot is one of the speediest available. The speed is
obtained by using specific algorithms that are able to sense the line and predict where the
robot must move to stay on it. One such algorithm uses a subset of the PID controller
(Proportional Integral Derivative).
Fig. 4
Pololu 3Pi robot Web page:
http://www.pololu.com/catalog/product/975
More info on PID Processor:
http://www.chibots.org/?q=node/339
http://en.wikipedia.org/wiki/PID_controller
http://www.jashaw.com/pid/tutorial/
The Pololu 3Pi line following and maze solving
robot. Image taken from URL presented at right.
The following illustration graphically shows
how the sensors, electronics and motors interact to keep the robot presented in this text on
the line.

21
The motors, electronics and sensors cooperate to guide the robot along the line. If the robot wanders too far to the left
the line will be only under the right sensor, so the electronics guide the robot a bit to the right. If the robot wander too
far to the right the line will be only under the left sensor, so the electronics guide the robot a bit to the left.

Fig. 5

22
The Circuits
The circuits that I’ll be describing in this section came from the following Web page:
http://www.tombot.net/beam/linefollowingcircuit.html
This document presents an introduction to this Line Follower. Going to the above link is
recommended to get more details on how the components were selected and other
relevant information. Since the Line Follower is a bit more complex, the circuit for the
Line follower is divided into sections. Each section will have a specific purpose and will
be described in detail accordingly.
In designing a robot the first item on the list is the design objectives. This describes what
we want our robot to do and what we need to do so the robot can do it. The design
objectives for the Line Follower are the following:
a. Follow a black line on a light background
b. Keep from bumping into objects in its path.
Note that the information present in the above referenced page describes two lines
followers. One follows a white line on a black background and the other follows a black
line on a white background. To keep it simple this text only describes the line follower
that follows a black line on a white background.
These are somewhat simple objectives; however the circuits needed to do this add up.
TomboT.net presents various circuits for a Line Follower that follows either white or
black lines and for bump detectors that either employ a simple switch or an IR sensor. As
I said before, this text describes a Line Follower that follows a black line, but I will
present both a bump switch and the IR detector to detect collisions with other obstacles.
These descriptions are not meant to be step by step how-to’s, rather, as the title of this
document implies, they are brief introductions into the technology. For more detailed
information on building the Line Follower described here consult the referenced links.
Before I present the circuits I would like to discuss the 74AC240 and the 555 Timer a
little bit more. The above descriptions are ok, but it only begins to touch the surface of
what these chips are.

74AC240
As was mentioned before the 74AC240 inverts the input state. Figure 4 shows the pin out
for the 74AC240.
Notice the small triangles with the circle in front of them. This is the schematic symbol
for an inverter. The input is the flat end of the symbol and it comes out inverted at the
pointy end of the triangle with the circle. The pins that are labeled “In” are the input pins.
Count them, there are 8 of them. This means that the ‘240 chip has 8 inverters. The
output pins are labeled “On”, but wait; notice the horizontal line or bar over the output
pins. This bar tells us that the output is inverted. So if a HI state is the input the output
will be a LO state and vice versa.

23
Fig. 6
Note that the bar over the output pin
names only tells us that the signal is
inverted, not that it will come out as a
LO state, as this depends on the input.
Since my word processor can’t put the
bar over the pin name, I just use the “/”
character to indicate that the pin out
name is inverted. For example the /OE1
and /OE2 pins have the bar over them
and in my case, they have the “/” symbol
before the name. OE is Output Enable.
Pin out of a 74xx240 type IC. While the xx can be different
This is an input pin and allows the
designations, for the most part the pin out is the same for all circuit to either enable or disable the
‘240s. Diagram taken from the Fairchild datasheet. Link at output of the inverters. Notice that there
end of this section.
are two /OE control lines and how one
/OE pin is connected to four inverters while the other one is connected to the other four.
Each group of four inverters can be used separately as 2 groups of 4 inverters. A simple
way to use all 8 of them together is to connect both /OE pins together.
When discussing digital electronics two terms that are commonly used are HI and LO.
Basically, the HI (high) state represents the presence of the power source voltage
(positive pole), usually 5 volts (but not always!), also called Vcc while a LO (low) state
represents the absence of voltage (negative pole), also called ground or Gnd for short.
Note that the LO state is sometimes also referred to as the “0” (zero) state and the HI
state is represented by “1”. The following figure helps us visualize this.

Fig. 7
555 Timer
Next up we have the 555. The next figure
presents a pin out of this chip.
Perhaps the first items of discussion are
the GND and Vcc pins. As noted in the
description of the ‘240 these pins are
used to indicate ground (GND) and This example uses a 9 volt battery. The various terms for
each pole are presented. Note: This example used a 9 volt
positive voltage (Vcc). In fact, this battery; however, in the real world, a HI could be different
nomenclature is widely used to describe voltages, depending on the IC type.
the power pins on ICs. Most, if not all, of the pin outs that you’ll encounter for IC chips
will use these two pin names.
As with the ‘240, the name of this chip usually includes letters to indicate what type it is.
For the 555 these letters usually come before the “555”. As with the ‘240, you should
exercise caution when reading schematics or part lists so that you get the right kind of
555 for your circuit. The 555 is more resilient than the ‘240 and may not burn as easily if
the wrong type is used, but in any case, damage can occur and in general it is a bad idea
to substitute one kind of 555 for another without doing some research to insure that the
new 555 is compatible with the circuit. As always… use caution!

24
Fig. 8
The 555 can be used as a timer. In fact, in
some regard, the 555 is the duct tape of
electronics. It can be used for so many
purposes that even attempting to describe
them is useless. To locate more information,
The pin out for the 555 chip. Taken from the 555 data go to the Google Web site and use the
sheet, link provided at the end of this section. search phrase “555 circuits” (again, without
the quotes).
The Line Follower uses this circuit to generate a pulse that can be seen by the IR
photodiode. The issue here is that the pulse has to happen at a certain frequency, meaning
that the 555 has to generate the pulse every X seconds. Imagine that this is like an alarm
clock that goes off. Usually we have ours set so that it will go off once a day. Now
imagine this same alarm clock going off 100 times a second! We simply can’t imagine
this because its frequency is so high, but this chip can easily be programmed to do this,
except that in the robot’s case, it won’t be an alarm going off, it will be a generated pulse.
Once the 555’s “alarm” is triggered the 555 generates the pulse, holds it for a certain
amount of time and then “releases” it, or said another way, it turns OFF the pulse. This is
repeated until the power is turned OFF or some other condition alters the 555’s behavior.
In the previous paragraph I used the word “programmed”. How is this done exactly? The
555 uses external components to make it work a certain way. These components are 2
resistors and 1 capacitor. They are used to define how often the 555 will trigger (generate
the pulse) and how long the pulse will last and long it will be till the next pulse. The
designer of the circuit uses different values of resistors and capacitors to define these
three characteristics. Figure 8 illustrates this.

One of the many ways that a 555 can be used. In this case, as a pulse generator.

Fig. 9
The final component that needs to be mentioned is the relay. The only purpose of the
relay is to switch the motors into reverse when the robot bumps into something. The
circuit on how the relay is connected is presented in the corresponding section. For now I
only present an overview of how the relay is used in our circuit.

25
The Line Follower uses the relay to switch the
motors ON and OFF, depending on whether
the robot bumped into something. The positive
and negative terminals of the battery are
connected to the switch elements that flip to
one side or the other which are pins 4 and 13
of the relay. Note how one side of the switches
is not connected to anything (pins 8 and 9).
The motor is effectively disconnected from the
battery when the switch is in that side, but
when it is on the other side it is connected
directly to the battery. This tells us that either
the motor is ON, connected to the battery or it
is OFF, disconnected from the battery. The coil is activated whenever there is a voltage
on the input pins. Pin 16 is connected to ground, so this always has a connection to the
battery; however, the other pin comes from the sensor that detects an obstacle. If an
obstacle is detected then there is voltage there and the coil activates because the circuit is
completed. If there is no obstacle, there is nothing at pin 1 so the coil is not activated so
the motor remains connected to the battery. Note how the motor is disconnected from the
battery only when the coil is activated.

This link takes you to the 74AC240


The circuits for the Line Follower are presented
datasheet: (PDF) in sections, each one describing the circuit in
detail. Each section will concentrate on a specific
74AC240 datasheet
aspect of the design.

This link takes you to the 555


If any of these links do not work, go to the Web
datasheet: (PDF) site www.google.com and use the phrase “555
datasheet” (without the quotes) or “74ac240
555 timer datasheet
datasheet” to locate one of the many datasheets
available for these components.
Main Circuit
The following figure presents the main Line Follower circuit. The heart of this Line
Follower is a 74AC240 chip. In this design, the chip is used to amplify the signals that
come from various external sources, such as the photo transistors and bump switch.
Note the three lines labeled relay1, relay2 and OppIn. These go to other parts of the
circuit that are not included in this schematic. The schematic in this figure is a bare bones
design for a line follower. In a following section this design will be modified to include
other circuits for bump and obstacle detection.

26

Вам также может понравиться