Professional Documents
Culture Documents
TRAINING REPORT
ON
(LINE FOLLOWER)
SUBMITTED IN PARTIAL FULFILLMENT
FOR THE AWARD OF THE DEGREE OF
BACHELOR OF TECHNOLOGY
IN
Batch: 2010-2014
DEPARTMENT OF ELECTRONICS & COMMUNICATION
ENGINEERING
(Kurukshetra
University, Kurukshetra)
ACKNOWLEDGEMENT
This report conveys my heartiest thanks to the staff of Robosapiens Technologies Pvt.
Ltd. who have given me their full co-operation and devoted their valuable time, for
rendering me their needy services, guidelines during the course of imparting me practical
training and with those sincere and precious help I have been able to complete my
practical training successfully.
No good work can be done alone, as the saying goes is truly applicable. A friend,
philosopher and a guide always acts source of
a given task.
Firstly, I wish to express my sincere gratitude to Dr. Kuldeep Singh (Principal), Sh. Harish
Mahendru (H.O.D.) for their kind co-operation.
My heartiest debts to my parents for their encouragement and understanding which has been a
timely factor in the completion of this project.
AMAN BHARDWAJ
1810601
LIST OF FIGURES
PAGE NO
11
3.1 IR LED
16
3.2 Photodiode
17
18
19
20
21
25
26
LIST OF CONTENT
PAGE NO
CHAPTER -1
7-9
INTRODUCTION OF COMPANY
1.1 HISTORY
1.2 ORGANISATION STRUCTURE
1.3 FIELDS
CHAPTER 2
10-11
12-31
32-33
CHAPTER - 1
INTRODUCTION OF COMPANY
1.1 HISTORY
Robosapiens is Indias most leading company in robotics. The company was founded in
2003 with the goal of providing technologies to promote the widespread adoption of
robotics in education. Robosapiens offers a complete line of technology solutions to
brand name. Robosapiens solutions represent a low-risk and cost effective way for
manufacturers to deliver innovative products quickly. It is Recognized for its innovations,
and with a growing portfolio of industry-leading partners, Robosapiens meets the needs
of manufacturers by providing embedded software solutions that respect the system and
cost constraints required for mass-production. With strong connections to leading R & D
and educational institutions, as well as a leading role in several international research
projects, Robosapiens Robotics engineers are constantly growing the pool of solutions
available to clients. The companys success in the high-growth consumer robotics market
has helped transform the company from an ambitious startup to an international leader in
its field.
Their early work focused on creating the technologies for producing modular and
autonomous robots. Robosapiens founders concentrated on building a team of qualified
roboticists, engineers, and mechatricians, creating the current product line-up and
embedded robotic technologies, and filing the necessary patents to pursue. Robosapiens
basically works on Robotics & embedded system and it gives various workshops in
different colleges. The basic objective of the organization is to generate a need for
robotics education among engineering Students and schools in India and become a
name synonymous with robotics education and related events in the country by
providing
the
most
services
and by creating an
1.3 FIELDS
The following are the vacancies & the respective qualifications:
8
Technical Associate:
Excellent Communication Skills
Diploma/BE/B.Tech in Electronics
BSc/MSc in Electronics
CHAPTER 2
INTRODUCTION TO EMBEDDED SYSTEM
2.1 INTRODUCTION
An embedded system is a computer system designed for specific control functions within
a larger system, often with real-time computing constraints. It is embedded as part of a
complete device often including hardware and mechanical parts. By contrast, a generalpurpose computer, such as a personal computer (PC), is designed to be flexible and to
meet a wide range of end-user needs. Embedded systems control many devices in
common use today.
Embedded systems contain processing cores that are either microcontrollers or digital
signal processors (DSP).The key characteristic, however, is being dedicated to handle a
particular task. Since the embedded system is dedicated to specific tasks, design
engineers can optimize it to reduce the size and cost of the product and increase the
reliability and performance. Some embedded systems are mass-produced, benefiting from
economies of scale.
Physically, embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers.
Complexity varies from low, with a single microcontroller chip, to very high with
multiple units, peripherals and networks mounted inside a large chassis or enclosure.
10
2.2 DEFINATION
An embedded system is some combination of computer hardware and software, either
fixed in capability or programmable, that is specifically designed for a particular
function. Industrial machines, automobiles, medical equipment, cameras, household
appliances, airplanes, vending machines and toys (as well as the more obvious cellular
phone and PDA) are among the myriad possible hosts of an embedded system. Embedded
systems that are programmable are provided with programming interfaces, and embedded
systems programming is a specialized occupation.
Certain operating systems or language platforms are tailored for the embedded market,
such as Embedded, Java and Windows XP Embedded. However, some low-end consumer
products use very inexpensive microprocessors and limited storage, with the application
and operating system both part of a single program. The program is written permanently
into the system's memory in this case, rather than being loaded into RAM (random access
memory) like programs on a personal computer
2.3 USE
Embedded systems range from no user interface at all dedicated only to one task to
complex graphical user interfaces that resemble modern computer desktop operating
systems. Simple embedded devices use buttons, LEDs, graphic or character LCDs(for
example popular HD44780 LCD) with a simple menu system.
More sophisticated devices which use a graphical screen with touch sensing or screenedge buttons provide flexibility while minimizing space used: the meaning of the buttons
can change with the screen, and selection involves the natural behavior of pointing at
what's desired. Handheld systems often have a screen with a "joystick button" for a
pointing device.
Some systems provide user interface remotely with the help of a serial (e.g. RS-232,
USB, IC, etc.) or network (e.g. Ethernet) connection. This approach gives several
advantages: extends the capabilities of embedded system, avoids the cost of a display,
simplifies BSP, allows us to build rich user interface on the PC. A good example of this is
the combination of an embedded web server running on an embedded device (such as an
IP camera) or a network routers. The user interface is displayed in a web browser on a PC
connected to the device, therefore needing no bespoke software to be installed.
11
CHEPTER 3
LINE FOLLOWER ROBOT
3.1 INTRODUCTION
What is a line follower?
Line follower is a machine that can follow a path. The path can be visible like a black
line on a white surface (or vice-versa) or it can be invisible like a magnetic field.
Why build a line follower?
Sensing a line and maneuvering the robot to stay on course, while constantly correcting
wrong moves using feedback mechanism forms a simple yet effective closed loop
system. As a programmer you get an opportunity to teach the robot how to follow the
line thus giving it a human-like property of responding to stimuli.
Practical applications of a line follower : Automated cars running on roads with
embedded magnets; guidance system for industrial robots moving on shop floor etc.
Prerequisites:
Knowledge of basic digital and analog electronics.
(A course on Digital Design and Electronic Devices & Circuits would be helpful)
C Programming
Sheer interest, an innovative brain and perseverance!
Background:
I started with building a parallel port based robot which could be controlled
manually by a keyboard. On the robot side was an arrangement of relays connected to
parallel port pins via opto-couplers.
12
The next version was a true computer controlled line follower. It had sensors
connected to the status pins of the parallel port. A program running on the computer
polled the status register of the parallel port hundreds of times every second and sent
control signals accordingly through the data pins.
The drawbacks of using a personal computer were soon clear
Its difficult to control speed of motors
As cable length increases signal strength decreases and latency increases.
A long multi core cable for parallel data transfer is expensive.
The robot is not portable if you use a desktop PC.
The obvious next step was to build an onboard control circuit; the options a
hardwired logic circuit or a uC. Since I had no knowledge of uC at that time, I
implemented a hardwired logic circuit using multiplexers. It basically mapped input from
four sensors to four outputs for the motor driver according to a truth table. Though it
worked fine, it could show no intelligence like coming back on line after losing it, or
doing something special when say the line ended. To get around this problem and add
some cool features, using a microcontroller was the best option.
there are more tools available for working with it. Being a part of many
engineering courses, there is a huge communitiy of people that can help you out
with 8051; same with books and online resources. In spite of being new the AVR
has a neat tool chain (See References and Resources). Availability of online
resources and books is fast increasing.
Here, 8051 > AVR = PIC.
3.2 OBJECTIVES OF THE STUDY1. The robot must be capable of following a line.
2. It should be capable of taking various degrees of turns
3. It must be prepared of a situation that it runs into a territory which has no line tofollow.
(Barren land syndrome)
4. The robot must also be capable of following a line even if it has breaks.
5. The robot must be insensitive to environmental factors such as lighting and noise.
6. It must allow calibration of the lines darkness threshold.
7. The robot must be reliable.
8. Scalability must be a primary concern in the design.
9. The color of the line must not be a factor as long as it is darker than the surroundings.
output pin of IC is connected to the motors. The L293D IC is having two H-bridges
which is capable to rotate motor in bidirectional.
Easy to control
3.4.4 IR SENSORS:
Sensors are basically electronic devices which are used to sense the changes that occur in
their surroundings. The change may be in color, temperature, moisture, sound, heat etc.
They sense the change and work accordingly. In IR sensor there is emitter and detector.
Emitter emits the IR rays and detector detects it.
The IR sensor basically consists of three components:
IR LED (emitter)
Photodiode (detector)
Op-Amp
15
3.4.4.1 IR LED:
16
3.4.4.2 PHOTODIODE:
17
Op-Amp stands for operational amplifier. It is a DC-coupled high gain amplifier with
differential inputs and single output. Typically the output of the op-amp is controlled by
either negative feedback or positive feedback. Due to the fact that it performs several
operations like addition, subtraction, multiplication, integration etc., it is named as
operational amplifier. It has two inputs, inverted (Pin 2) and non-inverted input (Pin3).
The signal which is applied to the inverted input gives output 180 degree out of phase
with input whereas in the non-inverted input gives output in phase with that of input. Opamp has a variety of uses in different electronics devices. In the line follower it is used in
the comparator mode. The op-amp IC which is used here is LM358, which is an 8-pin IC
having two inbuilt op-amps. In the comparator mode, the reference voltage is set at the
inverted input pin and then it is compared with the input at non inverted pin. As the
voltages at two input pins of op-amp is compared, as the voltage at Pin 3 exceeds the
reference voltage at Pin 2 the output of the comparator becomes high (5 V) otherwise it
becomes low (0 V). The reference voltage at Pin 2 is set with the help of variable resistor.
Types of Op-amp:
1) General purpose op-amp.
2) Special purpose op-amp.
18
Sensitivity of IR sensor:
The sensitivity of sensor means that how much effectively the sensor senses the change
that is occurring in its surrounding. The sensitivity of the IR sensor is controlled by
reference voltage at pin 2 using variable resistor.
ACTION
CLOCKWISE
COUNTER-CLOCKWISE
0/1
0/1
1/0
1/0
BRAKE
21
Apart from this almost all AVRs support In System Programming (ISP) i.e. youcan
reprogram it without removing it from the circuit. This comes very handywhen
prototyping a design or upgrading a built-up system. Also the programmerused for ISP is
easier to build compared to the parallel programmer required formany old uCs. Most
AVR chips also support Boot Loaders which take the ideaof In System Programming to a
new level. Features like I2C bus interface makeadding external devices a cakewalk.
While most popular uCs require at least a fewexternal components like crystal, caps and
pull-up resistors, with AVR thenumber can be as low as zero!
Cost: AVR = PIC > 8051 (by 8051 I mean the 8051 family)
Availability: AVR = PIC <8051
Speed: AVR > PIC > 8051
Built-in Peripherals: This one is difficult to answer since all uC families offercomparable
features in their different chips. For a just comparison, I would rathersay that for a given
price AVR = PIC > 8051.
Tools and Resources: 8051 has been around from many years now, consequentlythere are
more tools available for working with it. Being a part of manyengineering courses, there
is a huge community of people that can help you outwith 8051; same with books and
online resources. In spite of being new the AVRhas a neat tool chain (See References
and Resources). Availability of onlineresources and books is fast increasing.
Here, 8051 > AVR = PIC
22
3.7 ATmega8
"ATmega8 is 8-bit microcontroller with 8K bytes In-System programmable Flash"
Advanced RISC Architecture
190 Powerful instructions- Most Single-check Cycle Execution
32x8 General Purpose Working Registers
Up to 16 MIPS throughput at 16 MHz
High Endurance Non-volatile Memory segments
8K bytes of In-system Self- programmable flash program memory
512 Bytes EEPROM
1K byte internal SRAM
Data retention: 20 years at 85 degree C/100 years at 25 degree C
Peripheral features
Two 8-bit timer/counter with separate prescaler, one compare mode
one 16-bit timer/counter with separate prescaler, compare mode, and capture
mode
Real time counter with separate oscillator
Three PWM channels
8-channel ADC in TQFP and QFN/MLF package, eight channels 10-bit accuracy
6-channel ADC in PDIP package. Six channels 10-bit accuracy
Byte-oriented Two wire serial Interface
Programmable Serial USART
Master/slave SPI serial interface
Programmable watchdog timer with separate on-chip oscillator
On-chip Analog comparator
Special Microcontroller Features
Power-on reset and programmable brown out detection
Internal calibrated RC oscillator
External and Internal interrupt sources
Five sleep modes: Idle, ADC noise reduction, Power-save, power-down, and
standby.
Operating Voltages
2.7-5.5v (ATmega8L)
4.5-5.5v (ATmega8)
23
24
25
{
DDRB=0b11111111; //PORTB as output Port connected to motors
DDRC=0b0000000; //PORTC Input port connected to Sensors
//lcd_init(LCD_DISP_ON); //uncomment it if using LCD Display
//lcd_puts("Line Follower\n"); //uncomment it if using LCD Display
//lcd_puts("By Robosapiens"); //uncomment it if using LCD Display
intleft_sensor=0, right_sensor=0;
while(1) // infinite loop
{
left_sensor=PINC&0b0010000; // mask PC4 bit of Port C
right_sensor=PINC&0b0100000;// mask PC5 bit of Port C
if((left_sensor==0b0000000) & (right_sensor==0b0000000)) //if both sensors
"off"
{
PORTB=0b00000000; // stop
}
if((left_sensor==0b0010000) & (right_sensor==0b0100000)) //if both sensors "on"
{
PORTB=0b00001001; // move straight
}
if((left_sensor==0b0000000)&(right_sensor==0b0100000))
{
PORTB=0b00000001; // turn left
}
if((left_sensor==0b0010000)&(right_sensor==0b0000000))
{
PORTB=0b00001000; // turn right
}
27
3.9 APPLICATIONS
Industrial automated equipment carriers
Entertainment and small household applications.
Automated cars.
Tour guides in museums and other similar applications.
Second wave robotic reconnaissance operations
3.10 LIMITATIONS
Choice of line is made in the hardware abstraction and cannot be changed by software.
Calibration is difficult, and it is not easy to set a perfect value.
The steering mechanism is not easily implemented in hugevehicles and impossible for
non-electric vehicles (petrolpowered).
Few curves are not made efficiently, and must be avoided.
Lack of a four wheel drive, makes it not suitable for a roughterrain.
Use of IR even though solves a lot of problems pertaining to interference, makes it hard
to debug a faulty sensor.
Lack of speed control makes the robot unstable at times.
3.11 TESTING
Assumption:
The motors are connected in such a way that both motors will pull the robot forward if
both the sensors are "ON".
In the above arrangement consider the cases
Case1: Both sensors are on white surface (i.e. both are giving output as 'high'). In this
case robot will move forward
28
Case2: Left sensor is on white and right one is on black. In this case robot will take right
turn simply because right motor will stop rotating as both its inputs C and D are low.
Case3: Left sensor is on black and right sensor in on white. In this case our robot will
take left turn as left motor is off because both the inputs A and B are low.
Case4: Both the sensors are on black (i.e. there is a cross or divergence). In this case both
the motors will stop; ultimately the robot will stop at this point.
All the four cases that we have discussed above are the only possible conditions for a line
follower.
CHAPTER - 4
29
The Line following robot was finally completed. A lot of effort was put into thedesign,
implementation and days of toil in front of the computer, writing and debuggingthe code.
The robot was finally running with a few glitches here and there which weresorted in the
later revisions of the firmware. The line following robot still has a few shortcomingsbut
achieves most of the objectives.
The robot can be further enhanced to let the user decide whether it is a dark line on a
white background or a white line on a dark background. The robot can also be
programmed to decide what kind of line it is, instead of a user interface. The motor
control could be modified to steer a convectional vehicle, and not require a differential
steering system. The robot could be modified to be a four wheel drive. Extra sensors
could be attached to allow the robot to detect obstacles, and if possible bypass it and get
back to the line. In other words, it must be capable predicting the line beyond the
obstacle. Speed control could also be incorporated. Position and distance sensing devices
could also be built in which can transmit information to a mother station, which would be
useful in tracking a lost carrier.
REFERENCES
30
Books:
Programming and Customizing the AVR Microcontroller Dhananjay V. Gadre
Parallel Port Complete Jan Axelson
Links:
www.atmel.com
www.avrbeginners.net/
www.avr-asm-tutorial.net/
www.avrfreaks.net
www.lancos.com/prog.html
www.kpsec.freeuk.com/
31