Final Project Review

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 34

CHAPTER 1

1. Introduction
Line follower is a machine that can follow a path. The path can be visible like a black line
on a white surface. Sensing a line and maneuvering the robot to stay on course, while
constantly correcting wrong moves using feedback from the sensor forms a simple yet
effective system. It can be used in automobile, industrial automation's, guidance, etc .

1.1. Background

As technology becomes increasingly important in today's world, it is invaluable to not


only learn how to use technology, but also to understand how to create it. Since being, the
engineer one should have sound knowledge of the other discipline. Most of the projects
have limited scope to only specific discipline. This would limit ones innovation and
creativity. This project inspires to make connections across several disciplines rather than
learning topics in isolation as it combines mechanical, electronic, electrical and
programming skills.
 It gives visual grasp of math and science.
 It builds logical thinking.
 It brings out innovation and creativity.
 It enhances problem-solving skills.
The robot designed in such way that it not only track the path and follow it but also
visualize the distance travelled through the LCD displays.

1.2. Motivation

How ants always travel in a line, following an invisible route in search of food, or back
home. How on roads the lanes is followed to avoid accidents and traffic jams. Ever
thought about a robot, which follows line? A perfect or near perfect mimic of nature?
After all the purpose of robotics is to recreate in terms of machines what one see around
to solve a problem or fulfill a requirement.
The area will be benefited from the project
 Industrial automated equipment carriers
 Entertainment and small household applications.
 Tour guides in museums and other similar applications.
 Second wave reconnaissance operations.

BVC COLLEGE OF ENGINNERING


1.3. Problem Description

In the industry, carriers are required to carry products from one manufacturing plant to
another that are usually in different buildings or separate blocks. Conventionally, carts or
trucks were used with human drivers. Unreliability and inefficiency in this part of the
assembly line formed the weakest link. The project is to automate this sector, using carts
to follow a line instead of laying railway tracks, which are both costly, and an
inconvenience.

1.4. Objectives

The objectives of the project are:


 The robot must be capable of following a line.
 It should be capable of taking various degrees of turns.
 The robot must be insensitive to environmental factors such as lighting and noise.
 It must allow calibration of the line’s darkness threshold.
 Scalability must be a primary concern in the design.
 It also shows the distance travelled by it through LCD display.

1.5. Methodology

 After the detail literature survey through the books, periodical, journal, magazine,
websites. The idea of the project is well defined.
 The logic is derived for the intelligence of the robot. It is programmed and burn it
to the Arduino by using the software Arduino® 1.65.
 The accuracy and viability of the program and electronic components is tested in
the simulation software Proteus®.
 After the successful simulation result, it is implemented in the hardware.
 After the finishing the programming, electrical and electronics part, the
stable, reliable and flexible mechanical design and fabrication is completed.
 Finally, system is tested and encountered error is omitted.

1.6. Limitations

The system has restricted to the following limitation.


 Choice of line is made in the hardware abstraction and cannot be changed by
software.

BVC COLLEGE OF ENGINNERING


 Calibration is difficult, and it is not easy to set a perfect value.

BVC COLLEGE OF ENGINNERING


 Few curves are not made efficiently, and must be avoided.
 The turning radius should be of minimum 100m to take smooth U-turning of
robot.
 The width of the path must be of 45mm so that it can cover minimum 3 sensors.
 The path should be plane and obstacle free.
 The steering mechanism is not easily implemented in huge vehicles
and impossible for non-electric vehicles.

1.7. Organization of Report

This report is a documentary delivering the ideas generated, concepts applied, activities
done It contains four chapters. The following is a description of information in this thesis.
Chapter 1 provides a general overview of the project and the use and importance of
autonomous robots in the world. The objectives, scope of project, problem statement are
also described in this chapter.
Chapter 2 describes the hardware development unit in line following robot. This chapter
describes about sensor arrays, Arduino, motor driving system, it also describes the project
methodology and explains hardware development for the design of the robot.
Chapter 3 contains the process explanation with working algorithm, flowchart and sketch
of the Arduino.
Chapter 5 contains all the results obtained from the software experiments that include the
algorithm implemented in a program.
Finally, chapter 5 will summarize the final year project. The conclusion, suggestions or
recommendations for improvements that can be implemented in future are discussed
within this chapter.

