Sunteți pe pagina 1din 6

Where to start:

OK, so you have the task of creating a line following robot... you will have different
specifications so we shall attempt to create some modules which will allow you to
fill any spec given.

Line following robots are a popular beginners choice, they perform an interesting
task and have applications to industry, i.e. following a line in a warehouse.

Common features required for line followers:

• Follow a white line! - the obvious one


• Follow a black line
• Stop if the line dissapears
• Stop if an obstacle is present
• Do not fall off the edge of the table
• If an obstacle is present, use brute force!

All of these features for a line following robot are easy to accomplish with BEAM
robots.... no programming needed! So lets get started, first thing to consider is
the actual line following circuit.

Theory: by Lol Elner

Obviously the line following robot will need to see the line, therefore we require an
light detector of some sort. We also would like it if the line following robot could do
this regardless of the ambient conditions (is the room dark or light? is it lit by
sunlight or artificial light?). So the robot will also need its own illumination source.
The weapon of choice here will be Infra Red (IR) light.

To make this easy for ourselves the light only needs to be constant... if a white
line is present then it will reflect a lot of IR from our source. If the line is black
then we see the opposite effect.

The circuit

All we need is an IR source, an IR photo-transistor and a couple of resistors! Here


are the resources:

• IR emmiters and detector pairs: UK - Maplins,CH10L and CH11M, or SFH409


and SFH309.
• IR emmiters and detector pairs: US - Solarbotics QRD1114 (this has both in
one package)

On top of these, it would be nice if the signal that we get could be TTL (on or off,
0V, 5V). So to do this we will also require our favourite BEAM chip, the 74AC240,
heres the circuit:
Circuit operation is simple.... no line to follow put the input to the inverter high, and therefore
the inverter outputs a low, line detection turns on the transistor (or photodiode) and thus the
inverter gets a low and outputs a high. If your robot is following a black line on a white page,
then add another invereter after or before the first.
So what should the values for R1 and R2 be? and how do I set up the 74AC240 chip
exactly..... The value for R1 affects the source IR brightness, for maximum brightness we set
R1 to give the maximum allowable forward current for the IR led. So what should it be?? Well,
look at the datasheet for your LED, lookup the value of the maximum forward current. Now a
simple bit of electronic theory tells us V=IR, I will assume you are using 5V because this is the
volatge the 74AC240 should be run at (6V is OK... 4 AA batteries).

Now lets say that the max forward current is 100mA so we have 5V = 100mA * R , therefore:

5/100*10^-3 = R = 50ohms.

Experiment with different values until you get a sensitivity that you are happy with... too
bright and the detector will see it when it shouldn't! Also remember this will affect the distance
you can have it from the line you are following.

So how about R2? just set R2 to about 4K.

The chip setup is simple too... ground pins 1, 10 and 19, put 5V onto pin 20. Now choose a pin
to input your signal to, if you look at the 74AC240 datasheet on page 1, you will see a
connection diagram, any pin with an I is an input, follow it across to find its output.
Pins 1 and 19 are the enable pins, which we have grounded to permanently enable the inputs
on both side of the chip, this leaves you free to use any of the input pins. For example (in case
I haven't spelt it out enough already)... input your signal at pin 4 and take the ouput from pin
16.

The output signal could be used to directly drive your motor... just connect one side of the
motor to the ouput, and the other side to ground. If you do this for two motors (2 sets of line
detectors will require two sets of emitters and detectors, but only one 74AC240 chip), then
you have a basic line follower already! The left detector should be used to drive the right
motor and vice versa
The behaviour of this robot as it stands will be too turn a motor on IF a line is present, if both
detectors are over the line then it will drive straight, if the left detector goes of the line, it will
turn off the right motor causing the robot to turn back onto the line, if the right detector goes
off the line then it will turn off the left motor and again go back onto the line. If both detectors
come off the line (end of line) then the robot will stop altogether, perfect!
Methods available for robot obstacle avoidance:

We shall explore two of the main obstacle avoidance techniques here. The simplest
is a physical bump sensor, the next method is 38Khz IR.

We shall also explore the behaviours that we wish to achieve for obstacle
avoidance. The common behaviour would be to stop upon obstacle detection,
however we may wish the robot to run around and go back instead.
Lets begin with the sensors:

Physical Bump sensor - This can take the form of a simple switch positioned on
the front of the robot, or for greater range, a guitar string touch sensor.

38Khz IR detector - Well lets just begin with the circuit for the 38Khz emitter
circuit:

The 38Khz frequency has been derived from the 555 equation which states that F
= 1.44 / (R1 + 2 R2)xC = 1.44 / (8K + 2x 15K)x1n .

We now require a detector capable of detecting the 38Khz IR pulses.

To detect the pulses we will use a dedicated device, the panasonic pna4602
from solarbotics.com, or the TSOP4838 from www.rapidonline.com . Other 38Khz
IR receivers can be used, these are just examples.

The 38Khz receiver will output the signals it recives at Vcc. The circuit is as follows
(pin numbers are for the PNA4602):
The output of the reciever now needs to do something useful..... we will use it to
kill power to the motors. How? using relays. We can either power the motors
through relays which are operated by this reciever, or we power the entire line
following circuit through the relays and kill the power to that.

If we were to drive the motors from the relays this would give two advatages. First
off we could run our motors from a higher voltage, and use a voltage regulator for
the chips, secondly it means we can use just one inverter chip for the full circuit!
Using a relay is like having an on/off switch, but it is switched by the circuit
instead of by hand.

Heres how we would run the motor from a relay. The output of the opponent
sensor (38khz reciever or bump switch) will give a high voltage to the coil of the
relay, this will turn it on causing the normally open (NO) contacts to be closed.
This will cut power to the motors which were getting their power through the
normally closed (NC) part of the relay. This allows us to input a higher voltage (9V
lets say) into the motors at V+ in the diagram, but we can cause the coil to switch
from a 5v supply being used on the chips!

S-ar putea să vă placă și