robot demo bb1

60
1 Grid Solving Robot Using Shortest Path Algorithm Submitted in partial fulfillment of requirements For the degree of Bachelors in Information Technology by Medha Jagdish Sejpal Thakkar Roll No: 1114053 Hiten Mohanlal harbar Roll No: 1014034 Kunal Uday Kadam Roll No: 1014043 GuideProf. Yogesh Golhar Department of Information Technology K. J. Somaiya College of Engineering, Mumbai-77 (Autonomous College Affiliated to University of Mumbai) Batch 2011 -2015

Transcript of robot demo bb1

1

Grid Solving Robot Using Shortest Path Algorithm

Submitted in partial fulfillment of requirements

For the degree of

Bachelors in Information Technology

by

Medha Jagdish Sejpal Thakkar

Roll No: 1114053

Hiten Mohanlal harbar

Roll No: 1014034

Kunal Uday Kadam

Roll No: 1014043

GuideProf. Yogesh Golhar

Department of Information Technology

K. J. Somaiya College of Engineering, Mumbai-77 (Autonomous College Affiliated to University of Mumbai)

Batch 2011 -2015

2

K. J. Somaiya College of Engineering, Mumbai-77 (Autonomous College Affiliated to University of Mumbai)

Certificate

This is to certify that the Dissertation entitled “Grid Solving Robot Using Shortest Path

Algorithm” is bona fide record of the dissertation work done by

1. Medha Jagdish Sejpal Thakkar

2. Hiten Mohanlal Harbar

3. Kunal Uday Kadam

in the year 2014-15 under the guidance of Prof. Yogesh Golhar of Department of Information

Technology in partial fulfillment of requirement for the Bachelors Degree in Information

Technology of University of Mumbai.

_________________ _____________________

Guide Head of the Department

_________________ _________________

Co-Guide Principal

Date:

Place: Mumbai-77

3

K. J. Somaiya College of Engineering, Mumbai-77 (Autonomous College Affiliated to University of Mumbai)

Certificate of Approval of Examiners

We certify that this project report entitled “Quiz Application” is bona fide record of project

work done by

1. Medha Jagdish Sejpal Thakkar

2. Hiten Mohanlal Harbar

3. Kunal Uday Kadam

This project is approved for the award of Bachelors Degree in Information Technology of

University of Mumbai.

_________________ _________________

External Examiner Internal Examiner

Date:

Place: Mumbai-77

4

Abstract

This book is meant to serve as a guide for our project – GRID SOLVING ROBOT USING SHORTEST PATH

ALGORITHM. The Robot follows the black line which is drawn over the white surface. The sensors are used

to sense the line. When the light signal falls on the white surface, it gets reflected and if it falls on the black

surface, it is not reflected, this principle is used to scan the Lines for the Robot. All the above systems are

controlled by the Microcontroller.

The robot traverses entire Grid in a defined manner until it detects any object in its way and if it detects any

object, it goes to source using shortest path from that location. We are calculating the shortest path in terms of

number of hops or nodes traverses by the robot, for this purpose we are implementing a counter which keeps

the track of number of nodes traverses, which in turn helps our robot to take the desired shortest path

efficiently.

The Grid Solver robot is one of the self line detecting autonomous machines that follows a predefined path that

is visible like a black or white line has drawn either on white or black surface respectively. This kind of robot

should sense the line with its LEDLDR sensors that installed under the robot. After that, the data is transmitted

to the processor by specific transition buses. Hence, the processor is going to decide the proper commend and

then it sends them to the driver and thus the path will be followed by the line follower robot.

After reaching its destination, the robot returns to its initial point using an optimal shortest path from that node

to initial node. In this project the aim is to find the shortest path from which a mobile robot can take from the

destination to reach to the start point. The presented approach provides a close to optimal short search path

which the robot can traverse. The shorter the path, the less time the robot takes to travel to the start point and

less power is consumed.

Key words: Provide Line Following, Grid Solving, Shortest path Algorithm, ATMEGA 16, Microcontroller

5

Contents

List of Figures i

List of Tables iii

1 Introduction 1

1.1 Problem Definition 1

1.2 Existing System 1

1.3 Motivation Of Thesis 1

1.4 Scope of the thesis 1

2 Literature Survey 4

3 Software Project Management Plan 6

3.1 Introduction 6

3.1.1

Project Overview 6

3.1.2 Scope 6

3.1.3 Project Deliverables 6

3.2 Project Organization 7

3.2.1 Software Process Model 7

3.2.2 Roles and Responsibilities

8

3.2.3 Tools and Technique 8

3.3 Project Management Plan 8

3.3.1 Tasks 8

3.3.2 Assignment 9

3.3.3 Time Table 10

6

3.3.4 Risk Management 10

4 Software Requirements Specifications 12

4.1 Introduction 12

4.1.1 Purpose 12

4.1.2 Audience Definitions 12

4.1.2.1 Audience Definitions 12

4.1.3 References 12

4.1.4 Scope 12

4.2 Overall Description 13

4.2.1 Product Perspective 13

4.2.2 Product Functionality 14

4.3 Specific Requirements 15

4.3.1 Hardware Interfaces 15

4.3.2 Software Interfaces 15

4.3.3 Software Product Features (Functional Requirements) 15

4.3.4 Software System Attributes (Non Functional Requirements) 16

4.3.4.1 Performance Requirement 16

4.3.4.2 Safety Requirement 16

4.3.4.3 Availability 16

5 System Design Document 17

5.1 Introduction 17

5.1.1 Design Overview 17

5.1.1.1 System Architecture 17

7

5.1.1.2 Technologies Used 17

5.1.2 Requirement Traceability Matrix 18

5.2 Diagrams 19

5.2.1 Use Case Diagram 19

5.2.2 Activity Diagram 20

5.2.3 DFD Diagram 21

5.2.4 Sequence Diagram 22

5.2.5 Deployment Diagram 23

5.2.6 Component Diagram 23

5.2.7 Collaboration Diagram 24

6 Implementation 25

6.1 Technologies & Framework 25

7 Software Test Document 40

7.1 Introduction 40

7.1.1 System Overview 40

7.1.2 Test Approach 40

7.2 Test Plan 41

7.2.1 Features to be Tested 41

7.2.2 Features not to be Tested 41

7.2.3 Testing Tools and Environment 41

7.3 Test Case Specification 42

8 Result & Discussion 43

9 Conclusions and Scope for future work 44

8

9.1 Conclusion 44

9.2 Scope for future work 44

References 45

Author’s Publication 46

Acknowledgement 52

i

List of Figures

Fig 3.2.1 Incremental process Model 7

Fig 3.3.3 Gantt Chart 10

List of Figures

Fig 5.2.1 Use case 19

Fig 5.2.2 Activity Diagram 20

Fig 5.2.3 DFD Level 0 21

Fig 5.2.3 DFD Level 1 21

Fig 5.2.4 Sequence Diagram 22

Fig 5.2.5 Deployment Diagram 23

Fig 5.2.6 Component Diagram 23

Fig 5.2.7 Collaboration Diagram 24

ii

List of Tables

3.1.3 Project Deliverables 6

3.2.2 Roles and Responsibilities 8

3.3.2 Assignment 9

