obstacle detection and avoidance robot (2)

22
1 OBSTACLE DETECTION AND AVOIDANCE ROBOT A Mini Project Report submitted in partial fulfillment of the requirement for the award of the degree of BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING BY M. DIVYA SUSHMA (08PA1A0433) G. NINNY (08PA1A0413) P.SRAVYA SAI SRI (08PA1A0446) K.CHAITANYA VARMA (08PA1A0415) Under the Guidance of Mr. P. SIVANANATHA MAITREY (Sr. Assistant Professor) ECE Department VIT

Upload: sasankakatreddi

Post on 03-Mar-2015

2.383 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Obstacle Detection and Avoidance Robot (2)

1

OBSTACLE DETECTION AND AVOIDANCE ROBOT

A Mini Project Report submitted

in partial fulfillment of the requirement for the award of the degree of

BACHELOR OF TECHNOLOGY

IN

ELECTRONICS AND COMMUNICATION ENGINEERING

BY

M. DIVYA SUSHMA (08PA1A0433) G. NINNY (08PA1A0413)

P.SRAVYA SAI SRI (08PA1A0446) K.CHAITANYA VARMA (08PA1A0415)

Under the Guidance of

Mr. P. SIVANANATHA MAITREY

(Sr. Assistant Professor)

ECE Department

Department of Electronics and Communication Engineering

VISHNU INSTITUTE OF TECHNOLOGY

(Approved by AICTE, Accredited by NBA, Affiliated to JNTU Kakinada)

Vishnupur, Bhimavaram – 534 202.

2011 – 2012

VISHNU INSTITUE OF TECHNOLOGY

Page 2: Obstacle Detection and Avoidance Robot (2)

2

(Approved by AICTE,Accredited by NBA,Affiliated to JNTU Kakinada)

Vishnupur, Bhimavaram-534 202.

ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify that the Mini Project entitled “OBSTACLE DETECTION AND

AVOIDANCE ROBOT” is being submitted by M.Divya Sushma, P. SravyaSai Sri, G. Ninny,

K.Chaitanya Varma bearing the Regd.No.08PA1A0433, 08PA1A04446, 08PA1A0413,

08PA1A0415 partial fulfillment for the award of the degree of “Bachelor of Technology in

Electronics and Communication Engineering” is a record of confide work carried out by

them under my guidance and supervision during academic year 2011-2012 and it has been

found worthy of acceptance according to the requirements of the university.

.

Internal Guide Head of the DepartmentMr. P. Sivanantha Maitrey Prof. K. Srinivas

CONTENTS:

1. ABSTRACT………………………………………………………….

Page 3: Obstacle Detection and Avoidance Robot (2)

3

2. INTRODUCTION…………………………………………………...

3. BLOCK DIAGRAM…………………………………………………

3.1. SENSOR …………………………………………..

3.2. AT89S52……………………………………………

3.3. L293D………………………………………………

3.4. MOTOR…………………………………………….

3.5. LM7805…………………………………………….

4. CIRCUIT DIAGRAM………………………………………….……

5. SOFTWARE USED…………………………………………….……

5.1. KEIL SOFTWARE………………………………....

5.2. LAB TOOLS………………………………………..

5.3. UNIVERSAL KIT………………………………….

6. FLOW CHART……………………………………………………….

7. ALGORITHM………………………………………………………...

8. APPLICATIONS……………………………………………………...

9. FUTURE SCOPE……………………………………………………...

10. CONCLUSION………………………………………………………..

11. REFERENCES………………………………………………………..

1. ABSTRACT

Obstacle detection and avoidance robot is an autonomous robot which works on the principle of detecting obstacles in its path and avoiding them without any collision. To achieve this ultrasonic sensor is used to detect the obstacles.  Ultrasonic sensors generate high frequency

Page 4: Obstacle Detection and Avoidance Robot (2)

4

sound waves and evaluate the echo which is received back by the sensor. Sensors calculate the time interval between sending the signal and receiving the echo to determine the distance to an object. So if an obstacle is detected in its path, the robot turns either left or right from the path and continues to move in new path.

The term autonomous refers the movement of robot without continuous human guidance. For this the microcontroller should be programmed. The robot consists of 8-bit microcontroller which communicates with the sensor and takes decision according to the information sent by the sensor. The microcontroller part is to read the input from the sensor unit and controls the movement of the robot. Obstacle avoidance algorithms help the robot to navigate intelligently on their own

D.C motors are used to give motion to the ROBOT. The robot consists of two dc motors to rotate four wheels which are driven by a driver IC. The wheels are rotated as per the input given to motors. This decision is taken by the controller as per the algorithm.

2. INTRODUCTION

Robotics is a branch of technology that deals with the design, construction, operation, structural disposition, manufacture and application of robots. Robotics is related to the sciences of electronics, engineering, mechanics and software.

