You are on page 1of 19

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) P.SRAVYA SAI SRI (08PA1A0446) G. NINNY (08PA1A0413) 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

VIT

VISHNU INSTITUE OF TECHNOLOGY (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 Mr. P. Sivanantha Maitrey Head of the Department Prof. K. Srinivas

VIT

CONTENTS: 1. ABSTRACT. 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..

VIT

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 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

VIT

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

LEFT MOTOR

SESENSOR

AT89S52

L293D

RIGHT MOTOR

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

VIT

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)

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 costeffective 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

VIT

Fig: 2 PIN DESCRIPTION: 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 P1.0 P1.1 P1.5 P1.6 P1.7 Alternate Function T2 (external clock input to timer/counter2) T2EX (Timer/Counter2 capture/reload direction control) MOSI(used in In-System Programming) MISO (used in In-System Programming) SCK (used in In-System Programming)

trigger

and

PIN9 RST: Reset input A 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: VIT

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:1 PORT PIN P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7

Alternate Functions RXD (serial input port) TXD (serial output port) INT0 (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input) T1 (timer 1 external input) WR (external data memory write strobe) RD (external data memory read strobe)

PIN18 XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. Oscillator Characteristics XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can 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

VIT

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 Enable PSEN 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 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 ALEdisable bit has no effect if the microcontroller is in external execution mode.

PIN31 EA/Vpp: External Access Enable When /EA is low, i.e., grounded, the device fetches code from external program memory

VIT

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.

VIT

10

Fig: 4

Specifications: Table: 2 Symbol Vs Vss Vi Ven Io Ptot TstgTj

Parameter Supply voltage Logic supply voltage Input voltage Enable voltage Peak o/p current Total power dissipation at TPINs=90 C Storage and junction temperature

Value 36V 36V 7V 7V 1.2A 4W -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

VIT

11

run forwards and backwards. The H-Bridge structure is shown in below figure

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: 3 S1 1 0 0 0 1

S2 0 1 0 1 0

S3 0 1 0 0 1

S4 1 0 0 1 0

Result Motor moves right Motor moves left Motor runs free Motor brakes 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 VIT

12

that is positive relative to a common ground. Each type employs internal current limiting, 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

VIT

13

5. SOFTWARE USED

VIT

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:

VIT

15

Fig: 8

5.3. UNIVERSAL KIT:

VIT

16

6. FLOW CHART: START

READ P1.0

FORWARD

no
Ob?

yes LEFT

no
Ob?

RIGHT

yes RIGHT

LEFT

no

Ob?

yes LEFT

STOP

VIT

17

7. ALGORITHM 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. CONCLUSION This 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

VIT

18

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

VIT

19

You might also like