3.3.4 Risk Management 10

5.1.2 Requirements Traceability 18

7.2.1 Features to be Tested 41

7.3 Test Case Specification 42

3

INTRODUCTION

1.1. Problem Definition:

This project is basically designed to move on any grid made of contrasting colour strips [black strips on

white base or vice versa] .It moves on a zigzag pattern of wheels mounted on the chasis. It would move

accordingly while following a line as well as on junction of the strips when encountered. This robot

traverses entire Grid in a defined manner until it reaches its destination. Then it travels to the start

location via a shortest path from that location. If the robot finds any obstacle in its path then it moves

from that location to the start location using a shortest path.

1.2. Existing System:

The existing system consists only of the line following robot which travels in a straight line following the

black line which is time consuming for the robot and humans.

1.3 Proposed System

The planned system is to find a shortest path from source to destination so as to reduce the time required for

travelling and to send the robot to such places where it is not possible for humans to go.

1.4 Scope of the thesis:

This project is basically designed to move on any grid made of contrasting colour strips [black strips on

white base or vice versa] .It moves on a zigzag pattern of wheels mounted on the chasis . It would move

accordingly while following a line as well as on junction of the strips when encountered. Our robot

traverses entire Grid in a defined manner until it reaches its destination. Then it travels to the start

location via a shortest path from that location.

It should provide overview of the project selected us and defines the Motivation

behind the project selected and Scope of project selected.

4

LITERATURE SURVEY

2.1 A New Generation Grid Solver Robot System for Object Picking using Shortest Path

Ankita Saxena Department of Computer Science,

Medi-Caps Institute of Technology and Management, Rajiv Gandhi Technical University, Bhopal, India

[email protected]

Abhinav Saxena Department of Electronics and Communication,

Amity School of Engineering and Technology, Amity University, Noida, U'P; India

[email protected]

In this paper they have proposed a technique for Line Following and Grid Solving of the robot.

They have also presented a technique for turning the robot left and right according to the black line.

The information about, the sensors used, the LED used, the structure of the robot, the IR sensors,

chassi body, Microcontroller band etc., has been provided in this particular paper.

They have also mentioned technique for detecting and picking the obstacle out of which we are only

going to refer to obstacle detection part for now. A simple path planning robot is also mentioned in

this particular paper.

The results after testing the robot are also mentioned in this paper.

2.2 An Implementation Of Path Planning Algorithms For Mobile Robots On A Grid Based Map Alexander Baldwin,

Daniel Johnson, Peta Wyeth, Penny Sweetser

Tolga YÜKSEL Abdullah SEZGİN e-mail : [email protected] e-mail : [email protected]

Ondokuz Mayıs University , Electrical & Electronics Engineering Department , 55139 Kurupelit-SAMSUN-TURKEY

The authors have mentioned various algorithms, like Breath-first search algorithm, A* algorithm and Dijkstra Algorithm, which can be used for finding the shortest path of the robot.

Among these algorithms, the best algorithm is the The Breath-First Search Algorithm. We are going to use this algorithm for our project. Also path planning for multi-goal cells is discussed in this paper.

It provides literature done to understand the topic.

5

Like the previous paper, experimental results are also given in this paper for the purpose of reference only.

The CPU time consumed for each algorithm is also displayed and by analyzing it we get to know the best algorithm.

2.3 DESIGN AND IMPLEMENTATION OF PATH PLANNING ALGORITHM FOR WHEELED MOBILE ROBOT IN A KNOWN DYNAMIC ENVIRONMENT

Rahul Sharma K M.Tech Studen Electrical and Electronics Department

Amrita school of engineering, Coimbatore, India [email protected]

In this paper, the authors have discussed the shortest path scenario in static environment as well as in

dynamic environment.

The experiment has been performed and the conclusions have been drawn for this project.

6

SOFTWARE PROJECT MANAGEMENT PLAN (SPMP)

3.1Introduction

This document will propose all features and procedures to develop the system.

This document specially contains details about objectives, scope limitation, process model, primary

requirements, team development, possible project risks, project schedule, and finally monitoring and

reporting mechanisms.

Grid Solving Robot Using Shortest Path Algorithm, apart from its obvious use in industries, is very useful

to send the robot to places where it is not feasible for humans to reach .For example, In places where

natural disaster has occurred, or on satellites (if any problem occurs).

3.1.1. Project Overview

In this system, the robot will calculate the shortest path for travelling. This project has been developed in

Embedded C as it is designed with a bias for system programming for embedded systems with performance,

efficiency and flexibility of use as its design requirements. This robot is based on the Breath-First Algorithm

which is a shortest path algorithm. It is one of the best algorithms for finding shortest path.

3.1.2. Target Audience

This document is meant to be used by developers, testers and for the clients of the system.

3.1.3. Project Deliverables

Name of Deliverable Due Date

Scope, Functional and Non Functional Requirements, Technology, Tools 13/08/14

Software Project Management Plan 13/08/14

Software Requirements Specification 20/08/14

Software Design Document-Data Architecture, User Interface and

Procedural/Component

03/09/14

System Test Document 10/09/14

Overall Report 18/10/14

Project Module 1 01/11/14

Project Module 2 01/02/15

Project Module 3 01/03/15

The Software Project Management Plan (SPMP) for this project defines the project management goals of the project and includes a description of the deliverables and deadlines.

7

3.2. Project Organization

3.2.1 Software Process Model

Incremental Process model

We have chosen the Incremental Process model for our project. Incremental programming is a development

method somewhere in between the Waterfall Method and Extreme Programming. Its main focus is on

making many revisions of the software, each one getting closer and closer to the customer’s specifications.

When the project is started, the customer will outline the basic specifications of the project, and the

development team will work on getting a first increment running. After this is done, both parties will have a

meeting to discuss the next increment, and the process is repeated until the project is finished.

After each iteration, the customer takes the release and uses it to test the functionality. After he has done

evaluating it, he will go back and modify the design to fix any problems he has found during the evaluation,

and then the programming team will continue development with the new design.

To solve an actual problem in an industry, software developer or a team of developers must integrate with a

development strategy that includes the process, methods and tools, layer and generic phases. This strategy is

often referred to a process model or a software developing paradigm.

The steps of incremental model are:

Communication

Planning

Modelling

Construction

Deployment

8

3.2.2. Roles & Responsibilities

Medha

Sejpal

Hiten Harbar Kunal

Kadam

1. Meeting with

client X X X

2. Interviewing with

client X X X

3. Feasibility Testing X X X

4. Design-Deciding

for robot and

microcontroller

X X X

5. Design-

Documentation X X

6. Coding Module 1 X X

7. Verifying Module

1 X X

8. Coding Module 2 X X

9. Verifying Module

2 X X

10. Coding Module 3 X X

11. Verifying Module

3 X X

12. Testing-Unit X X

13. Testing-Manual X X X

14. Testing-

Performance X X

3.2.3. Tools & Technique

Operating System : Windows XP

Software used : WIN AVR Studio

Programming language : Embedded C

3.3. Project Management Plan

3.3.1. Tasks

1. Requirement Gathering-Meeting with Client

2. Requirement Gathering-Interviewing Clients

3. Feasibility Testing-Testing for feasibility