In robotics, obstacle avoidance is the task of satisfying some control objective subject to non-intersection or non-collision position constraints. Obstacle avoidance is one of most important research area and also the foundation of building robot's successful behaviors. ROBOTS are now widely used in many industries due to the high level of performance and reliability. All mobile robots feature some kind of obstacle avoidance. Designing autonomous robot requires the integration of many sensors and actuators according to their task. Obstacle detection is primary requirement for any autonomous robot. The robot acquires information from its surrounding through sensors mounted on the robot. Various types of sensors can be used for obstacle avoiding. Methods of obstacle avoiding are distinct according to the use of sensor. Some robots use single sensing device to detect the object. But some other robots use multiple sensing devices.

The common used sensing devices for obstacle avoiding are bump sensor, infrared sensor, ultrasonic sensor, laser range finder; charge-coupled device (CCD) camera web cam and so on can be used as the detection device. Among them ultrasonic sensor is most suitable for this obstacle avoiding robot because of its low cost and ranging capability.

3. BLOCK DIAGRAM

Page 5: Obstacle Detection and Avoidance Robot (2)

5

SE

Fig: 1

BLOCK DIAGRAM DESCRIPTION:

3.1. SENSOR: Ultrasonic sensor is used for detecting obstacle.Ultrasonic distance sensor provides precise, non-contact distance measurements from

about 2 cm (0.8 inches) to 3 meters (3.3 yards). Sensor works by transmitting an ultrasonic (well above human hearing range) burst and providing an output pulse that corresponds to the time required for the burst echo to return to the sensor. By measuring the echo pulse width the distance to target can easily be calculated.

Features• Supply Voltage – 5 V DC• Supply Current – 30 mA type; 35 mA max• Range – 2 cm to 3 m (0.8 in to 3.3 yards)• Input Trigger – positive TTL pulse, 2 μs min, 5 μs typ.• Echo Pulse – positive TTL pulse, 115 μs to 18.5 ms• Echo Hold-off – 750 μs from fall of Trigger pulse• Burst Frequency – 40 kHz for 200 μs• Burst Indicator LED shows sensor activity• Delay before next measurement – 200 μs• Size – 22 mm H x 46 mm W x 16 mm D (0.84 in x 1.8 in x 0.6 in)

AT89S52

SENSOR L293D

LEFT MOTOR

RIGHT MOTOR

Page 6: Obstacle Detection and Avoidance Robot (2)

6

3.2. AT89S52:

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.

FEATURES: 8-bit CPU 8K bytes of flash 256 bytes of RAM 32 I/O lines Watchdog timer Two data pointers Three 16bit timer/counters Full duplex serial port On-chip oscillator Clock circuitry

Fig: 2

PIN DESCRIPTION:

Page 7: Obstacle Detection and Avoidance Robot (2)

7

PIN (1-8) PORT1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 PINs, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 PINs that are externally being pulled low will source current (IIL) because of the internal pull-ups. Alternate functions of port1 PINs are:

Port PIN Alternate FunctionP1.0 T2 (external clock input to timer/counter2)P1.1 T2EX (Timer/Counter2 capture/reload trigger and direction

control)P1.5 MOSI(used in In-System Programming)P1.6 MISO (used in In-System Programming)P1.7 SCK (used in In-System Programming)

PIN9 RST: Reset inputA high on this PIN for two machine cycles while the oscillator is running resets the device. This PIN drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

PIN (10-17) PORT3:Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52

Table:1PORT PIN Alternate FunctionsP3.0 RXD (serial input port)P3.1 TXD (serial output port)P3.2 INT0 (external interrupt 0)P3.3 INT1 (external interrupt 1)P3.4 T0 (timer 0 external input)P3.5 T1 (timer 1 external input)P3.6 WR (external data memory write strobe)P3.7 RD (external data memory read strobe)

PIN18 XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can

Page 8: Obstacle Detection and Avoidance Robot (2)

8

be configured for use as an on-chip oscillator, as shown in Figure 11. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven, as shown in Figure 12. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maxi- mum voltage high and low time specifications must be observed. Note: C1, C2 = 30 pF -(+) 10 pF for Crystals

= 40 pF –(+) 10 pF for Ceramic Resonators Crystal connections

Fig: 3

PIN19 XTAL2: Output from the inverting oscillator amplifier.PIN20 GND: ground

PIN (21-28) PORT2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups.Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

PIN29 /PSEN: Program Store EnablePSEN is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, /PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

PIN30 ALE/PROG: Address Latch Enable

Page 9: Obstacle Detection and Avoidance Robot (2)

9

ALE is an output pulse for latching the low byte of the address during accesses to external memory. This PIN is also the program pulse input (/PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the PIN is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

PIN31 EA/Vpp: External Access EnableWhen /EA is low, i.e., grounded, the device fetches code from external program memory locations starting from 0000H to FFFFH. When /EA is high, i.e., strapped to Vcc, then internal program executions are done.

PIN (32-39) PORT0: Port 0 is an 8-bit open drain bidirectional I/O port.As an output port, each PIN can sink eight TTL inputs. When 1s are written to port 0 PINs, the PINs can be used as high-impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification.PIN40 Vcc: Supply voltage.

3.3. L293D L293D is used as driver IC.

L293d is an IC used for driving different types of motors. The PIN diagram is shown in below figure. It contains four non-inverting drivers placed as two pairs. Each pair may individually be enabled or disabled through ENABLE input. Each driver is capable of sourcing or sinking 600mA of current with a peak value of 1.2A. Vs (PIN 8) is for motor power supply voltage input, with a minimum limit of 5V and a maximum of 36V. Vss (PIN 16) is a logic level input voltage with a minimum rating of 5V.

To drive a motor, only a pair of drivers is necessary which may be connected with poles of the motor directly. Signals marked as input may be driven by port PINs of any microcontroller.

The Device is a monolithic integrated high voltage, high current four channel driver designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays solenoids, DC and stepping motors) and switching power transistors.

