A PROJECT REPORT ON 2010 DESIGN OF OBSTACLE DETECTION & COLLISION AVOIDANCE ROBOT Under the esteemed guidance of : Mr. S. K.

Das (Scientist , CMERI –Durgapur) Mr. P rajit Paul (Lecturer ,Asansol Engineering College) Submitted By: SupriyaAEIE(108 05062003) Aatreyee SarkarAEIE(10805062010) Dipu KumariAEIE(10805062011) Mukund B ihariECE(10803061046) Asansol Engineering College Vivekanand Sarani , Kanyapur Asansol - 713305

mukundbihari.blogspot.com 2010 CENTRAL MECHANICAL ENGINEERING RESEARCH INSTITUTE MAHATMA GANDHI AVENUE DURGAPUR -713209, West Bengal Certificate This is to certify that the Final Year Project Report submitted by Supriya(AEIE) ,Aatreyee Sarkar(AEIE) ,Dipu Kumari (AEIE) and Mukund Bihari(ECE) is a record of the work carried out on project “Design of Obstacle detection and Collision Avoid ance Robot” by them under our guidance. The work has been completed at the Robotic s and Auomation Laboratory, CMERI, Durgapur. Dr S. N. Shome Scientist Group Head & DU Head Shri S. K. Das Scientist Robotics and Automation Laboratory DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 2

mukundbihari.blogspot.com 2010 ACKNOWLEDGEMENT An academic project marks the beginning of the transition from amateur to a prof essional. It is the forum where theory is put into perspective.We is thankful to the Director, CMERI for his kind permission to carry out our summer training at CMERI (a CSIR establishment), and Durgapur. We will also like to thank Dr.S.N.Shome, Scientist G and Group head who offered us the opportunity to carry out our training at Robotics and Automation Lab unde r the supervision of Shri S.K.Das Scientist-C. We acknowledge our indebtedness t o Shri S.K.Das for providing his esteemed guidance and substantial guidance to o ur Final Year Project. Mr. A. Basu Adhikari (JRF) of CMERI and Mr. Biplap CMERI, Durgapur, Mr. Jyotirmaya Karmkar and Mr. Sonatan Dutta need a distinct mention here, because without there perpetual efforts to systematize our work it wouldn‟t have been possible to complete the project on time. We are also greatly indebted to our college for making provisions for the arrangement of our summer training at such a reputed organization of CMERI. Finally I endeavor indispensable roles which have been played by many individuals. My gratitude to those entire indivi duals in single words of “THANKS”, sincerely hoping it will convey the depth of the feeling. Supriya Aatreyee Sarkar Dipu Kumari Mukund Bihari DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 3

mukundbihari.blogspot.com 2010

Contents 1. 2. 3. 4. Summary Overview Flowchart Components used Microcontroller AT89C52 Vo rator Motor driver Variable resistance IR sensors Crystal oscillator Voltage reg ulator Other components DC motor Robotic wheel Vehicle Base 11 23 25 28 29 32 34 35 38 39 39 6 7 9 5. Circuit Implementation oltage Regulator 41 44 47 50 6. Microcontroller programing C program 52 4 Voltage comparator AT89C52 circuit Motor Driver circuit V

DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT

Possible Improvements References and Resources e Electronic shops 78 78 78 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 5 Books and Links Tools of the trad ALL100 Screen shots of program loading 61 62 . 10.blogspot. Loading program in microcontroller 8.com 2010 Screen shots of keil programing 57 7. Problems faced during designing of robot Faulty microcontroller board Problem of motor driver circuit Voltage drop of 2V Excessive heating of LM7805 74 75 75 76 77 9.mukundbihari.