1.8. Summary

Line Follower is one of the most important aspects of robotics. A Line Following Robot
is an autonomous robot which is able to follow either a black or white line that is drawn
on the surface consisting of a contrasting color. It is designed to move automatically and
follow the plotted line. It enhances interdisciplinary approach to mechanical, electronic,
electrical and programming skills. The application of the project is range from the
individual domestic appliance to automation and control aspect of large industry. Human
are intelligent natural machine but it has serious limitation of efficiency and reliability.
Robots are made to replace dependency of human force partially. The project is somehow
designed to perform the similar task.

BVC COLLEGE OF ENGINNERING


CHAPTER 2

2. Technology and Literature Survey


The line follower is a self-operating robot that detects and follows a line that is drawn on
the floor .The line follower robot using Arduino is a self-operating system that detects
and follows track drawn on the floor. The track consists of a black path drawn on white
surface.

2.1. Basic Operation


The basic operations of line follower are as follows:
 Capture line position with optical sensors mounted at front end of the robot. For
this, a combination of IR-LED and Photodiode called an optical sensor has been
used. This make sensing process of high resolution and high robustness.
 Steer robot requires steering mechanism for tracking. Two motors governing
wheel motion are used for achieving this task.
 This system has LCD display panel to show the distance that it covers.
 On the detecting, no black surface robot move in a circular motion until line is
found.

2.1.1. Block Diagram

Main Power Motor


Supply Power
Supply
f L293D Right Motor Proximity
Arduino DC Motor Sensor
Uno Control Left Motor

LM324
Comparator
Threshold
Voltage
LCD Sensor
Panel Array

BVC COLLEGE OF ENGINNERING


Figure 2-1: Block Diagram of the Line following Robot.

BVC COLLEGE OF ENGINNERING


2.2. Hardware Required
The hardware required is divided in the following category:

2.2.1 Input System


The detail of each components is discussed below.

2.2.1.1. Optical Sensors


The robot uses photodiode sensors to sense the line; an array of four IR- LEDs (TX) and
Photodiode sensors (Rx), facing the ground used in this setup. An analog signal is
obtained in output, depends on the amount of light reflected back, which is provided to
the comparator to produce 0s and 1s which are then fed to the Arduino.

1.5 cm 1.5 cm 1.5 cm


Top View of position of sensors
Left Right
Figure 2-2: Arrangements of the Sensor

The sensors on the left named as L1, L2 and R1, R2 on the right side. Assumption should
be considered that when a sensor is on the line it reads 0 and when it is off the line it reads
1. The Arduino correspondence to the algorithm given below decides the next movement,
trying to position the robot such that all sensors read 0.
With sensors, robots can react and respond to changes in their environment in ways that
appear intelligent or life-like.

2.2.1.1.1. Arrangement of Sensors


An array of sensors arranged in a straight row pattern is bolted under the front of the
robot. It locates the position of line below the robot. Distance between two adjacent
sensors is about 1.5 cm.
We can use any number of sensors. If we have low number, then our robot movement is
not smooth and it may face problems during sharp turns. If higher number of sensors
were, used robot movement will become smooth and reliable for sharp turns; it requires
complex programming for micro-controller and requires more hardware, which is its
disadvantage. Thus, optimum number of sensors required.

BVC COLLEGE OF ENGINNERING


2.2.2. Comparator
Comparator is a device, which compares two input voltages and gives output high or low.
In circuit diagram it is normally represented by a triangle having-Inverting (negative)
Input, Non-Inverting (positive) Input (+), Vcc, Ground, Output.
Properties of comparator:
If V+ > V- then Vo=Vcc (Digital High Output is 1)
If V+ < V- then Vo=0 (Digital Low Output is 0)

VCC 5V

Inverting(-ve) -
Input Co mparator
Non-Inverting OUTPUT (Vo)
(+ve) Input

GROUND

Figure 2-3: Schematic of Comparator Logic

2.2.2.2.1. Optical sensor


As shown above that, two inputs are required for comparator. One input is from photo-
receiver (like Photodiode), resistor generates other. The second voltage is reference
voltage for that sensor.