4. Design-Deciding for robot and microcontroller

5. Design-Documentation

9

6. Coding & Verifying-Building Module 1

7. Coding & Verifying-Building Module 2

8. Coding & Verifying-Building Module 3

9. Testing-Unit Testing

10. Testing-Manual Testing

11. Testing-Performance Testing

12. Testing-User Acceptance Testing

3.3.2. Assignment

Roll Nos. Members Assignment

1114053

1014034

1014043

Medha Sejpal

Hiten Harbar

Kunal Kadam

Requirement Gathering

1114053

1014034

Medha Sejpal

Hiten Harbar Feasibility study

1014043 Kunal Kadam Robot, Microcontroller

Design

1114053

1014034

1014043

Medha Sejpal

Hiten Harbar

Kunal Kadam

Robot, Microcontroller

development

1014034

1014043

Hiten Harbar

Kunal Kadam Testing

10

3.3.3 Time Table

3.3.4 Risk Management

Risk Probability Effects Risk planning strategy

The experienced staff in

the team leaves the

project before it finishes,

or someone was ill

low serious

Use more than one staff for each

section, which might minimize this risk.

Also, manager tries to increase salary

for him.

The methodology to

solve the problem can't

work in a proper manner.

high serious Must study more than one methodology

to minimize this risk.

Budget is not enough or

there is no budget. low catastrophic

Put a condition in the contract if there

are more expenses, the funding side

must pay it: to avoid this risk.

HW requirement didn’t

come in the time. moderate serious

See if there is any more time to delay

the project or not. If there is no more

time, work by the team computers, to

minimize this risk.

11

Product Risks:

Risk Probability Effects Risk planning strategy

Packages and

Development tools are

not enough.

high serious

Put a condition in the contract to

increase the time of project delivery if

any problem occurs: to avoid this risk.

Can't find the suitable

components. high tolerable

Programmer must have professional

programming skills to write a new code,

which minimizes this risk.

Business Risks:

Risk Probability Effects Risk planning strategy

Can't find a suitable place

for meeting the team. moderate tolerable

Monitoring the work by E-mail every

day: to avoid this risk.

Damage to the electricity

generator. high serious

There is a spare generator to avoid this

risk.

Marketing the product

system. low catastrophic

Distribution of advertisements, which

minimizes this risk.

12

SOFTWARE REQUIREMENT SPECIFICATION (SRS)

4.1 Introduction

4.1.1 Purpose

The purpose of this document is to describe the Grid Solving Robot Using Shortest path Algorithm. This

document contains the functional and non-functional requirements of the project. This document presents an

initial description of the various functionalities and services provided by the software. The document will

also serve the basis for acceptance testing by the user.

4.1.2 Audience Definitions

4.1.2.1 Audience Definitions

The intended readers of this document are the developers of the site, testers, owners and coordinators. This

document is also intended for any individual who is supervising the project. Any suggested changes on the

requirements listed on this document should be included in the last version of it so it can be a reference to

developing and validating teams.

4.1.3 References

IEEE 830-1998 standard for writing SRS document.

4.1.4 Scope

This project is basically designed to move on any grid made of contrasting colour strips [black strips on

white base or vice versa] .It moves on a zigzag pattern of wheels mounted on the chasis . It would move

accordingly while following a line as well as on junction of the strips when encountered. Our robot traverses

entire Grid in a defined manner until it reaches its destination. If the robot detects any obstacles in its path it

goes back to the source from that location. But if it doesn’t find any obstacle till it reaches the destination

then it travels to the start location via a shortest path from the destination.

This document contains the functional and non-functional requirements of the

project. This document presents an initial description of the various functionalities

and services provided by the software. The document will also serve the basis for

acceptance testing by the user.

13

4.2 Overall Description

4.2.1 Product Perspective

In the Grid solver robot we have used 3 pairs of IR (infra-red) emitter/sensor. The sensor on getting blocked

or unblocked sends combination of high/low signals to AT89C51 microcontroller which are processed and

appropriate signals are sent to L293D (motor driver chip) which switches on/off the motors so as to keep the

robot moving in one direction.

The above block diagram gives a general idea about the interaction between the PC, the WIN AVR Studio

and the Motor Driver Chip (L2938D).

The interaction between the WIN AVR Studio and the PC can be divided in two parts – commands and file

transfer. These commands are for the manual over-ride in the movement of the Robot.

For the file transfer, the WIN AVR Studio interacts with the microcontroller. The WIN AVR Studio

transfers the file to the microcontroller ,i.e, it burns the code from PC to microcontroller. The WIN AVR

Studio communicates its status for file transfer to the microcontroller.

The communication between the WIN AVR Studio and the Motor Driver chip is done bi-directionally via

copper wires. The line following sensors input to the chip the status of line following. If the Robot deviates

from the white line, the motor for the particular wheel is stopped thus, helping the robot to get back on the

line. This input from the line detecting sensors is then communicated to the microcontroller which then

gives the relevant output which is communicated to the Motor Driver Chip. This output is then

communicated to the motor drivers which work according to the output.

14

4.2.2 Product Functionality

The hardware aspect of our project involved building a line following robot. The navigation scheme used by

us will therefore involve using 2 sensors, processing them using the microcontroller, and using the outputs

to drive the motor.

To achieve our stated requirements, we have split the robot into various sections. They are as follows:

1) Sensing unit

2) Motor driver

3) Chassis, wheels and gearbox

4) Power unit

1) Sensing unit

To proceed with building the sensing unit, we had to first decide upon how the path will be specified. We

chose to use a black strip against a white background to serve as the path for the robot. The colour scheme

will be highly instrumental behind our choice of sensors. For our sensors, we initially decided to proceed

with using LDR (Light dependent resistors).We planned to use a high power LED as a light source, and use

an LDR in parallel to the light source to detect the reflected light.

2) Motor driver

The motor driver IC we have used in our robot is the ULN2803 chip which can be used to drive up to 4

unidirectional motors. We are only using I/O 3 and 4 to drive our 2 unidirectional motors. The input to the

motor driver comes from the microcontroller.

3) Power Supply and Chassis

The power supply to the robot was initially via two 12V batteries. We used a voltage regulator circuit to

make sure the comparator and motor driver chips got the required amount of power supply as per their

specifications.

15

4.3 Specification Requirements

4.3.1 Hardware Interface

1. 8 bit Microcontroller ATMEGA 16

2. Power supply (2 batteries of 12V each)

3. Sensor circuit (IR Sensor and Obstacle sensor)

4. Motors (200rpm)

5. Win AVR Studio to write the program in embedded C.

4.3.2 Software Interface

1. Software Used : Win AVR Studio

2. Web Server : Windows XP/2000/Vista

3. Programming

Language : Embedded C

4.3.3 Functional Requirement

This section gives a functional requirement that applicable to the Grid Solver Robot. There are three sub modules in

this phase:

1. Line Following

2. Obstacle Detection

3. Using Shortest Path Algorithm

The functionality for each module is as given below:

1. Line Following : This is the first module of the project. The robot is designed to travel in a straight

line(white line on the plex) from source to destination in a zig-zag manner.

2. Obstacle Detection : This is the second module of the project. The robot is programmed to detect obstacles