Starting with an overview of the system the document would cover imple mentation details like components used . The „Reference and Resources‟ page has a list of relevant book s.This design can be used in fully automated vehicles like cars etc . problems faced during designing of the obstacle detection and collision avoidance robot . websites. Prerequisites: Knowledge of electronics devices and circuits and microcontroller . Some suggestions on improving the design and its commercial application have also been discussed in the later part of the document. moving m aterials in industries fom one to another place and similar other commercial app lication. Knowledge of Keilμvision 3. Knowledge of ALL 100 pr ogram burner. electronic shops and commonly used parts & their prices.blogspot. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 6 .circuits and algorithms. Knowledge of circuit design.com 2010 SUMMARY The main objective of this project is to design a obstacle detection and collisi on avoidance robot with help IR sensors embedded around the body of robotic vehi cle. It ha s also been described that how the microcontroller program has been embedded in the microcontroller with help of a burner device.mukundbihari.

com 2010 OVERVIEW The robot uses four IR sensors to sense any obstacle in between its path.After the comparision of senso r data nad the Vref the volatge comparator gives output as 0V for presence of an y obstacle and DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 7 .blogspot.mukundbihari.The dat a coming out from those sensors are fed into voltage comparators where the senso r data is compared with a fixed reference voltage.

DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 8 .com 2010 5 V for absence of obstacle.The microcontroller pr ocesses the output of comparator circuit according to the program stored in it a nd gives output at another port . The output of microcontroller is fed into the motor driver circuit which ampifie s the low output current coming from microcontroller so that its output becomes capable to drive the DC motors fitted in the robotic vehicle base.This output of comparator circuit is fed into the mi crocontroller in which decision making program is stored .blogspot.mukundbihari.

mukundbihari.com 2010 FLOWCHART DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 9 .blogspot.

0592) Voltage Regulator(L M7805) Other Components IC Base Vero Board Wire Connectors DC Motor Robotic Whee l Vehicle Base DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 10 .com 2010 COMPONENTS USED Microcontroller(AT89C52) Voltage Comparator(LM311P) Motor Drive Resistance IR Sensor(GP2D12) Crystal Oscillator(ML 11.mukundbihari.blogspot.

high-performance CMOS 8-bit microcomputer with 8 Kby tes of Flash programmable and erasable read only memory (PEROM). the Atmel AT89C52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.blogspot. The device is m anufactured using Atmel‟s high density nonvolatile memory technology and is compat ible with the industry standard 80C51 and 80C52 instruction set and pinout. AT89C51 24PI DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 11 .com 2010 MICROCONTROLLER (AT89C52 24PI) The AT89C52 is a low-power.mukundbihari. The on-chip Flash allows the program memory to be reprogrammed insystem or by a conv entional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip.

DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 12 . T he Idle Mode stops the CPU while allowing the RAM. a six-vector two-level in terrupt architecture. the AT89C52 is designed with static logic for operation d own to zero frequency and supports two software selectable power saving modes.bit timer/counters.blogspot. on-chip oscillator. serial port. 256 byt es of RAM. three 16. a full duplex serial port. The Power down Mode saves the RAM contents but freezes the oscillator. In addition.mukundbihari. disabling all other chip functions until th e next hardware reset.com 2010 The AT89C52 provides the following standard features: 8 Kbytes of Flash. and clock c ircuitry. timer/counters. and interrupt system to continue functioning. 32 I/O lines.

mukundbihari.blogspot. P0 has internal pullups. Port 1 pins that are externally DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 13 . In this mode. GND Ground. As input s. When 1s are written to Port 1 pins. Port 0 can also be configured to be the multiple xed low-order address/data bus during accesses to external program and data memo ry. As an output port. Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pullups. Port 0 also receives the code bytes d uring Flash programming and outputs the code bytes during program verification. When 1s are written to port 0 pins. Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. they are pulled high by the internal pullups and can be used as inputs. The Port 1 outp ut buffers can sink/source four TTL inputs. each pi n can sink eight TTL inputs. the pins can be used as high-impedance inputs.com 2010 Pin Configuration Pin Description VCC Supply voltage. External pullups are required during program verification.

1 can be configured to be the timer/counter 2 external coun t input (P1. Port 1 also receives the low-order address bytes during Flash programming and pr ogram verification. During accesses to external data memory tha t uses 8-bit addresses (MOVX @ RI). When 1s are written to Port 2 pins. P1. Port 2 pins that are externally being pulled low will source current (IIL) be cause of the internal pullups. Port 2 emits the high-order address byte during f etches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR).0/T2) and the timer/counter 2 trigger input (P1. The Port 2 outp ut buffers can sink/source four TTL inputs.com 2010 being pulled low will source current (IIL) because of the internal pullups.1/T2EX). In a ddition.0 and P1. Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pullups. they are pulled high by the internal pullups and can be used as inputs. respectivel y. Port 2 emits the contents of the P2 Special Function Register.mukundbihari.blogspot. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 14 . As input s. as shown in the following table. Port 2 uses stron g internal pullups when emitting 1s. In this application.