Figure 2-4: Optical Sensor schematic

BVC COLLEGE OF ENGINNERING


2.2.2 PROCESSIMG UNIT
Processing system acts as the brain of robot, generating desired output for corresponding
inputs, in which microcontrollers are used. There are several companies nowadays that
manufacture microcontrollers, for example ATMEL corporation, Microchip, Intel,
Motorola etc. We will be using ATmega32L microcontroller in our robot. It is known as
AVR1.

2.2.1.2. Arduino
Arduino is an open-source computer hardware and software company, project and user
community that designs and manufactures microcontroller-based kits for building digital
devices and interactive objects that can sense and control objects in the physical world.
The heart of Arduino is the microcontroller. For Arduino Uno ATmega328 is used. It has
specification of 8 bit CPU, 16 MHZ clock speed, 2 KB SRAM 32 KB flash Memory, 1
KB EEPROM [2].

Features:-

 14 digital input output pins ( 3,5,6,9,10 and 11 pins are able to generate PWM).

 6 analog input pins

 Voltage input from the 7 – 12 V

Figure 2-5: Arduino Uno Schematic

BVC COLLEGE OF ENGINNERING


2.2.2.output
The output system is designed with the function of the following components.

2.2.2.1 Motor Driver


Motor driver is a current enhancing device; it can also be act as Switching Device. Thus,
after inserting motor driver among the motor and microcontroller. Motor driver taking the
input signals from microcontroller and generate corresponding output for motor.

IC L293D
This is a motor driver IC that can drive two motor simultaneously. Supply voltage (Vss)
is the voltage at which motor drive. Generally, 6V for dc motor and 6 to 12V for gear
motor are used, depending upon the rating of the motor. Logical Supply Voltage deciding
what value of input voltage should be considered as high or low .So if the logical supply
voltage equals to +5V, then -0.3V to 1.5V will be considered as Input low voltage and
2.3V to 5V is taken into consider as Input High Voltage. The Enable 1 and Enable 2 are
the input pin for the PWM led speed control for the motor L293D has 2 Channels .One
channel is used for one motor.2

Figure 2-6: Pin Configuration IC L293D

BVC COLLEGE OF ENGINNERING


2.2.3.2. DC Motor

Motor is a device that converts any form of energy into mechanical energy or imparts
motion. In constructing a robot, motor usually plays an important role by giving
movement to the robot. In general, motor operating with the effect of conductor with
current and the permanent magnetic field. The conductor with current usually producing
magnetic field that will react with the magnetic field produces by the permanent magnet
to make the motor rotate.There are generally three basic types of motor, DC motor, even
servomotor and stepper motor, which are always being used in building a robot.

DC motors are most easy for controlling. One DC motor has two signals for its
operation. Reversing the polarity of the power supply across it can change the direction
required. Speed can be varied by varying the voltage across motor.

Figure 2-7: Low Volt DC Gear Motor attach with Wheel.

BVC COLLEGE OF ENGINNERING


2.2.3.2. LCD Display

In our project it is used to display the distance travelled by the robot through the output
from the tachometer system.

Figure 2-8: Schematic of LCD Panel

BVC COLLEGE OF ENGINNERING


2.2.3.3. Proximity Sensor

The combination of IR- LED and Photodiode is used as the reflective optical sensor. It
generate interrupt when the IR-beam is break to the photodiode. To create the IR break-
beam, IR LED is used with a low value resistor so that it shines very bright. The receiver
is Photodiode, which biases 'on' whenever the IR LED's light is detected. A sensor will be
placed adjacent the IR link and turned on to generate a pulse to the Arduino. The Arduino
LCD interface is used to show the covered distance digitally.

Figure 2-9: Proximity Sensor

2.3. Software Required


For the simulation of the circuit, Proteus® software is used. For coding and uploading the
sketch, the Arduino 1.65 ® is used .