coming in its way. The robot is made to traverse in a zig-zag manner from source to destination and

obstacles are kept in its way. The robot is supposed to detect those obstacles.

3. Using Shortest Path Algorithm: This is the final module of the project. Initially the robot is kept on the

starting point of the grid. It is made to traverse in a zig-zag manner until it reaches the destination. In

between if the robot comes across any obstacle, it travels back to the source using the shortest path.

16

Following table shows the priorities of the requirements:

Sr.No Requirement Priority

1 Must be able to map and solve a grid. High

2 Must fit within, and be able to turn within, a single

grid cell

High

3 Must know where in the maze it is at any time. High

4 Must be simple to reprogram for use in other tasks. Medium

5 Must be accurate when moving. High

6 Must be able to run the maze multiple times on one

battery charge.

Medium

7 Must be able to detect obstacles in its path High

8 Must be able to return from source to destination

using shortest path

High

9 Must be able to return from the node where

obstacle is detected to the source using shortest

path

High

4.3.4 Non-Functional Requirement

4.3.4.1 Performance Requirements

Some Performance requirements identified is listed below:

1) The robot should be fast

2) The robot should travel in a straight line

3) The robot should detect the obstacles as soon as it comes across it

4) It should be capable of returning to the source after detection of an obstacle

5) If obstacle is not detected, it should reach the destination and back to the source using shortest path

4.3.4.2 Safety Requirements

The robot may encounter an error

4.3.4.3 Availability The Robot will be available at all time.

17

SYSTEM DESIGN DOCUMENT

5.1. Introduction

5.1.1. Design Overview

5.1.1.1. System Architecture

The architecture chosen is Data Flow Architecture: Batch Sequential. A high level view of the design is

depicted in the below figure.

Component functionalities:

• Embedded C Code: The code will be written in Embedded C and it will use the Breath-First shortest path

algorithm.

•Win AVR Studio :Win AVR Studio is used to write the software code and it is also used to burn the

Embedded C program onto the robot.

• Robot: Once the code is embedded onto the robot, the robot is trained for finding the shortest path and for

better performance.

This document provides a comprehensive architectural overview of the system, using a

number of different architectural views to depict different aspects of the system. It is

intended to capture and convey the significant architectural decisions which have been

made on the system.

18

5.1.1.2. Technologies Used

Operating System : Windows XP

Programming language : Embedded C

Software Used : WIN AVR Studio

5.1.2. Requirements Traceability

User Interface

Design Software Requirement Specification

Design Document

Test Document

User Interface

Functional Requirement

Non-Functional Requirement

Test cases

19

5.2. Diagrams

5.2.1 Use Case

20

5.2.2. Activity Diagram

21

5.2.3 DFD

Level 0

Level 1

22

5.2.4. Sequence Diagram

23

5.2.5 Deployment Diagram

5.2.6 Component Diagram

24

5.2.7 Collaboration Diagram

25

IMPLEMENTATION

6.1. Technologies and Framework

WIN AVR Studio

The AVR is a modified Harvard architecture 8-bit RISC single-chip microcontroller, which was developed

by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for

program storage, as opposed to one-time programmable ROM,EPROM, or EEPROM used by other

microcontrollers at the time. megaAVR chips became popular after they were designed into the 8-

bit Arduino platform. The AVR architecture was conceived by two students at the Norwegian Institute of

Technology (NTH), Alf-Egil Bogen and Vegard Wollan.

The original AVR MCU was developed at a local ASIC house in Trondheim, Norway, called Nordic VLSI

at the time, now Nordic Semiconductor, where Bogen and Wollan were working as students. It was known

as a μRISC (Micro RISC) and was available as silicon IP/building block from Nordic VLSI. When the

technology was sold to Atmel from Nordic VLSI, the internal architecture was further developed by Bogen

and Wollan at Atmel Norway, a subsidiary of Atmel. The designers worked closely with compiler writers

at IAR Systems to ensure that the instruction set provided for more efficient compilation of high-level

languages. Atmel says that the name AVR is not an acronym and does not stand for anything in particular.

The creators of the AVR give no definitive answer as to what the term "AVR" stands for. However, it is

commonly accepted that AVR stands for Alf (Egil Bogen) and Vegard (Wollan)'s RISC processor. Note that

the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel AVR Microcontrollers.

Among the first of the AVR line was the AT90S8515, which in a 40-pin DIP package has the same pinout

as an 8051 microcontroller, including the external multiplexed address and data bus. The polarity of

the RESET line was opposite (8051's having an active-high RESET, while the AVR has an active-

low RESET), but other than that the pinout was identical.

The AVR 8-bit microcontroller architecture was introduced in 1997. By 2003, Atmel had shipped 500

million AVR flash microcontrollers.

ATMEGA 16

The ATmega16U4/ATmega32U4 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced

RISC architecture. By executing powerful instructions in a single clock cycle, the

ATmega16U4/ATmega32U4 achieves throughputs approaching 1 MIPS per MHz allowing the system

designer to optimize power consumption versus processing speed. ATmega16 is an 8-bit high performance

microcontroller of Atmel’s Mega AVR family with low power consumption. Atmega16 is based on

enhanced RISC (Reduced Instruction Set Computing, Know more about RISC and CISC Architecture)

architecture with 131 powerful instructions. Most of the instructions execute in one machine cycle.

Atmega16 can work on a maximum frequency of 16MHz.ATmega16 has 16 KB programmable flash

This document provides information about the technologies and framework used. It

also provides algorithms and pseudo code for various function used in the project.

26

memory, static RAM of 1 KB and EEPROM of 512 Bytes. The endurance cycle of flash memory and

EEPROM is 10,000 and 100,000, respectively.ATmega16 is a 40 pin microcontroller. There are 32 I/O

(input/output) lines which are divided into four 8-bit ports designated as PORTA, PORTB, PORTC and

PORTD.ATmega16 has various in-built peripherals like USART, ADC, Analog

Comparator, SPI, JTAG etc. Each I/O pin has an alternative task related to in-built peripherals. The

following table shows the pin description of ATmega16.

EMBEDDED C

Embedded C is a set of language extensions for the C Programming language by the C Standards

committee to address commonality issues that exist between C extensions for different embedded systems.

Historically, embedded C programming requires nonstandard extensions to the C language in order to

support exotic features such as fixed-point arithmetic, multiple distinct memory banks, and

basic I/O operations. In 2008, the C Standards Committee extended the C language to address these issues

by providing a common standard for all implementations to adhere to. It includes a number of features not

available in normal C, such as, fixed-point arithmetic, named address spaces, and basic I/O hardware

addressing. Embedded C uses most of the syntax and semantics of standard C, e.g., main() function, variable

definition, datatype declaration, conditional statements (if, switch, case), loops (while, for), functions, arrays

and strings, structures and union, bit operations, macros, etc. During infancy years of microprocessor based

systems, programs were developed using assemblers and fused into the EPROMs. There used to be no

mechanism to find what the program was doing. LEDs, switches, etc. were used to check for correct

execution of the program. Some ‘very fortunate’ developers had In-circuit Simulators (ICEs), but they were

too costly and were not quite reliable as well. As time progressed, use of microprocessor-specific assembly-

only as the programming language reduced and embedded systems moved onto C as the embedded