RST DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 15 . they are pulled high by the internal pullups and can be used as inputs. As input s. as shown in the following table.com 2010 Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port 3 pins that are externally being pulled low will source current (IIL) be cause of the pullups. Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pullups. Port 3 also serves the functions of various special featur es of the AT89C51.mukundbihari. The Port 3 outp ut buffers can sink/source four TTL inputs.blogspot. Port 3 also receives some control signals for Flash programming And programming verification. When 1s are written to Port 3 pins.

blogspot. In normal operation. that one ALE pulse is skipped during each access t o external data memory. A high on this pin for two machine cycles while the oscillator is r unning resets the device. Note. With the bit set.com 2010 Reset input. EA/VPP External Access Enable. This pin also receives the 12-volt DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 16 . except that two PSEN activations are skipped during each access to external data memory. PSEN Program Store Enable is the read strobe to external program memory.mukundbihari. If desired. When the AT8 9C52 is executing code from external program memory. ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or cloc king purposes. the pin is weakly pulled high. however.This pin is also the program pulse input (PR OG) during Flash programming. Otherwise. PSEN is activated twice eac h machine cycle. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FF FFH. Setting the ALE-disabl e bit has no effect if the microcrontroller is in external execution mode. that if lock bit 1 is programmed. Note. however. ALE is active only during a MOVX or MO VC instruction. EA should be strapped to VCC for internal program executions. ALE operation can be disabled by setting bit 0 of SFR location 8EH. ALE/PROG Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory. EA will be internally latc hed on reset.

blogspot. XTAL2 Output from the inverting oscillator amplifier.com 2010 programming enable voltage (VPP) during Flash programming when 12volt programmin g is selected. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock oper ating circuit. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 17 .mukundbihari.

mukundbihari.blogspot.com 2010 BLOCK DIAGRAM OF AT89C52 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 18 .

These interrupts are all shown in Figure below. Use r software should not write 1s to these bit positions. IE also contains a global disable bit. In fact. 1. three timer interrupts (Timers 0. since they may be used in future AT89 products.blogspot. In the AT89C51. Each of these interrupt s ources can be individually enabled or disabled by setting or clearing a bit in S pecial Function Register IE.com 2010 Block Diagram of Microcontroller(AT89C52) Interrupts The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1). bit position IE.mukundbihari. and the serial port inte rrupt. Neither of these flags is cleared by hardware wh en the service routine is vectored to. Note that Table below shows that bit position IE. EA. which di sables all interrupts at once. and 2). and that bit will have to be cleared in software. the service routine may have to determine Whether it was TF2 or EXF2 that generated the interrupt. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON.5 is also unimplemented. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 19 . 6 is unimplemented.

mukundbihari.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 20 .blogspot.

since the input to the internal clocking circuitry is through a divide-by-two flip-flop. as shown in Figure be low.mukundbihari. Either a quartz crystal or ceramic resonator may be used. respectively. of an inverting amplifie r that can be configured for use as an on-chip oscillator. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 21 . To drive the devi ce from an external clock source. as shown in Figure below.com 2010 Oscillator Characteristics XTAL1 and XTAL2 are the input and output. There are no requirements on the duty cycle of the external clock signal. but minimum and maximum voltage high and low time specifications must be observed. XTAL2 should be left unconnected while XTAL1 i s driven.blogspot.

com 2010 Crystal Oscillator ML 11.blogspot.mukundbihari.0592 crystal Oscillator DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 22 .