Page 10: Obstacle Detection and Avoidance Robot (2)

10

Fig: 4

Specifications:

Table: 2Symbol Parameter ValueVs Supply voltage 36VVss Logic supply voltage 36VVi Input voltage 7VVen Enable voltage 7VIo Peak o/p current 1.2APtot Total power dissipation at TPINs=90 C 4WTstgTj Storage and junction temperature -40 to 150 C

3.4. MOTOR

Two DC motors: right motor and left motor are used to move the robotic base. These motors are interfaced with micro-controller by driver IC L293d which consists of an H-Bridge circuitry. An H bridge is an electronic circuit that enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards. The H-Bridge structure is shown in below figure

Page 11: Obstacle Detection and Avoidance Robot (2)

11

Fig: 5

An H bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4 (according to the figure) are closed (and S2 and S3 are open) a positive voltage will be applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the motor.The H-bridge arrangement is generally used to reverse the polarity of the motor, but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit. The following table summarizes operation, with S1-S4 corresponding to the diagram above.

Table: 3S1 S2 S3 S4 Result1 0 0 1 Motor moves right0 1 1 0 Motor moves left0 0 0 0 Motor runs free0 1 0 1 Motor brakes1 0 1 0 Motor brakes

3.5. LM7805: It is a self-contained fixed linear voltage regulator IC.The 78xx family is commonly used in electronic circuits requiring a regulated power

supply due to their ease-of-use and low cost. For ICs within the family, the xx is replaced with two digits, indicating the output voltage (for example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 78xx lines are positive voltage regulators: they produce a voltage that is positive relative to a common ground. Each type employs internal current limiting,

Page 12: Obstacle Detection and Avoidance Robot (2)

12

thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.

Features• Output Current up to 1A• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V• Thermal Overload Protection• Short Circuit Protection• Output Transistor Safe Operating Area Protection

Fig: 6

4. CIRCUIT DIAGRAM

Page 13: Obstacle Detection and Avoidance Robot (2)

13

5. SOFTWARE USED

Page 14: Obstacle Detection and Avoidance Robot (2)

14

5.1. KEIL µVision:

Keil compiler is software used where the machine language code is written and compiled. After compilation, the machine source code is converted into hex code which is to be dumped into the microcontroller for further processing. Keil compiler also supports C language code.

Fig: 7

5.2. LAB TOOLS:

Page 15: Obstacle Detection and Avoidance Robot (2)

15

Fig: 8

5.3. UNIVERSAL KIT:

6. FLOW CHART:START

Page 16: Obstacle Detection and Avoidance Robot (2)

16

no

yes

no

yes

no

yes

7. ALGORITHM

FORWARD

LEFT

RIGHT

LEFT

LEFT

RIGHT

Ob?

Ob?

Ob?

STOP

READ P1.0

Page 17: Obstacle Detection and Avoidance Robot (2)

17

Step1: Start

Step2: Initialize the input port as P1.0 and output ports as P0.0, P0.1, P0.2, P0.3

Step3: Read data from P1.0 and check for the bit.

Step4: If it is low move forward else go to next step

Step5: Move the robot either to left or right direction and go to step3

Step6: Stop

8. APPLICATIONS Obstacle avoider is a key feature in any kind of robot, household appliance, or toy that

needs to move around autonomously Edge detection, a very popular method that extracts the obstacle vertical edges and drives

the robot around either one of the visible edges. Used in the development of  autonomous soccer robot Mobile robot navigation

9. FUTURE SCOPE By adding a comparator circuit to microcontroller we can make this robot as line

follower robot. A wheel chair, for a physically handicapped and blind person, which is moved by sensing

and avoiding obstacles Adding a Camera:

If the current project is interfaced with a camera (e.g. a Webcam) robot can be driven beyond line-of-sight & range becomes practically unlimited as networks have a very large range.

Use as a fire fighting robot : By adding temperature sensor, water tank and making some changes in programming we can use this robot as firefighting robot.

10. CONCLUSIONThis project describes how an autonomous robot detects an obstacle and changes its path

avoiding collision of that obstacle. The construction of the robot circuit is easy and the design is portable

11. REFERENCES

1. The 8051 Micro controller and Embedded systems (Pearson Education) By-M.A.Mazidi2. http://www.alldatasheet.com/3. http://en.wikipedia.org/

Page 18: Obstacle Detection and Avoidance Robot (2)

18