programming language of choice. C is the most widely used programming language for embedded

processors/controllers. Assembly is also used but mainly to implement those portions of the code where

very high timing accuracy, code size efficiency, etc. are prime requirements. As assembly language

programs are specific to a processor, assembly language didn’t offer portability across systems. To

overcome this disadvantage, several high level languages, including C, came up. Some other languages like

PLM, Modula-2, Pascal, etc. also came but couldn’t find wide acceptance. Amongst those, C got wide

acceptance for not only embedded systems, but also for desktop applications. Even though C might have

lost its sheen as mainstream language for general purpose applications, it still is having a strong-hold in

embedded programming. Due to the wide acceptance of C in the embedded systems, various kinds of

support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated development of

embedded systems using C. Assembly language seems to be an obvious choice for programming embedded

devices. However, use of assembly language is restricted to developing efficient codes in terms of size and

speed. Also, assembly codes lead to higher software development costs and code portability is not there.

Developing small codes are not much of a problem, but large programs/projects become increasingly

difficult to manage in assembly language. Finding good assembly programmers has also become difficult

nowadays. Hence high level languages are preferred for embedded systems programming.

27

ALGORITHM:

The algorithm which is used is “BREATH FIRST SEARCH ALGORITHM”[2] because it is one of the best

algorithms for detecting shortest path. The breadth first search will always find the path from the starting

position to the goal as long as there is an actual path that can be found. The algorithm is as follows:

1. Start the robot.

2. Define the starting and the ending cell.

3. Load the grid which the robot has to follow.

4. Add the starting cell to the list.

5. Add neighbouring cells to list.

6. If the list is empty, there is no possible path.

7. If the ending cell is added to the list, define the path which the robot has to follow else find the cost

of the neighbouring cells.

8. Cancel the cells which the robot has traversed.

9. Go to step 5.

SOURCE CODE:

#include <avr/io.h>

#include <multiutil.h>

#include<util/delay.h>

int *c; //Forward counting

int x=1;

int *d; // Right Forward

int y=1;

int *e; // Reverse Forward

int z=1;

int *f; // Final Position

int w=1;

int *g; // Back Right

int v=1;

int *h; // Key block

int u=1;

int *r;

int p=1;

int *k;

int q=1;

int a,b,m,s,i,j,s1,s2,sensor,count=1,call; //variable to store adc value

void right()

{

PORTC=0b00000001;

}

void left()

28

{

PORTC=0b01000000;

}

void very_slow()

{

PORTC=0b01000001;

_delay_ms(21);

PORTC=0b00000000;

_delay_ms(21);

}

void line_right()

{

PORTC=0b00000001;

_delay_ms(50);

PORTC=0b00000000;

_delay_ms(20);

PORTC=0b01000000;

_delay_ms(15);

PORTC=0b00000000;

_delay_ms(7);

}

void line_left()

{

PORTC=0b01000000;

_delay_ms(50);

PORTC=0b00000000;

_delay_ms(20);

PORTC=0b00000001;

_delay_ms(15);

PORTC=0b00000000;

_delay_ms(7);

}

void forward()

{

PORTC=0b01000001;

}

void reverse()

{

29

PORTC=0b10000010;

_delay_ms(50);

PORTC=0b00000000;

_delay_ms(20);

}

void hr_turn()

{

PORTC=0b10000001;

//_delay_ms(15);

//PORTC=0b00000000;

//_delay_ms(1);

}

void hl_turn()

{

PORTC=0b01000010;

//_delay_ms(50);

//PORTC=0b00000000;

//_delay_ms(50);

}

void h_right()

{

int a,b;

init_adc();

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

while((b>650)==1)

{

b=read_adc(7); //read ADC value from channel 1 PORTA1

if(b>650)

{

right();

}

}

}

void h_left()

{

int a,b;

init_adc();

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

while((a>650)==1)

{

a=read_adc(6); //read ADC value from channel 1 PORTA1

if(a>650)

30

{

left();

}

}

}

void hr_right()

{

int a,b;

init_adc();

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

while((b>650)==1)

{

b=read_adc(7); //read ADC value from channel 1 PORTA1

if(b>650)

{

hr_turn();

}

}

}

void hl_left()

{

int a,b;

init_adc();

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

while((a>650)==1)

{

a=read_adc(6); //read ADC value from channel 1 PORTA1

if(a>650)

{

hl_turn();

}

}

}

void h_reverse()

{

PORTC=0b10000010;

}

void stop()

31

{

PORTC=0b00000000;

}

void return_robo()

{

a=read_adc(6); //read ADC value from channel 6 PORTA1

b=read_adc(7); //read ADC value from channel 7 PORTA1

m=read_adc(1); //read ADC value from channel 1 PORTA1

s=read_adc(0); //read ADC value from channel 0 PORTA1

s1=read_adc(4); //read ADC value from channel 4 PORTA1

s2=read_adc(5); //read ADC value from channel 5 PORTA1

while((s<2001)==1)

{

a=read_adc(6); //read ADC value from channel 6 PORTA1

b=read_adc(7); //read ADC value from channel 7 PORTA1

m=read_adc(1); //read ADC value from channel 1 PORTA1

s=read_adc(0); //read ADC value from channel 0 PORTA1

s1=read_adc(4); //read ADC value from channel 4 PORTA1

s2=read_adc(5); //read ADC value from channel 5 PORTA1

while((a<650 && b<650 && (m<350) && *c<=41)==1) //Start Forward Path

{

a=read_adc(6);

b=read_adc(7);

m=read_adc(1);

while((a<650 && b<650)==1)

{

a=read_adc(6);

b=read_adc(7);

m=read_adc(1);

if(*c<=21)

{

forward();

}

if(*c==0)

{

PORTC=0b00000000;

}

/*if(*c==5)

{

for(i=1; i<2; i++)

32

{

right();

}

h_right();

}

if(*c==4)

{

for(i=1; i<2; i++)

{

left();

}

h_left();

}*/

}

*c=*c-1;

}

/*while(*c==2)

{

for(i=1; i<=25; i++)

{

slow();

}

PORTC=0b00000000;

for(i=1; i<=7; i++)

{

PORTB=0b00000010;

_delay_ms(1800);

}

PORTB=0b00000000;

_delay_ms(1000);

PORTC=0b00000000;

*c=51;

}*/

/*while((*c==2)==1)

{

PORTC=0b00000000;

}

*/

/*while((a<650 && b<650)!=1)

{

33

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

m=read_adc(1); //read ADC value from channel 1 PORTA1

// s1=read_adc(4); //read ADC value from channel 1 PORTA1

// s2=read_adc(5); //read ADC value from channel 1 PORTA1

s=read_adc(0);

*/

if(*c==3)

{

PORTC=0b00000000;

}

if((a>650 && b<650))

{

right();

}

else if(a<650 && b>650)

{

left();

}

else if(a>650 && b>650)

{

forward();

}

}

}

void count_robot()