2.4. Summary
The system is completed in to the three divison i.e is the Input system, Processing System
and Output system.
Input system comprises of the optical sensor, is an array of 4 IR-LED and Photodiode
pairs arranged in the form straight lines. The output from each sensor is fed into an analog
comparator with the threshold voltage (used to calibrate the intensity level difference of
the line with respect to the surface). These 4 signals(from each photo-reflective sensor) is
given to a priority analog input of the arduino [3].
Processing system is Arduino Uno interface consisting microcontroller Atmega328 which
works on the basic of the logic of the program burn to it.
Output system consist combination L293D and gear-motor The control has 6 modes of
operation, turn left/right, move left/right, and drift left/right. The actual action is caused
by controlling the direction/speed of the two motors (the two back wheels), thus causing a
turn.

BVC COLLEGE OF ENGINNERING


CHAPTER 3

3. Design and Implementation

3.1. Schematic
The schematic of the “Line Following Robot” is shown in the figure. The main
component is the Arduino Uno. Schematic is drawn by using Proteus.

The main features incorporated into the hardware are given below:
 Ardunio Uno.
 The IR-LED with IR illuminance, modified to be reflective sensor.
 The LM324 quad comparator IC.
 A potentiometer to calibrate the reference voltage.
 The H-bridge motor control IC (L293D)
 Motors, with coupled reduction gears.
 Connectors to join the different boards to form one functional device.
 A pair of IR-LED and Photodiode is used as proximity sensor for the designing
techometer
Each of the hardware is dissected and was designed/implemented separately for their
functional and later incorporated as one whole application. This helped in the debugging
processes.

The schematic of the circuit is given in the next page.

BVC COLLEGE OF ENGINNERING


ARDUINO IDE (FOR PROGRAMMING ARDUINO)

BVC COLLEGE OF ENGINNERING


12

CIRCUIT DIAGRAM

BVC COLLEGE OF ENGINNERING


3.2. Arduino Working Logic

Thus totally the microcontroller gets 4 inputs from the sensor circuitry, to the (A3 – A0)
of Arduino to decide what to do when on the line. Below is the complete description
about what each input mean and what needs to be done [4].

Table 1: Arduino Working Logic


Input Output State In Action
(PWM)
A0 A1 A2 A3 9 10
0 0 0 0 255 255 All sensor in Go straight
position
1 0 0 0 255 191 Leftmost sensor is Move right
out of track.
1 1 0 0 255 127 Two sensor from Turn right
the left is out of
track
1 1 1 0 255 64 Three sensor from Sharp turn right
the left is out of
Track
0 0 0 1 191 255 Rightmost sensor is Move left
out of track
0 0 1 1 127 255 Two sensor from Turn left
the right is out of
track
0 1 1 1 64 255 Three sensor from Sharp turn left
the left is out of
Track
1 1 1 1 0 255 All sensor is out of Move circularly
track Until track is
detected

BVC COLLEGE OF ENGINNERING


3.3. Process Explanation
As shown in the data below, is a typical situation involved. At every sampled time the
commands executed by the Arduino is also shown. From the below figure, it should be
clear about the software requirements [5].

Sensor

Path

.Go Straight Move right for the right most condition


and move left for left most condition

Turn right for the rightmost condition Sharp turn right for the rightmost condition
and turn left for left most condition. and sharp turn left for left most condition.

Move circular until the line is traced down

Figure 3-2: Line Following Process

BVC COLLEGE OF ENGINNERING


3.4. Programming and Simulation
The program code acts as the decision-maker embedded in the micro-controller deciding
about the outputs for particular set of inputs.The program is coded using Arduino®
1.65.and is then compiled to form a “.hex” file which can then be burnt into the
Arduino.The output is also checked in simulation using Proteus® [6] .

3.4.1. Flowchart.
The following chart shows implemented logic.

BVC COLLEGE OF ENGINNERING


3.5. Summary
The logic behind the working of Arduino is to analyse the input from the sensor according
to program fed to it and provide corresponding output to the the motor driver which
finally drive the motor in such way that, it produce required motion.
The differential steering system is implemented to turn the robot. In this system, each
back wheel has a dedicated motor while the front wheels are free to rotate. To move in a
straight line,both the motors are given the same voltage . To manage a turn of different
sharpness, the motor on the side of the turn required is given lesser voltage as level of
steering required.

BVC COLLEGE OF ENGINNERING


CHAPTER 4

4. Result and Analysis


