Line Follower Robot

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16
At a glance
Powered by AI
The document discusses the design and programming of a line follower robot using an ATmega16 microcontroller. It describes the components, software, and code used to control the robot's movement based on sensor input.

The main components discussed are the chassis, batteries, two DC motors, an ATmega16 microcontroller board, motor driver IC, infrared sensors, and wheels.

The robot uses two infrared sensors to detect a line on the ground. It controls the two DC motors to move forward when both sensors detect the line and turn in the direction of the sensor that loses the line signal.

EMBEDDED SYSTEMS

PROJECT
(summer training)

PROJECT TITLE: LINE FOLLOWER


ROBOT
- BY ROHIT KUMAR
LINE FOLLOWER ROBOT
USING ATMEGA16 MICRO CONTROLLER

ABOUT PROJECT
*A Robot is any machine which is completely automatic, i.e.
it starts on its own, decides its own way of work and stops on
its own.
*Robots are of two type i.e. i) fixed robots ii) mobile robots
*Mobile Robots are robots with a mobile base which makes
the robot move freely in the environment. One of the
advanced mobile robots is the Line Follower Robot. It is
basically a robot which follows a particular path or trajectory
and decides its own course of action which interacts with
obstacle.
*The most important aspect of its working is to control the
robot. Here the control refers to controlling of robot motion
i.e. controlling the movement of the wheels. By controlling
the rotation of wheels we can control the motion of robot
along this path, which are placed on the shafts of the two
motors. So, the basic control is achieved by controlling the
motors. The control circuitry involves the use of sensors to
sense the path and the microcontroller or any other device to
control the motor operation through the motor drivers,
based on the sensor output.
There are two ways in which a line follower robot can be
controlled:-
i) Without microcontrollers
ii) With microcontrollers
However we have used AVR microcontroller
ATMEGA16 for calibrating the robot.

COMPONENTS: 1.chassis board


2.batteries
3. 2 dc motors
4. Bluetooth
5. AVR ATMEGA16 BOARD
6.Driver motor IC
7.COB
8. two IR sensors
9.wheels
10.AVRStdio
11.AVRdude
12.Jumper wires
Software Requirement
The software for the robot was coded in C,
because of compiler availability, our familiarity with
the language, as well as the greater control of the
system offered as compared to other high level
languages. While our microcontroller supports
assembly language, it was avoided because it’s a
difficult to maintain, and varies greatly from
processor to processor.

 eXtreme Burner - AVR


The eXtreme Burner -AVR is a full graphical user
interface (GUI) AVR series of MCU that supports
several types of clock sources for various
applications. It enables you to read and write a RC
oscillator or a perfect high speed crystal
oscillator.

ABOUT COMPONENTS:
Development Board
A general purpose 40 pin AVR development
board with 16x2 LCD support, power supply circuit,
RS232 port for serial interface with computer and
other serial devices, reset switch, power status LED,
a 6 pin ISP header and 4 x general purpose LEDs and
Switches.
The board is compatible with the Atmega16,
Atmega32 and other compatible 40 pin AVR
microcontrollers.

1. dc motors: A machine that


converts DC electrical power into
mechanical power is known as a Direct
Current motor. DC motor working is
based on the principle that when a
current carrying conductor is placed in a
magnetic field, the conductor
experiences a mechanical force.

2. AVR ATMEGA16 BOARD: The MCU socket


on board provides support for 40 pin DIP
package of AVR ATMega16 controller.
The board is designed for general purpose
applications and includes a variety of
hardware to exercise microcontroller
peripherals. It is a fantastic tool for code
debugging, development and prototyping.

3. Driver motor IC: L293D is a typical Motor


driver or Motor Driver IC which allows
DC motor to drive on either direction. L293D
is a 16-pin IC which can control a set of two
DC motors simultaneously in any direction. It
means that you can control two
DC motor with a single L293D IC. Dual H-
bridge Motor Driver integrated circuit (IC).
4. COB(Chip on board): A bare chip that is
mounted directly onto the printed
circuit board (PCB). After the wires are
attached, a glob of epoxy or plastic is used to
cover the chip and its connections. The tape
automated bonding (TAB) process is used to
place the chip on the board.

5. IR Sensors: An infrared sensor is an


electronic device, that emits in order to sense
some aspects of the surroundings. An IR
sensor can measure the heat of an object as
well as detects the motion. These types
of sensors measures only infrared radiation,
rather than emitting it that is called as a
passive IR sensor.

6. AVR STUDIO: AVR studio is an Integrated