com 2010 Maximum rating of AT89C51 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 23 .mukundbihari.blogspot.

mukundbihari. and the outputs can be wire-OR connected. the output i s in the off state. These comparators are capable of d riving lamps or relays and switching voltages up to 50 V at 50 mA. including 15-V supplies fo r operational amplifiers and 5-V supplies for logic systems. LM 311 voltage comparator DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 24 .blogspot. The outputs can drive loads refere nced to ground. These devices are designed to operate from a wide range of power-supply voltages. All inputs an d outputs can be isolated from system ground. regardless of the differential input. If the strobe is low. VCC+ or VCC–.com 2010 VOLTAGE COMPARATOR (LM311P) The LM311 are single high-speed voltage comparators. The output levels a re compatible with most TTL and MOS circuits. Offset balancing and strobe capabilities are availab le.

com 2010 Pin Configuration of LM311 Functional Block Diagram DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 25 .mukundbihari.blogspot.

com 2010 MOTOR DRIVER (L293D) The Device is a monolithic integrated high voltage. allowing opera tion at a lower voltage and internal clamp diodes are included. To simplify use as two bridges each pair of channels is equipped with an enable input.mukundbihari. A separate supply input is provided for the logic. L293D Motor Driver IC DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 26 . DC and stepping motors) and switching power trans istors. high current four channel dr iver designed to accept standard DTL or TTL logic levels and drive inductive loa ds (such as relays solenoides.blogspot.

DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 27 .com 2010 BLOCK DIAGRAM L293D Motor Driver The L293D is a quadruple half H-bridge bidirectional motor driver IC that can dr ive current of up to 600mA with voltage range of 4.mukundbihari. It is suitable to drive small DC-Geared motors. bipolar stepper motor etc.blogspot.5 to 36 volts.

2-A Per Driver Thermal Shutdown Internal ESD Protection Hi gh-Noise-Immunity Inputs Applications DC and stepper motor drives Position and velocity servomechanisms PIN CONFIGURATION DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 28 .com 2010 Specifications Supply Voltage Range 4. Pulsed Current 1.mukundbihari.blogspot.5V to 36V 600-mA Output current capability per driver Sep arate Input-logic supply It can drive small DC-geared motors. bipolar stepper mo tor.

and their physical size.mukundbihari. They are specified by their maximum resistance. The track may be made from carbon. The track is usually rotary but straight track versions. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 29 . The standard spindle diame ter is 6mm.com 2010 Pin configuration of L293D VARIABLE RESISTANCE Variable resistors consist of a resistance track with connections at both ends a nd a wiper which moves along the track as you turn the spindle.blogspot. cermet (ceramic and metal mixture) or a coil of wire (for low resistances). are also available. linear or logarithmic track. usually called sliders. Variable resistors are often called potentio meters in books and catalogues.

mukundbihari. The GP2D12 provides a nonlinear voltage output in relation to the distance an objectis from the sensor an d interfaces easily using any analog to digital converter.blogspot.com 2010 Variable resisitance IR SENSORS (GP2D12) General Description The Sharp GP2D12 is an analog distance sensor that uses infr ared to detect an object between 10 cmand 80 cm away. Features • High immunit y to ambient light and color of object • No external control circuitry required DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 30 .

com 2010 GP2D12 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 31 .blogspot.mukundbihari.

The CCD array can then determine wh at angle the reflected light came back at and therefore. The receiv er portion of these new detectors is actually a precision lens that transmits th e reflected light onto various portions of the enclosed linear CCD array based o n the angle of the triangle described above. Sensing distance of GP2D12 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 32 . it can calculate the di stance to the object.com 2010 The angles in this triangle vary based on the distance to the object.mukundbihari.blogspot.

blogspot.mukundbihari.com 2010 Characteristics of GP2D12 sensors DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 33 .

as shown in Figure be low.mukundbihari. since the input to the internal clocking circuitry is through a divide-by-two flip-flop.0592) XTAL1 and XTAL2 are the input and output. There are no requirements on the duty cycle of the external clock signal.com 2010 CRYSTAL OSCILLATOR (ML 11. respectively. of an inverting amplifie r that can be configured for use as an on-chip oscillator.blogspot. Either a quartz crystal or ceramic resonator may be used. To drive the devi ce from an external clock source. Crystal oscillator DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 34 . as shown in Figure below. but minimum and maximum voltage high and low time specifications must be observed. XTAL2 should be left unconnected while XTAL1 i s driven.

crystal is between two pins of the CPU. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 35 .mukundbihari.com 2010 Why two 33pF capacitors are used with crystal oscillator in 89C52 microcontrolle r? Usually. The caps shift the phase. and two caps of 33 pF are mo unted from these pins to the ground.blogspot. The purpose is to "dephase" the crystal sig nal to provide a lead/lag to the buffers inside the CPU and allows the oscillati on! (The oscillator is a feedback loop around a buffer: you need input/output OU T OF PHASE to maintain oscillation. while the Xtal mai ntains the frequency).

5A output current. Typical applications would incl ude local (on-card) regulators which can eliminate the noise and degraded perfor mance associated with singlepoint regulation.blogspot.com 2010 VOLTAGE REGULATOR (LM7805) The LM78M05. thermal shutdown.5A • No external components • Internal thermal overloa d protection • Output voltages of 5V DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 36 . and safe-operating area protection which makes them virtually immune to damage from output overloads.mukundbihari. With adequate heatsinking. Features • Output current in excess of 0. a three-terminal positive voltage regulator employ built-in current limiting. th ey can deliver in excess of 0.

mukundbihari.blogspot.2 kΩ 330 kΩ CAPACITORS 10 µF 330 µF 0.com 2010 OTHER COMPONENTS RESISTORS 10 kΩ 8.Only lets current flow in one direction. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 37 . It's a generic diode.1 µF 33 pF DIODES 1N4007 The 1N4007 Diode is in a series of 1 Amp diodes the Peak reverse voltage is 50V.

mukundbihari.com 2010 IC BASE 40 pin 40 pin 16pin DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 38 16 pin .blogspot.

blogspot.1 inch (2. It is usually known by the name Veroboard. in the UK. which is a trademark. WIRE CONNECTORS These connectors are used to connect wires through the vero board through which input . of British company Vero Technologies Ltd. Different conec tors used are: 8 pin 4 pin 2 pin DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 39 . with wide parallel strips of copper cladding running in one direction all the way across one side o f the board.54 mm) regular (rectangular) grid of holes.mukundbihari.com 2010 VERO BOARD Stripboard is a widely-used type of electronics prototyping board characterized by a 0. who invented this kind of boa rd. power supply or outputs are taken out through the board.

Any obstacle in betwe en the path of robot will be detected by IR sensors incorporated around the body of vehicle.blogspot. These motors have high speed which c an be reduced with the help of gears and traded off for torque.com 2010 DC MOTOR (12V -50mA) These are very commonly used in robotics. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 40 . DC motors can rotate in both direction s depending upon the polarity of current through the motor. These motors have fr ee running torque and current ideally zero.mukundbihari. Bidirectional motor is used so that our robo tic vehicle can move in both forward and backward directions easily in case if a ny obstacle is in between the path of the robotic vehicle. Here a single ph ase bidirectional DC motor is used.

9V battery holder. Rear support wheel.blogspot. It has folowing provisions in it: Slot for DC motors.mukundbihari. Slot to clamp sensors. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 41 .com 2010 ROBOTIC WHEEL Two types of wheel have been used: Main wheel(Front) Support wheel(Rear) VEHICLE BASE It is made up of light weight material alumunium which provides easy movement of the robotic vehicle.

com 2010 CIRCUIT IMPLEMENTATION AT89C52 circuit Voltage comparator Motor Driver circuit Voltage Regulator DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 42 .blogspot.mukundbihari.

The Vref is adjustable and it is kept in the range of 0. 5V.greater will be the sensing dis tance of sensors.mukundbihari. left . Lower the value of reference voltage is set .4V to 2.blogspot. right and rear sensor with reference voltage coming from variable resistance (potentiometer).com 2010 VOTLAGE COMPARATOR CIRCUIT LM311P LM311P is a voltage comparator circuit which compares the output of front . DESIGN Vref α OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT Sensing dist nce of sensor 43   .

Pin no. 8 of the comp r tor .7 nd 8 re shorted through 330 kΩ resisto r.e.com 2010 Vref is fed into pin no. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 44                 .blogspot. 2 nd the sensor input is fed into pin 3 of the LM311P IC.Pin no. if senor output is high then we get 0V output from the LM311P circuit. 5 and 6 do not ha ve any connection. 1 nd 4 si shorted nd connected with ground.Pin no. Vcc (5V) is connected w ith pin no.But here we have used resistor of value of about 400kΩ.mukundbih ri. The comparator circuit is of inverting nature i.

mukundbihari.blogspot.com 2010 VOLTAGE COMPARATOR BLOCK DIAGRAM DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 45 .

mukundbihari.blogspot.com 2010 MICROCONTROLLER CIRCUIT AT89C52 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 46 .

blogspot.mukundbihari.com 2010 The output of voltage comparator circuit is fed as input in the microcontroller at port 1. BLOCK DIAGRAM OF MICROCONTROLLER DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 47 .The output of microconroller is taken out at port 2 and fed into motor driver L293D.

blogspot.mukundbihari.com 2010 AT 89C52 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 48 .

A resistor of 8.0 Pin 2.blogspot.3 } } MOTOTR 1 MOTOTR 2 Eight 10kΩ pull-up resistors are connected to the microcontroller at port P0.18 and pin 19.A 10µf capacitor is connected between pin9 and Vcc . port2 and port3.1 – Left sensor Pin 1. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 49 Pin 2.1 Pi .Rest of the ports have inbuilt pull-up resistors.3 – Rear sensor Following pins are taken as output from the microcontroller : n 2.0 – Front sensor P in 1.These capa citors stablize the output of crsytal. so there is no need to connect pull -up resistors to the port1 .Output of pin 10 and pin 11 is connected t o the MAX232 Ic meant for serial communication.Power supply to the microcontroll er is giventhrough a voltage regulator circuit which takes 12V as input and 5 V as output.2 – Right sensor Pin 1.2kΩ is connected between pin 9 and the pin18of the microcontroller.2 Pin 2.mukundbihari.com 2010 Following pins are taken as input in the microcontroller: Pin 1. Crystal is connected to pin no.Two ceramic capaci tors of 33pF are connected between both pin of crsytal and the ground.