The practical analysis of the components and the mathematical calculation is performed at
different stage.
Dc motor are most easy for controlling. One dc motor has two signals for its operation.
Reversing the polarity of the power supply across it can be change the direction required.
Speed can be varied by varying the voltage across the motor. The Dc motor don’t have
enough torque to drive the robot directly. So in order to solve the problem the dc gear
motor is which increase the torque of the dc motor in the expense of the speed.

Mathematical Interpretation:
Rotational power (Pr) is given by:
Pr= Torque (T) X Rotational Speed (ω)
𝑝𝑟
Γ=
𝜔
Pr is constant for DC motor for a constant input electrical power. Thus torque (T) is
inversely proportional speed (ω)
1
Γ≁
𝜔

4.1. Speed Control


The speed of the dc motor is control by feeding PWM from Arduino to the enable pin of
the L293D, which change the voltage across the motor. Due to which speed is also
decreased. On the command over the speed and the direction is also controlled.

4.2.1. PWM Speed Control

BVC COLLEGE OF ENGINNERING


Calculation:
1 𝑡𝑜𝑛
A= ∫ 𝑉𝑑𝑡
0

1 𝑡𝑜𝑛
A= ∫ 12𝑑𝑡
0

𝑡𝑜𝑛
𝐴 = 12
𝑡

𝐴 = 12 × 𝜌

Where ρ is the duty cycle of the PWM control signal; this shows that by varying the duty
cycle of the PWM control, we effectively vary the DC voltage supplied to the motors,
thus controlling their speed. This is generated by the Arduino built-in hardware [9].

4.2.2. Practical Result Analysis


Here the motor is tested under all condion in the lab. The reading of the motor RPM and
the voltage across it is illustrated below. Inertia is neglected.

Table 2: Analysis of effect of PWM on RPM of


Duty cycle (ρ) Voltage across Motor RPM
0% 0 0
25% 3 16
50% 6 29
75% 9 45
100% 12 58
Motor

BVC COLLEGE OF ENGINNERING


4.2. Digital Revolution Counter
A Digital RPM counter is a measuring instrument, which can measure the number of a
rotation machine digitally. The similar concept is used in instrument called
“Tachometer”. It is an important measuring device in the field of electrical engineering &
widely used in industries and laboratorial work. IR- Pair is the heart of the system, which
found the number of revolution. It works by detecting the black spot in the wheel and
transfer digital high to the Arduino.

4.3.1. Calculation
The system is designed in such way that it updates the distance value in every 5 seconds.
i.e. 12 times per minute.

4.3.2. Practical Result Analysis


Here the build revolution counter is used as Tachometer tested under all condion in the
lab with reference of standard Tachometer. The reading of the motor RPM is illustrated
below.

Table 3: Comparison between standard Tachometer and Build


Voltage RPM RPM Percentage
Across Motor (Standard Tachometer) (Build Tachometer) Error
3 70 75 6.25%
6 120 132 9.3%
9 184 173 6.67%
12 258 235 10.4%
15 330 284 12.4%
Tachometer

4.4. Summary
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital
means. Digital control is used to create a square wave, a signal switched between on and
off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0
Volts) by changing the portion of the time the signal spends on versus the time that the
signal spends off. The duration of "on time" is called the pulse width. To get varying
analog values, change or modulate that pulse width.
Since, the build tachometer can be used, as from the analysis the error percentage within
limit, for the maximum rpm is to be measured i.e. 250 rpm.

BVC COLLEGE OF ENGINNERING


CHAPTER 5

5. Kinematics of the Robot


The backbone of our design is the differential steering system which is familiar from
ordinary life because it is the arrangement used in a wheelchair. Two wheels mounted on a
single axis are independently powered and controlled, thus providing both drive and
steering. Additional passive wheels (usually casters) are provided for support. Most of us
have an intuitive grasp of the basic behavior of a differential steering system. If both drive
wheels turn in tandem, the robot moves in a straight line. If one wheel turns faster than the
other, the robot follows a curved path. If the wheels turn at equal speed, but in opposite
directions, the robot pivots [7].

Figure 5.5-1: The Differential steering model

𝑆𝐿 = 𝑟𝜃
𝑆𝑅 = (𝑟 + 𝑏)𝜃

