objectives
TRANSCRIPT
1. INTRODUCTION
Robotics nowadays is of great importance and interest for hobbyists and design engineers.
Robot in general is defined as a system that contains sensors, control systems, manipulators,
power supplies and software all working together to perform a task. It has many application
in auto, medical, manufacturing and space industries. Various types of robots are in a wide
use among which automated line-following robot is in a huge practice.
Automated line-following robot is a self-operating machine that detect and follows a line
pattern drawn on a floor. Generally, the paths are visible like a black line on a white surface
(or vice versa) or it can be invisible like a magnetic field. Actually, a fairly good and
advanced, robot could be easily adapted to maze solving, obstacle avoiding, etc. However, at
this point, it only follows a white line and independently self accommodates the turnings.
The robot consists mainly four parts two sensors, two comparators, one decision making
device and a motor driver (with two gear head dc motors). Phototransistor sensors detect the
white strip on the black background whose output is fed to microcontroller which takes the
decision and gives appropriate command to motor driver IC so as to move the motor
accordingly.
1
2. OBJECTIVES
To study and implement simple embedded electronic system
To use microcontroller as a versatile component to implement logical functions
To implement simple feedback mechanism for automation
To correlate the automated line following robots in practical and real world application
2
3. PROJECT OVERVIEW
Electronics systems and machines are seldom developed with a single component, rather they
are combination of different electronics parts and units. Each single components are
embedded to form different identical functional units which at once functions together to
comprise an electronic system. Automated Line- Following Robot is not an exception. It
comprises of various parts which can be described in major functional blocks.
3.1. Block Diagram Description of ALFR
The basic organization of ALFR can be divided into 4 major functional blocks.
Figure 1: Block diagram of ALFR
Sensor: The sensor sense the light reflected from the surface and feeds the output to the
comparator. When the sensor is above the white background the light falling on it from the
source reflects to the sensors, and when the sensor is above the black background the light
from the source doesn’t reflect to it. The sensor senses the reflected light to give output,
which is fed to the comparator.
Comparator: The comparator compares the analogue inputs from sensors with a fixed
reference voltage. If this voltage is greater than the reference voltage the comparator outputs
a low voltage, and if it is smaller the comparator generates a high voltage the acts as input for
the decision-making device (microcontroller).
Decision making and controlling circuit: The microcontroller is programmed to make the
robot move forward, turn right or turn left based on the input coming from the comparator.
The outputs of the microcontroller are fed to the motor driver.
Sensor 1
Sensor 2
Comparator 1
Comparator 2
Decision making and controlling circuit
Motor driving circuit
Motor 2
3
Motor 1
Motor driving circuit: The current supplied by microcontroller to drive the motor is small
therefore a motor driver IC is used. It provides sufficient current to drive the motors.
4
4. GANTT CHART
The Project is started from July 15, 2010 and will be ended in September 14, 2010. We have
total 70 working days.
No. Task Start End
Duration Ju
ly
Augu
st
September
3rd
week
4th
week
1st
week
2nd
week
3rd
week
4th
week
1st
week
2nd
week
1 Project discussion and topic selection
7/15/2010 7/23/2010 8
2 Proposal writing 7/23/2010 7/30/2010 73 Detail analysis on
circuit component7/31/2010 8/6/2010 7
4 Microcontroller programming
8/6/2010 8/18/2010 11
5 Block implementation and debugging
8/11/2010 9/5/2010 21
6 PCB design 8/28/2010 9/9/2010 97 Report writing 9/7/2010 9/14/2010 7
5
5. METHODOLOGY
5.1. Hardware Block Diagram Implementation
The basic block building for automatic line following robot is shown below (figure 2).
Sensor Block Comparator Block Control Block Output Block
Figure 2: Circuit diagram for ALFR
5.1.1. Sensor Block
Automatic system must use some physical parameters as an input to get aware of its
surrounding. ALFR uses the reflected light rays emitted from led. The intensity of reflected
light will distinguish the path to take the further decisions
When light falls on the phototransistor (say, T1), it goes into saturation and starts conducting.
When no light falls on the phototransistor, it is cut-off. A white LEDs has been used to
illuminate the white path on a black background. Phototransistors T1 and T2 are used for
detecting the white path on the black background.
5.1.2. Comparator Block
Collectors of phototransistors T1 and T2 are connected to the inverting inputs of operational
amplifiers A2 and A1. The signal voltage at the inverting input of the operational amplifiers
is compared with the fixed reference voltage, which is formed by a potential divider circuit of
6
5.6-kilo-ohm resistor and 10-kilo-ohm preset. This reference voltage can be adjusted by
changing the value of the 10-kilo-ohm preset.
When sensor T2 is above the black surface, it remains cut-off as the black surface absorbs
virtually all the light falling from LED2 and no light is reflected back. The voltage at the
inverting input (pin2) of operational amplifiers A1 is higher than the references voltage as its
non-inverting (pin3) and therefore the amplifier output at pin1 becomes zero.
When sensor T2 is above the white line, the light gets reflected from the white surface to fall
on phototransistor T2. Phototransistor T2 goes into saturation and conducts. The inverting
input (pin 2) of operational amplifier A1 goes below the reference voltage at its non-inverting
input (pin 3) of operational amplifier A1 and therefore output pin 1 goes high. This way, the
comparator outputs logic ‘0’ for black surface and logic ‘1’ for white surface.
Similarly, comparator A2 compares the input voltage from phototransistor T1 with a fixed
reference voltage.
5.1.3. Control Block
The outputs of operational amplifiers A1 and A2 are fed to microcontroller. An 8-bit
microcontroller having 4 KB of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit
timers/counters, on-chip oscillator and clock is used. Also 12MHz crystal is used for
providing the basic clock frequency. All I/O pins are reset to ‘1’ as soon as RST pin goes
high. Holding RST pin high for two machine cycles while the oscillator is running resets the
device. Power-on reset is derived from resistor R5 and capacitor C1. Switch S2 is used for
manual reset. The microcontroller, based on the inputs from sensor T1 (say, left) and sensor
T2 (say, right), controls the motor to make the robot turn left, turn right or move forward.
Table for action corresponding to the microcontroller inputs and outputs can be summed in a
table.
7
Inputs Outputs ActionP3.0 P3.1 P2.3 P2.2 P2.1 P2.00 0 1 0 1 0 Forward0 1 0 0 1 0 Left1 0 1 0 0 0 Right1 1 0 0 0 0 Stop
Table1. Action corresponding to Microcontroller I/Os.
5.1.4. Output Block
Port pins P2.0, P2.1, P2.2 and P2.3 are connected to pins 15, 10, 7 and 2 of motor
driverL293D. Port pins P2.0 and P2.1 are used for controlling the right motor, while port
pins P2.2 and P2.3 are used for controlling the left motor. Three wheels can be used for this
robot-one on the front and two at the rear. Front wheel can rotate in any direction as
specified by the rear wheel. To make the robot turn left, the left-side motor should stop and
the right-side motor should rotate in the clockwise direction. Similarly, to make the robot
turn right, the right-side motor should stop and the left-side motor should rotate in clockwise
direction. For forward motion, both the motors should rotate in clockwise direction.
5.2. Software Implementation
Microcontroller used in decision making and controlling circuit is solely responsible to drive
the motors in logical way. This microcontroller needs to be programmed for being capable of
making such decisions. The flow chart and algorithm which can be helpful to program the
microcontroller are discussed below.
8
5.2.1. Flow Chart
Figure 3: Program flow-chart of ALFR.
5.2.2. Algorithm
Step 1. Start.
Step 2. Move both wheels forward.
Step 3. Get both sensors output.
If (over white line; high)
Stop left wheel & move right wheel;
Go to step 3.
Otherwise;
Go to step 4.
Step 4. Get right sensors output.
If (over white line; high)
Stop right wheel & move left wheel;
Go to step 4.
Otherwise;
Go to step 5.
9
Step 5. Get output from both sensors.
If (both over white; high)
Go to step 6.
Otherwise;
Go to step 2.
Step 6. Stop.
5.3. Working
Figure 4: Path of ALFR
Fig. 5 shows the path of the line-follower robot, where ‘L’ is the left sensor and ‘R’ is the
right sensor.
At the start, when the robot is at point ‘A’ sensors T1 and T2 are above the black surface and
port pins P3.0 and P3.1 of the microcontroller receive logic ‘0’. As a result, the robot moves
forward in straight direction.
At point ‘B’, a left turn is encountered, and the left sensor comes above the white surface,
whereas the right sensor remains above the black surface. Port pin P3.0of the microcontroller
10
receives logic ‘1’ from the left sensor and port pin P3.1 receives logic ‘0’ from the right
sensor. As a result, the left motor stops and the right motor rotate, to make the robot turn left.
This process continues until the left sensor comes above the black background.
Similarly, at point ‘C’, where a right turn is encountered, the sane procedure for right turn is
executed. When both the sensors are at the white surface, the robot should stop. The output
of the microcontroller (IC2) depends on the inputs received at its port pins P3.0 and P3.1 as
shown in table (Table1).
5.4. Components List
Semiconductors:
IC1 - LM324 quad operational amplifier
IC2 - AT89C51 microcontroller
IC3 - L293D motor driver
T1, T2 - L14F1 photo-transistor
D1 - 1N4007 diode
LED1, LED2 - 5mm LED
Resistors: (all 1/4 - watt, ±5% carbon):
R1, R2, R5 - 10-kilo-ohm
R3, R4 - 5.6-kilo-ohm
R6 - 330-ohm
R7 - 220-ohm
R8 - 1-kilo-ohm
VR1, VR2 - 10-kilo-ohm preset
Capacitors:
C1 - 10µF, 16V electrolytic
C2, C3 - 33pF ceramic disk
C4 - 47µF, 16V electrolytic
C5 - 0.1µF ceramic disk
11
Miscellaneous:
S1 - On/off switch
S2 - Push-to-on switch
Xtal - 12MHz crystal
M1, M2 - 20rpm, 6V DC geared motor
Batt. - 6V, 4.5AH battery
- 2 side brackets for mounting motors
- 1 caster wheel (front wheel)
- 2 wheels for the rear
- Chassis
12
6. APPLICATION
Line following robot has a great reception in automation engineering. ALFR with different
capabilities are commonly used in industry and manufacturing plants. It has many
application in auto, medical and space industries. Automation cars will have a huge
impression over current transportation system in near future.
13
7. CONCLUSION
This robot is a great tool for expanding a student’s imagination and engineering expertise as
it gives a basic, yet complete introduction to robotics. This project then shows how this small
yet diverse and powerful platform can then be added upon, in this case, with line-tracking.
This allows the robot to be used to teach someone beyond even the basics.
Automated Line- Following Robot proposed is a versatile machine that has some intelligence
of tracing the specified line. Microcontroller for the decision making and logic section makes
it a powerful device. In nutshell, Automated Line- Following Robot is a simple and effective
automated system that has some very good applications in household and industries.
14
REFERENCES
Automated line-following Robot. Electronics for you magazine. Retrieved from September
2009.
Intelligent line following Robot. Retrieved July 28, 2010 from http://www.wineyard
technologies.com/tools/assests/wk22.pdf
An Autonomous Line Following Robot. Retrieved July 28, 2010 from
http://www.mil.ufl.edu/imdl/papers/IMDLReport Summer05/dutka-paul/MILee.pdf
Degelman, D. (2009). APA style essentials. Retrieved from http://
www.vanguard.edu/faculty/ddegelman/detail.aspx?doc_id=796
Gantt chart Retrieved July 29, 2010 from http://www.smartdraw.com/downloads/
15
16