It can give output curr ent upto 600mA.9 The main function of driver is to amplify the 15mA current.8 5V at pin no. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 50 .blogspot. 12V at pin no. 1 . coming from the micr ocontroller which is incpable to drive 50mA rating motor.com 2010 MOTOR DRIVER L293D L293D motor driver needs two voltage levels : and 16.mukundbihari.

com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 51 .blogspot.mukundbihari.

blogspot.The two pair of transistors gives us the bidirect ional rotation of motor. In a H-bridge circuit ther are four transistors of which only two are in ON stat e which are located diagonally.com 2010 The driver circuit basically consists two H-bridges for driving small DC motors.mukundbihari. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 52 .

mukundbihari.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 53 .blogspot.

e.com 2010 VOLTAGE REGULATOR Voltage Regulator is needed as because we have different voltage level requireme nt in different components.mukundbihari.So. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 54 .Our motor requires 12v supply but circiuts like m icrocontroller board and voltage comparator requires only 5 V suply. Also motor driver IC L293D reqiures 5V and 12V simultaneously. we have incorporated two voltage regulator circiuts on our board.blogspot.g.

com 2010 CURCUIT DIAGRAM OF VOLTAGE REGULATOR DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 55 .mukundbihari.blogspot.

=P2^1.It converts C program into He x format .1 as output for left motor// 56 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT .com 2010 MICROCONTROLLER PROGRAMMING Microcontroller program has been done usinng the software µvision 3 keil.h> sbit irinf = P1^0. Binary format nad asm format. //sets port1. sbit outlp sbit outln =P2^0.0 as i/p for fron t sensor// //sets port1. sbit irinl = P1^1.0 as output for left motor// //sets port2. sbit irinr = P1^2.blogspot. C PROGRAM #include<reg52.1 as i/p for left sensor// //sets port1. sbit irinb = P1^3.mukundbihari.3 as i/p for rear sensor// //sets port2.This soft ware provides Keil C51 Compiler to compile program.2 as i/p for rig ht sensor// //sets port1.