Development Environment (IDE)
by ATMEL for developing applications based
on 8-bit AVR microcontroller. Prior to
installation of AVR Studio you have to install
the compiler WinAVR.
7.AVRDUDE: AVR Downloader Uploader - is
a program for downloading and uploading the
on-chip memories of Atmel's AVR
microcontrollers. ... All that's usually required
for a new entry is to tell AVRDUDE which pins
to use for each programming function.
8. USB AVR Programmer
Programmer is basically used for to burn program
in microcontroller.
BLOCK DIAGRAM:

WORKING PRINCIPLE
As we know that line follower robot is a self operating
robot. It detects a line and follows that line drawn on
a area. The line is indicated by white line on a block
surface or block line on a white surface. This
application is dependent upon sensors for its working.
For path detection we have used two IR sensors i.e
proximity sensor and IR sensor. The proximity sensor
is used for path detection and IR sensor is used for
obstacle detection.

Algorithm:
1. L= leftmost sensor which reads 0;
2. R= rightmost sensor which reads 0.
3. If no sensor on Left (or Right) is 0 then L (or R)
equals 0;
4. Here L=3 R=0 Left Center Right Here L=2 R=4
2.
5. If all sensors read 1 go to step 3,
else,
If L>R Move Left
If L<R Move Right
If L=R Move Forward
Goto step 4
6. Move Clockwise if line was last seen on Right Move
Counter Clockwise if line was last seen on Left Repeat
step 3 till line is found.
4. Goto step 1.

Applications of line follower robot

 Industrial Applications: These robots can be used as


automated equipment carriers in industries replacing
traditional conveyer belts.
 Automobile applications: These robots can also be used
as automatic cars running on roads with embedded
magnets.
 Domestic applications: These can also be used at homes
for domestic purposes like floor cleaning etc.
 Guidance applications: These can be used in public
places like shopping malls, museums etc to provide path
guidance.

Advantages:

 Robot movement is automatic


 It is used for long distance applications
 Simplicity of building
 Fit and forget system
 Used in home, industrial automations etc

Source Code
/*****************************************************
#include<avr/io.h>
#define leftSen PA0 //Connect Left Sensor At
PA0
#define rightSen PA1 //Connect Right Sensor
At PA1

int main(void)
{
DDRA=0xFC; // make PA0,PA1 as input for
both sensors 0x0b11111100
DDRC=0xFF; // make Port as output to connect
motor pins

while(1)
{
PINA=0x03; //initialize PA0 and PA1
if(bit_is_clear(PINA,leftSen)){ // check if left
sensor is OFF

if(bit_is_clear(PINA,rightSen)) { // check if right


sensor is OFF
PORTC=0b00000000; // if both sensor zero
} // then stop the robot
else{
PORTC=0b00000001; // if right is ON
then take left
}
}
else // check if left sensor in ON
{
if(bit_is_clear(PINA,rightSen)) { // check if right
sensor is OFF
PORTC=0b00000010; // it means left sensor is
ON
} // so take right
else{
PORTC=0b00000011; // if both sensor is ON
} // then keep moving the robot
}
}
}

FUTURE WORK:
Line following robot based health care management
system can play a vital role in the field of hospitality.
Robotics is a grooming technology. By using robot in
the government and private hospitals the cost for
the cure can be reduced. It can be very beneficially
for the patients.
In India many people hesitate to admit in the
hospital because of costly medical
practitioner. Monitoring of every patient is very
difficult for the nurses in the hospital. So a camera
can be placed in the line following robot, from which
the status for every patients can be handle from a
single room. In the bed of the patient an
accelerometer can be placed from which if a patient
have a heart attack then that device can operate a
alarm circuit.
Line following robot's application over electronics
engineering can't be underestimated. This line
following robot can be use as carrying the load and
many more applications. A GSM module can be
placed with the line following robot so that if any
mishappening occurs then that system can make a
call to the doctor.
Robotics is very big field for the new innovation and
research. By using the robot in real time
applications, a health care system can be manage in
an effectively way.
PROJECT RESULT:
ROBOT MOVEMENT LEFT MOTOR RIGHT MOTOR
straight straight straight
left stop straight
Sharp left reverse straight
right straight stop
Sharp right straight reverse
reverse reverse reverse

Possible Improvements: Use of differential steering


with gradual change in wheel speeds. -Use of Hysteresis
in sensor circuit using LM339 -Use of ADC so that the
exact position of the line can be interpolated -Use of
Wheel Chair or three wheel drive to reduce traction. -
General improvements like using a low dropout voltage
regulator, lighter chassis etc

You might also like