{

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

m=read_adc(1); //read ADC value from channel 1 PORTA1

s=read_adc(0); //read ADC value from channel 1 PORTA1

s1=read_adc(4); //read ADC value from channel 1 PORTA1

s2=read_adc(5); //read ADC value from channel 1 PORTA1

sensor=read_adc(3);

while((s<2001)==1)

{

a=read_adc(6); //read ADC value from channel 1 PORTA1

34

b=read_adc(7); //read ADC value from channel 1 PORTA1

m=read_adc(1); //read ADC value from channel 1 PORTA1

s=read_adc(0); //read ADC value from channel 1 PORTA1

s1=read_adc(4); //read ADC value from channel 1 PORTA1

s2=read_adc(5); //read ADC value from channel 1 PORTA1

sensor=read_adc(3);

while((a<650 && b<650 && m<700 && *c<=41)==1) //Start Forward Path

{

a=read_adc(6);

b=read_adc(7);

m=read_adc(1);

sensor=read_adc(3);

while((a<650 && b<650)==1)

{

a=read_adc(6);

b=read_adc(7);

m=read_adc(1);

sensor=read_adc(3);

s=read_adc(0); //read ADC value from channel 1 PORTA1

if(*c<=41)

{

forward();

}

/*if(*c==9)

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2; i++)

{

right();

}

h_right();

}*/

if(*c==5) //1st Turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2; i++)

{

right();

_delay_ms(100);

35

}

h_right();

}

if(*c==6) // 2nd turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2;i++)

{

right();

_delay_ms(100);

}

h_right();

}

if(*c==11) //3rd turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2; i++)

{

left();

_delay_ms(100);

}

h_left();

}

if(*c==12) //4th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2; i++)

{

left();

_delay_ms(100);

}

h_left();

}

36

if(*c==17) // 5th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2;i++)

{

right();

_delay_ms(100);

}

h_right();

}

if(*c==18) // 5th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2;i++)

{

right();

_delay_ms(100);

}

h_right();

}

if(*c==23) //6th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2; i++)

{

left();

_delay_ms(100);

}

h_left();

}

if(*c==24) //7th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2; i++)

37

{

left();

_delay_ms(100);

}

h_left();

}

if(*c==29) // 8th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2;i++)

{

right();

_delay_ms(100);

}

h_right();

}

if(*c==30) // 9th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2;i++)

{

right();

_delay_ms(100);

}

h_right();

}

if(*c==35) // 9th turn

{

s=read_adc(0); //read ADC value from channel 1 PORTA1

for(i=1; i<2;i++)

{

right();

_delay_ms(100);

}

h_right();

38

}

}

*c=*c+1;

}

while((a<650 && b<650)!=1)

{

a=read_adc(6); //read ADC value from channel 1 PORTA1

b=read_adc(7); //read ADC value from channel 1 PORTA1

m=read_adc(1); //read ADC value from channel 1 PORTA1

// s1=read_adc(4); //read ADC value from channel 1 PORTA1

// s2=read_adc(5); //read ADC value from channel 1 PORTA1

s=read_adc(0);

if(*c==41)

{

PORTC=0b00000000;

}

else if(PINB==0b11111101)

{

hr_turn();

_delay_ms(200);

hr_right();

return_robo();

}

/*if(s<650)

{

for(i=1; i<2;i++)

{

left();

_delay_ms(500);

}

hl_left();

PORTC=0b00000000;

_delay_ms(200);

return_robo();

}*/

39

else if(a>650 && b<650)

{

right();

}

else if(a<650 && b>650)

{

left();

}

else if(a>650 && b>650)

{

forward();

}

}

}

}

main()

{

init_adc();

int a,b,c,p;

DDRC=0b11111111;

DDRB=0b00000000;

PORTB=0b11111111;

a=read_adc(6); //1'st sensor

b=read_adc(7); //3'nd sensor

m=read_adc(1); //5'th sensor

s=read_adc(0);

for(p=1; p<=3; p++)

{

_delay_ms(5000);

}

count_robot();

}

40

SOFTWARE TEST DOCUMENT (STD)

7.1. Introduction

7.1.1. System Overview

This project is basically designed to move on any grid made of contrasting colour strips [black strips on

white base or vice versa] .It moves on a zigzag pattern of wheels mounted on the chasis. It would move

accordingly while following a line as well as on junction of the strips when encountered. This robot

traverses entire Grid in a defined manner until it reaches its destination. Then it travels to the start location

via a shortest path from that location. If the robot finds any obstacle in its path then it moves from that

location to the start location using a shortest path.

7.1.2. Test Approach

The diagram above outlines the Test Process approach that will be followed. a. Organize Project involves creating a Schedule & Test Approach, and

requesting/assigning resources.

b. Design/Build System Test involves identifying Test Cycles, Test Cases, Entrance & Exit Criteria, Expected Results, etc. The Tester will then identify Test Cases and the Data required. The Test conditions are derived from the Requirements Documents

c. Build Test Environment includes requesting/building hardware, software and data set-ups.

d. Execute System Test - Chapter 3 - Test Phases & Cycles

e. Execute Operations Acceptance Test - Chapter 3 - Test Phases & Cycles

f. Signoff – Signoff happens when all pre-defined exit criteria have been achieved.

a.

JHBH

HHH

OHIK

HNIO

ORA

Orga

nize

Proje

ct

b.

NKJNK

NLKNL

NSyste

m Test

c.

environ

ment

d.

NKNJK

Execut

e

Syste

m Test

e.

Execute

Accepta

nce

Test

f.

Signo

ff

and

Pilot

The goal of this document is to develop a test plan for the Information Management system.

This document defines all the procedures and activities required to prepare for testing of the

functionalities of the system. The objectives of the test plan are to define the activities to

perform testing, define the test deliverables documents and to identify the various risks and

contingencies involved in testing.

41

7.2. Test Plan

7.2.1. Features to be tested

All the components which are directly or indirectly related to functional requirement must be tested.

Following is the list of features/components which needs to be tested:

Features / Component Test Case ID

Line Following TC-1.1

Grid Solving TC-1.2

Obstacle Detection TC-1.3

Returning to source using shortest path TC-1.4

7.2.2 Features not to be tested

All the features will be tested; hence nothing is listed under this category.

7.2.3 Testing Tools and Environment

This section describes the overall approach of the testing which ensures that the each feature and the

combination of the features are adequately tested. The major tasks that are used are

Unit testing Unit testing is a method of testing that verifies the individual units of source code are working properly. The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. A Framework called Code igniter, has an inbuilt class for ‘Unit Testing’, hence this tool will be used for unit testing.

Load testing

Load testing is the process of creating demand on a system or device and measuring its response. It

generally refers to the practice of modeling the expected usage of a software program by simulating multiple

users accessing the program concurrently. As such, this testing is most relevant for multi-user systems; often

one built using a client/server model, such as web servers.

42

System Testing Once the entire system has been built then it has to be tested against the Software Requirement Specification and System Specification to check if it delivers the features required. System testing can involve a number of specialist types of test to see if all the functional and non-functional requirements have been met.

Performance Testing

The system should meet the performance requirements. The performance will be evaluated based on the

time the robot requires to scan the grid and to detect obstacle and to return to the source using the shortest

path either from the point where obstacle is found or from the destination, i.e, if obstacle is not found.

Manual Testing

Manual Testing will be done to ensure the correctness of various parts of the code using test cases generated

by the tester.

Pass/fail criteria