𝑆𝑀 = (𝑟 + 𝑏) 𝜃
2

Where SL and SR give the displacement for the left and right wheels respectively, r is the
turning radius. b is the distance between wheel, and 𝜃 is the angle of turn. SM is the
speed at the center point as the main axle.

BVC COLLEGE OF ENGINNERING


5.1. Mechanical Design
The chassis of the robot is made up of the acrylic glass since it can carry more load and
have lighter in weight.
The detail orthographic projection of the robot is drawn at the appendix.

Design of Path
The path consists of three U-turns of different radii. Among three, the system swiftly turn
two U-turn and it goes out of track in one initial U-turn and retrace it’s path.

BVC COLLEGE OF ENGINNERING


Figure 5-2: Path of the Line Following Robot

BVC COLLEGE OF ENGINNERING


Picture of Line Following Robot
The picture of the line following robot is captured by the still camera at some angle and
shown below.

Figure 5-3: Top View of the Line following Robot

BVC COLLEGE OF ENGINNERING


5.2.1 Turning Radius
The turning radius of a vehicle is the radius of the smallest circular turn (i.e. U-turn) that
the vehicle is capable of making. The term ‘turning radius’ is a technical term that is
commonly used to mean the full diameter of the smallest circle, but in technical usage the
turning radius still is used to denote the radius.
Calculation :
The total length of the robot car is 172mm (approx. 17.2mm.) the minimum turning
radius that it can turn sharply.

The diagram in which robot car is making a turn. The situation is show in the figure
above. The wheels are shown shaded in the figure. The front wheel’s center is P and the
rear wheel’s center is Q. Let O be the center of the circle, along whose circumference the
car moves. Let L=PQ be the length of the car and let R be the radius of the circle.
Sharpest turn corresponds to smallest possible value of R. Note that PQ is a chord of the
circle. Let us say that the front wheel can rotate at most by an angle w relative to the
‘straight’ position. For triangle OPQ [11].
u + 2v = 1800 (1)
also , w + v = 900 (2)
From, cosine rule for OPQ:
L2 = R2 + R2 – 2R2 cos(u) (3)
n
From eq (1), (2) and (3)
𝐿
𝑅= 2𝑠𝑖𝑛𝑤

At the maximum value of sin i.e 1 . The turning radius is found to be L/2 = 87.2mm.

Now, the velocity of the automobile is the prime factor to determine the ability to take
turn smoothly or not. So we have to derive the relation between the the turning radius and
The velocity of the robot car.

BVC COLLEGE OF ENGINNERING


Turning Radius(r) = 100mm.
Acceleration due to gravity(g) = 9.81m/s2 = 9.81×100 mm/s2
Velocity(v) = ?
Coefficient of friction between rubber and cardboard (µ) = 0.07 [11]
v = √µ𝑟𝑔
= √0.07 × 8.75 × 9810
= 245.20mm/s = 24.52cm/s
Which is attained at the speed of 1.4rps (or, 84 rpm).

5.2. Summary
The main criteria of the mechanical design is mainly depends upon the differential
steering mechanism, turning radius. The calculation of turning radius is necessary because
it finds out the mechanical limitation for the types of the curve which is avoded. The
turning radius for the design is found to be 100mm .
So, in case of designing path the maximum turning radius mustn’t be less than 100mm

BVC COLLEGE OF ENGINNERING


CHAPTER 6

6.1. Conclusion
The line following robot is automobile system that has ability to recognize its path, move
and change the robot's position toward the line in the best way to remain in track.
This project report presents a photodiode sensor based line follower robot design of
200gm weigh, which always directs along the black line on white surface. The
electromechanically robot dimension is 192×100×70 mm 3 with max rpm 180 at no load
and frictionless condition. The minimum turning radius for the system is 100mm at
velocity of 24.2 cm/s. The robot is able to detect it’s path in case it is out of path.

The line following robot project challenged the group to cooperate, communicate, and
expand understanding of electronics, mechanical systems, and their integration with
programming. The successful completion of every task demonstrated the potential of
mechatronic systems and a positive group dynamic.

6.2. Future Work