= 0. while(1) { //sets port1 as i/p// if(irinf==1&&((irinr==1&&irinl==1) (irinr==1&&irinl==0) (irinr==0&&irinl ==1) (irinr==0&&irinl==0) (irinb==1 irinb==0))) //both motor On and vehicle moves i n forward direction// { outlp outln outrp outrn = 1.mukundbihari.com 2010 sbit outrp sbit outrn =P2^2. void main () { P1=1. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 57 . = 1. = 0.2 as output for right motor// / /sets port2. //sets port2.blogspot. MSdelay(250). =P2^3.3 as output for right motor// void MSdelay(unsigned char).

outln =0. MSdelay(250).mukundbihari. right and front// DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 58 . outrp =0. outrn =0. outln =0. outrn =1. outrp =0. } else if(irinf ==0&&(irinl==1&& irinr==0)) //right motor On and vehicle takes turn in left direction avoiding ob stacle in right { outlp =0. MSdelay(250). } else i f(irinf ==0&&irinl==0&&irinr==0&&irinb==1) //both motor On in reverse directiona nd vehicle moves back direction avoiding obstacle in left .com 2010 } else if(irinf==0&&((irinr==1&&irinl==1) (irinr==0&&irinl==0))) //left motor O n and vehicle takes turn in right direction avoiding obstacle in left// { outlp =1.blogspot.

} else if(irinf ==0&&irinl ==0&&irinr==0&&irinb==0) //both motor OFF and vehicle stops// { outlp =0. MSdelay(250). MSdelay(250).com 2010 { outlp =0. outln =1. } } } void MSdelay(unsigned char itime) DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 59 . outrn =0. outrp =1. outrp =0.blogspot. outrn =0. outln =0.mukundbihari.