The system should satisfy all the functional requirements, in the SRS. Each feature to be tested will be

evaluated against its requirement as stated in the SRS. The pass or fail of a test depends on whether the

system meets with all the particular post conditions. Test cases executed on the Grid Solving Robot will

pass if they meet the specific requirements as mentioned in the SRS.

7.3.Test Case Specification

Sr.No Test Case Expected Result Actual Result Remarks TC001 To verify working of Line

Following.

The robot travels on the

white stripes drawn

over the black surface

in a straight line.

The robot travels in a

straight line.

Pass

TC002 To scan the grid until the

robot finds an obstacle.

The robot scans all the

nodes in the grid until it

finds an obstacle.

The robot detects an

obstacle in its path.

Pass

TC003 To scan the grid till

destination , i.e , robot does

not find an obstacle in its

path .

The robot scans the

entire grid till

destination

The robot scans the

entire grid till

destination.

Pass

TC004 To travel back to the source

using shortest path.

The robot travels back

to the source using

shortest path from the

destination or from the

point where the

obstacle is found.

Robot travels back to

source using shortest

path.

Pass

43

RESULT & DISCUSSION

8.1 Result :

The above figure shows the final robot which will be used to travel in a straight line, to solve the grid, to

detect obstacles and to return to the source using shortest path.

This figure shows the plex on which the robot will traverse. The robot will

follow the white lines on the surface to travel in a straight line in a zig-zag

manner and to scan the nodes till destination and then return back to source

using shortest path algorithm.The line shows the path of travel of the robot

and the two squares represent the obstacles kept for the robot to detect.

Document Provides screenshots and detail about the outcome of the project

44

CONCLUSION AND SCOPE FOR FUTURE WORK

9.1 Conclusion

When the robot is properly calibrated and kept on the given path, it follows the white line which is

drawn on the black surface to reach its destination. Another function of the robot involves obstacle

detection. If the robot finds an obstacle in its path, it returns back to the start position via a shortest path,

else it reaches the destination and then from the destination it travels back to the source via a shortest path.

Ultimately it is a Line following robot having an added functionality of obstacle detection and using a

shortest path to reach the source.

This type of a robot can be used in manufacturing industry where goods are needed to transport along a

predefined path iteratively many times in a day. When a particular task is to be done many times through the

same route or through the same line then we can implement this robot there to perform the task timelessly

and efficiently. Another big advantage with this robot is that it is also has obstacle detection mechanism,

that is at the run time if it encounters any object in front of it then it can just return to the start point using a

shortest path. Another implementation of this robot can be done in the field of defence, space technologies

and the areas which are hit by natural calamities. Also these robots can be sent to places where is not

feasible for humans to reach.

9.2 Scope for Future Work

The robot can be programmed to travel on walls and it can also be made to travel in air to reach on places

faster saving a lot of time and reduce stress on humans.

Provides conclusion drawn by us after working on the project. It also provides future scope of

project.

45

REFERENCES

[1] Ankita Saxena and Abhinav Saxena , “A New Generation Grid Solver Robot System for Object Picking

using Shortest Path” , International Conference on Emerging Trends in Electrical Engineering and Energy

Management (ICETEEEM),2012

[2] Tolga YÜKSEL and Abdullah SEZGİN, “An Implementation Of Path Planning Algorithms For Mobile

Robots On A Grid Based Map”

[3] Rahul Sharma K, “Design And Implementation Of Path Planning Algorithm For Wheeled Mobile Robot

In A Known Dynamic Environment”, IJRET: International Journal of Research in Engineering and

Technology,2013

46

Grid Solving Robot Using Shortest Path

Algorithm

Medha Sejpal

1, Hiten Harbar2

, Kunal Kadam3, Prof.Yogesh Golhar

Department of Information Technology, K.J. Somaiya College of Engineering, University of Mumbai1234

Abstract:

Robots are known to make the life of humans easier by saving their time. Grid Solving Robot is one of the advance areas in the

robotics. This Paper is based on Grid solver Robot using shortest path algorithm that is based on 8 bit Microcontroller ATMEGA 16.

The Robot uses sensors to scan the white line until it detects an obstacle in its way, and if it does, it returns to the starting point using

the shortest path. This robot can be used in places which are inaccessible to the humans like areas affected by natural calamities, on

satellites(if any problem is accounted).

Keywords— Line follower, shortest path, grid Solving.

AUTHOR’S PUBLICATION

47

I INTRODUCTION

Robots have been fascinating from years

now. They are a part of our life in fields such as research, development, medicine, defence or even movies and novels. Robots have simplified our job to a great extent. They have provided efficient, reliable and safe mode of working hands to human beings. Due to robotics, men are now able to perform distinct operations.

Grid Solving Robot is one of the self line detecting machine that follows a pre-defined path. It describes an algorithm for mapping sensor information based on the certainty grid approach. Grid Solving Robot works on the grid Chart which uses White/Black Line following Mechanism. It uses Reflection and absorption phenomenon of light, Obstacle detection, and efficient path planning i.e. shortest path detection.

This Robot Follows the white line which is drawn over the black surface. The sensor are used to sense the line. When the light signal falls on the white surface, it gets reflected and if it falls on the black surface, it is not reflected, this principle is used to scan the lines for the robot. All the above system are controlled by the microcontroller. In Grid solving robot project we are using the popular- AVR (ATMEGA 16 8bit) microcontroller. The AVR microcontroller is used to control the motors. It gets the signals from the sensors and it drives the motors according to the sensor inputs. A mobile robot must be able to notice surrounding objects in order to be able to interact with its environment. Sensors come in a great variety of types and each sensor is able to contribute to the task of environmental perception. However, given multiple sensory inputs, the task of modelling these data into a simple, comprehensible image of the environment can be complicated when problems of temporal accuracy, imprecise and faulty measurements, and sensory deprivation are considered. Grid Solving Robot describes an algorithm for mapping sensor information based on the certainty grid approach. We are implementing a robot which performs several tasks as follows:

Line Following.

Grid traversing.

Object detection.

Using shortest path to return to the source.

Initially the robot is kept on the starting point of the grid. It is made to traverse in a zig-zag manner until it reaches the destination. In between if the robot comes across any obstacle, it travels back to the source using the shortest path.

The aim of this paper is find the shortest path from which the robot will reach its destination after scanning all the nodes of the grid. Also, if the robot detects any obstacle in its path, it will return back to the source form the point where it detects the obstacle using the shortest path. This type of robots can be used for military purposes, manufacturing industry where goods are needed to transport along a predefined path, space technologies and the areas where it is difficult for humans to reach. Besides, it can also be used to do any iterative tasks which can be tirey for humans and thereby saving labour wages and the task is done in more efficient manner also, saving time.

II Grid Description

The grid used as a reference is a 4x4 square grid having 9 squares located centrally of 9” each and 2.5” thick white lines on a black surface. The lines are spaced equally. There are nodes at the intersection of white lines which will be scanned by the robot (Fig.1).

Figure 1. Grid

48

III. PROPOSED TECHNIQUE

The technique used in the project for different

functions is described in the following points:

A. For Line Following

Line following Robot 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. The robot uses an IR sensor to sense the white lines drawn on the black surface. The sensor sends data to the microcontroller and the microcontroller receives the signal and processes it and accordingly gives instructions to the motor driver to drive them. The robot can move in any one of the following stages:

1. The robot moves in a straight line(both motors turned on).

2. The robot moves left(right motor turned

on and left is off).

3. The robot moves right (left motor turned on and right is off).

The robot has 4 wheels and 2 sensor motors .It also has 3 IR Sensors on the bottom of the robot to detect white line and an obstacle[1].

B. GRID SOLVING

Grid coverage for a mobile robot is to make the robot visit all the grid points in a given environment. The entire grid is decomposed into small regions called sections[1]. After decomposition, the robot covers all the grid points in each section using simple motion, which logically forms a zig-zag path as shown in figure 2,where S indicates Start point and D indicates Destination point.

Figure 2

C. CROSS DETECTION

The sensors are turned on when both the sensors sense white surfaces. When such a situation is accounted, it is counted as a cross.

49

D. OBSTACLE DETECTION

For obstacle detection the robot uses TSOP sensor. TSOP Sensor works with infrared technique. It contains TSOP IR transmitter and receiver pair. Along with intensity of frequency on receiver, obstacle detection is performed.

IV.STRUCTURE OF THE ROBOT

The robot consists of the following parts: i. Sensors(IR and TSOP)

ii. Microcontroller iii. Chassis and Body

A. SENSORS

i. IR Sensors: The robot uses 3 IR sensors for the robot to follow a straight line path. These sensors contain a matched pair of transmitter and receiver. These sensors work by measuring the amount of light reflected by the receiver. In case of white lines, the output is high and for the black surface (out of the line), the output is low.

The device works best when it is shielded and when the distance between the sensor and the reflectance surface is small, i.e, less than 5mm.

ii. TSOP Sensor: The TSOP sensor is a Single is a general purpose proximity sensor. It is used for obstacle detection.

iii. Microcontroller: ATMEGA 16 which is an 8bit microcontroller is used in this robot. It is a High Performance, Low Power AVR 8-Bit Microcontroller. By executing powerful instructions in a single clock cycle, the ATMEGA 16 achieves throughputs approaching 1MIPS per MHz allowing the system designer to optimize power consumption versus processing speed. The AVR core combines a rich instruction set with

50

16 general purpose working registers. All the registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle.

iv. Chassis and Body: The robot is designed using an aluminum chassis because it is strong and light in weight. The parts have been soldered together instead of sticking them with glue for better performance.

V.ALGORITHM

The algorithm which is used is “BREATH FIRST SEARCH ALGORITHM”[2] because it is one of the best algorithms for detecting shortest path. The breadth first search will always find the path from the starting position to the goal as long as there is an actual path that can be found. The algorithm is as follows:

10. Start the robot. 11. Define the starting and the ending cell. 12. Load the grid which the robot has to

follow. 13. Add the starting cell to the list. 14. Add neighboring cells to list. 15. If the list is empty, there is no possible

path. 16. If the ending cell is added to the list,

define the path which the robot has to follow else find the cost of the neighboring cells.

17. Cancel the cells which the robot has traversed.

18. Go to step 5.

VI. RESULT AND ANALYSIS

This section consists of the experimental results and analysis of the proposed system using a real robot.

A. Robot as a Line Follower

The robot follows the white line over a

black surface. For this purpose, we use the 3 IR Sensors, which can help to detect the white path.

B. Robot as a Grid Traverser

The robot traverses the entire path in a

sequence defined in algorithm. It travels in a zig-zag path as shown in Figure 2.The robot starts from the S point and takes a right turn after the third square then goes straight and takes a left turn from the third square.Again the robot goes straight and takes a right turn travelling straight to reach the destination point.Thus it scans all the points one by one and stores the result.We have programmed the robot for the obstacles kept in 3 places as shown in figure 3(Yellow box indicates obstacle).The robot takes the shortest path available from these obstacles to reach back to the source.Suppose if the robot does not find any obstacle in its way,it directly takes a shortest path from source to destination as shown in Figure 3 by a red line directly from source to destination.

Figure 3

C. Robot as an Object Detector

For detecting the object, we used one

TSOP Sensor in front of the robot which can detect the presence of an object to the next

51

upcoming node. If the object is present there, then it proceeds to next step i.e. it returns to the source using the shortest path from that point. And if object is not present then it simply traverses the grid and returns back to start point through the shortest path.

VII.CONCLUSION

When the robot is properly calibrated and kept on the given path, it follows the white line which is drawn on the black surface to reach its destination. Another function of the robot involves obstacle detection. If the robot finds an obstacle in its path ,it returns back to the start position via a shortest path, else it reaches the destination and then from the destination it travels back to the source via a shortest path. Ultimately it is a Line following robot having an added functionality of obstacle detection and using a shortest path to reach the source. This type of a robot can be used in manufacturing industry where goods are needed to transport along a predefined path iteratively many times in a day. When a particular task is to be done many times through the same route or through the same line then we can implement this robot there to perform the task timelessly and efficiently. Another big advantage with this robot is that it is also has obstacle detection

mechanism, that is at the run time if it encounters any object in front of it then it can just return to the start point using a shortest path. Another implementation of this robot can be done in the field of defence, space technologies and the areas which are hit by natural calamities. Also these robots can be sent to places where is not feasible for humans to reach.

VIII ACKNOWLEDGEMENT

The authors would like to acknowledge the

immense guidance and support provided by the

Department of Information Technology,

K.J.Somaiya College of Engineering during all

stages of the completion of this paper. They

would also like to extend their gratitude to Prof.

Yogesh Golhar for his valuable suggestions and

mentoring during all the phases of the

development of this paper.

XI REFERENCES

[1] Ankita Saxena and Abhinav Saxena , “A New Generation Grid Solver Robot System for Object Picking using Shortest Path” , International Conference on Emerging Trends in Electrical Engineering and Energy Management (ICETEEEM),2012

[2] Tolga YÜKSEL and Abdullah SEZGİN, “An Implementation Of Path Planning Algorithms For Mobile Robots On A Grid Based Map”

[3] Rahul Sharma K, “Design And Implementation Of Path Planning Algorithm For Wheeled Mobile Robot In A Known Dynamic Environment”, IJRET: International Journal of Research in Engineering and Technology,2013.

52

ACKNOWLEDGEMENT

We would like to take this opportunity to express our gratitude to the people who have been

instrumental in the successful completion of our project “Grid Solving Robot Using Shortest Path

Algorithm”. We would like to show our greatest appreciation to our project guide Prof. Yogesh

Golhar and co-guide Prof. Sagar Korde for his support, invaluable advice at every stage of our

project. We have learnt so many things from him and he motivated us and strengthened our

confidence in doing this. Throughout the project work his useful suggestion, constant

encouragement has given us a right direction and shape to our learning. He kept guiding us and

providing beneficial inputs to our which helped us all the way in building our project. We thank him

for his support and patience.

We would also thank all the faculty members who have been a constant source and

encouragement during the entire course of our study in this college.

Also we owe this accomplishment to the blessings of our parents and well- wishers. Without

their encouragement and moral support this work would not have been possible.

Name Roll No. Signature

Medha sejpal 1114053

Hiten Harbar 1014034

Kunal Kadam 1014043