In the process of development of the line follower, most of the useful feature is identified
and many of them was implemented. But due to the time limitations and other factor
some of these cannot be added.
So the development features in brief:
 Use of color sensor.
 Use of ccd camera for better reconigsation and precise tracking the path..

BVC COLLEGE OF ENGINNERING


BIBILOGRAPHY
[1] https://www.youtube.com/c/meworkstelugu (iot and Arduino projects)

[2]J. Warren, J. Adams and H. Molle, "Arduino for Robotics," in Arduino Robotics,
New York, Apress publication, 2014, pp. 51-83.

[3]Jim, "PWM/PID/Servo Motor Control," 2005. [Online]. Available: http://www.uoxray


uoregon.edu. [Accessed 15 December 2015].

[4]Komonya, S. Tachi, K. Tania, "A Method for Autonomous Locomotion of .Mobile


Robots,''in Journal of Robotics Society of Japan, vol. 2, pp.222-231, 1984.

[5]S. Monk, Programming Arduino Getting Started with Sketches, New Delhi, India: Tata
Macgrawhill, 2012.

[6]Open Source community, " Open Source Sketch," January 2015. [Online]. Available:
https://www.arduino.cc/en/Guide/Introduction. [Accessed 25 November 2015].

[7] A. Parsad, "Line Following Robot,"Dept. Elex. & Comm. Eng., Visvesvaraya
Technological University, Bangalore, India, 2005

[8]S. Bhatia, "Engineering garage," 23 May 2011. [Online]. Available:


http://www.engineersgarage.com//tachometer-microcontroller-circuit-project.
[Accessed 03 March 2016].

[9]S. Deborah and Md. Jinnah, "Digital RPM meter using Arduino,"Dept. Elect.Eng.,
Ahsanullah Univ. of Sci. & Tech., Dhaka, Bangladesh, 2012.

[10] Zin, "Alldatasheet," March 2003. [Online]. Available:


http://www.alldatasheet.com [Accessed 06 December 2015].

[11] Wordpress"Turning radius of the Car," July 2013 [Online]. Available:


https://goodmaths.wordpress.com/2013/07/19/turning-radius-of-a-car/.
[Accessed 28 June, 2016]

BVC COLLEGE OF ENGINNERING


APPENDICES
PROGRAM CODE
// Black Line Follower
#define in1 9
#define in2 8
#define in3 7
#define in4 6
#define enA 10
#define enB 5

int M1_Speed = 150; // speed of motor 1


int M2_Speed = 150; // speed of motor 2
int LeftRotationSpeed = 250; // Left Rotation Speed
int RightRotationSpeed = 250; // Right Rotation Speed

void setup() {

pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(in3,OUTPUT);
pinMode(in4,OUTPUT);

pinMode(enA,OUTPUT);
pinMode(enB,OUTPUT);

pinMode(A0, INPUT); // initialize Left sensor as an input


pinMode(A1, INPUT); // initialize Right sensor as an input

void loop() {

int LEFT_SENSOR = digitalRead(A0);


int RIGHT_SENSOR = digitalRead(A1);

BVC COLLEGE OF ENGINNERING


if(RIGHT_SENSOR==0 && LEFT_SENSOR==0) {
forward(); //FORWARD
}

else if(RIGHT_SENSOR==1 && LEFT_SENSOR==0) {


right(); //Move Right
}

else if(RIGHT_SENSOR==0 && LEFT_SENSOR==1) {


left(); //Move Left
}

else if(RIGHT_SENSOR==1 && LEFT_SENSOR==1) {


Stop(); //STOP
}
}

void forward()
{
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);

analogWrite(enA, M1_Speed);
analogWrite(enB, M2_Speed);
}

void backward()
{
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

analogWrite(enA, M1_Speed);

BVC COLLEGE OF ENGINNERING


analogWrite(enB, M2_Speed);
}

void right()
{
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);

analogWrite(enA, LeftRotationSpeed);
analogWrite(enB, RightRotationSpeed);
}

void left()
{
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

analogWrite(enA, LeftRotationSpeed);
analogWrite(enB, RightRotationSpeed);
}

void Stop()
{
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
}

BVC COLLEGE OF ENGINNERING

You might also like