blogspot. for(i=0. } DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 60 .i<itime.j.j++).com 2010 { unsigned int i.mukundbihari.j<1275.i++) for(j=0.

blogspot.com 2010 SCREEN SHOTS OF KEIL PROGRAMING DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 61 .mukundbihari.

blogspot.mukundbihari.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 62 .

com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 63 .blogspot.mukundbihari.

mukundbihari.blogspot.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 64 .

com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 65 .mukundbihari.blogspot.

DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 66 .mukundbihari. It has in-built Hex to Binary.blogspot.com 2010 LOADING PROGRAM IN AT89C52 ALL100 Binary format of C program is loaded into the microcontroller with ALL 100 Burne r connected to computer through a USB port.It can programm ICs upto 48 pin. Binar y to Hex Coverter.

mukundbihari.blogspot.com 2010 SCREEN SHOTS OF LOADING PROGRAM STEP 1: Conversion of hex code to bin code DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 67 .

mukundbihari.com 2010 STEP 2: Choosing manufacturers’ n me DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 68   .blogspot.

blogspot.mukundbih ri.com 2010 STEP 3: Selection of IC type nd its n me DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 69       .

mukundbih ri.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 70   .blogspot.

mukundbih ri.blogspot.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 71   .

mukundbih ri.com 2010 STEP 5: Checking of IC DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 72   .blogspot.

blogspot.com 2010 STEP 6: Bl nk checking DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 73     .mukundbih ri.

blogspot.mukundbih ri.com 2010 STEP 7: Lo ding progr m from buffer DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 74       .

com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 75   .blogspot.mukundbih ri.

blogspot.com 2010 STEP 8: Choosing file form t to be lo ded DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 76       .mukundbih ri.

mukundbih ri.com 2010 STEP 9: Progr rming the IC DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 77     .blogspot.

mukundbih ri.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 78   .blogspot.

mukundbih ri.com 2010 DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 79   .blogspot.

STEP 10: Remove the IC from the ALL 100 burner.com 2010 STEP 10: Checking wether progr m is stored in IC or not.mukundbih ri.blogspot. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 80     .

We h d not defined Synt x P1 = 1.mukundbih ri.Our microcontroller bo rd w s not giving output s it seemed th t no progr m stored in microcontroller lthough we h d burnt th e progr m.blogspot.com 2010 PROBLEMS FACED DURING DESIGNING THE ROBOT FAULTY MICROCONTROLLER BOARD This w s our first m jor problem. After lengthy m nuovere when we f iled to debug the circuit we design ed nother fresh microcontroller bo rd longwith the seri l communic tion IC MAX 232 on the s me bo rd. Which de fines port1 s input? DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 81                                                         . L ter on we found th t Ther w s logic l error in our Progr m.

mukundbih ri.blogspot.com 2010 MOTOR DRIVER CIRCUIT Inti lly we h d decided to use ULN2003 s motor driver circuit s it is d rlin gton p ir connection which lso mplifies current.But we were un ble to drive th e motor with the help of this IC. Then we decided to use the H-bridge circuit l ongwith Optcoupler IC MCT2E but here we h d g in problem due to the complexity of H-bridge circuit.Then we decided to use L293D which s it h s itsef built-in two Hbridge circuits.This time we were succesful to drive both of our motors. Fig: H-bridge circuit longwith MCT2E optocoupler VOLTRAGE DROP OF 2V This w s the gre test problem ever we f ced in our project.We f ced lots of diff iculty to debug the problem of 2V vot ge drop when the ll the circuits DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 82

 

   

     

 

 

 

     

   

 

 

 

 

 

 

 

   

 

EXCESSIVE HEATING OF LM7805 We observed th t when power supply w s given continuosly for more th n 6 to 7 mi ns. LM7805 got he ted upto undesir bel level enough to burn hum n skin.To overco me this excessive he t we incorpor ted lumunium he t sink with both the LM7805 ICs. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 83

 

mukundbih ri.blogspot.com 2010 were interconnected with e ch other.We checked our whole circuit twice nd thric e but we were un ble to find the error.Fin lly fter long m noeuvre the f ult w s detected in the com pr tor circuit.There w s short circuit in the com pr tor circuit between the fist sensor input m le connector pin nd first comp r tor o utput m le connector pin.

         

 

 

 

 

 

 

   

 

 

 

 

 

   

 

   

 

 

 

 

 

 

mukundbih ri.blogspot.com 2010 Possible Improvements Use of differenti l steering with gr du l ch nge in wheel speeds. Use of Hystere sis in sensor circuit using LM339 Increment in number of sensors to enh nce the obst cle detection c pibilty Incorpor tion of c mer whose d t c n be sending through wirless tehnology to fixed st tion. Incorpor tion of robotic h nd to remove the obst cle in c se there is no w y for the movement of the robot. Gener l improvements like using low dropout volt ge regul tor, lighter ch ssis etc. DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 84

 

 

 

     

 

 

 

   

 

 

         

 

 

 

 

 

 

 

 

 

mukundbih ri.blogspot.com 2010 REFERENCE AND RESOURCES The 8051 Microcontroller nd Embedded Systems Using Assembly nd C Second Editio n Muh mm d Ali M zidi J nice Gillispie M zidi Rolin D. McKinl y http://www.letsm kerobots.com http://www. cron merobotics.com http://www.ti.com http://www.st.co m TOOLS µVision keil 3 ALL 100 IC progr m burner Drill m chine for drilling holes in vero bo rd File to djust the motors in ch ssis Reli nce Electronics , As nsol

DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 85

 

 

   

SHOPS Gemini r dio , Ch ndni Chowk , Kolk t

 

 

 

 

 

 

 

   

 

 

 

 

 

 

   

 

 

mukundbih ri.com 2010 THE END DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 86   .blogspot.

Sign up to vote on this title
UsefulNot useful