Вы находитесь на странице: 1из 48

ROVER 2010

PREFACE
The main objective of this project is to design an obstacle
detection and collision avoidance robot with help of IR sensors
embedded around the body of robotic vehicle. This design can be
used in fully automated vehicles like cars, moving materials in
industries and similar other commercial applications. Starting with
an overview of the system the document would cover
implementation details like components used, circuits and
algorithms, problems faced during designing of the obstacle
detection and collision avoidance robot. It has also been
described that how the microcontroller program has been
embedded in the microcontroller with the help of a burner device.
Some suggestions on improving the design and its commercial
application have also been discussed in the later part of the
document.
The Reference and Resources page has a list of relevant books,
websites, electronic shops and commonly used parts & their
prices.

1
ROVER 2010

ABSTRACT
The robot uses three IR sensors to sense any obstacle in its path.
The data coming from those sensors are fed into voltage
comparators where the sensor data is compared with a fixed
reference voltage. After the comparison of sensor data and the
Vref, the voltage comparator gives output as OV for presence of
any obstacle and 5 V for absence of obstacle. This output of
comparator circuit is fed into the microcontroller in which decision
making program is stored .The microcontroller process uses the
output of comparator circuit according to the program stored in it
and gives output at another port. The output of microcontroller is
fed into the motor driver circuit which amplifies the low output
current coming from microcontroller so that its output becomes
capable to drive the DC motors fitted in the robotic vehicle base.

2
ROVER 2010

Block diagram of Rover

3
ROVER 2010

Circuit diagram of Rover

The output of voltage comparator circuit is fed as input in the


microcontroller at port 0.The output of microcontroller is taken at
port 1 and port 2 and fed into motor driver L293D. Following pins
are taken as input in the microcontroller:

• Pin 0 .0 - Left sensor

4
ROVER 2010
• Pin 0 .1 - Front sensor

• Pin 0.2 - Right sensor

Following pins are taken as output from the microcontroller

For motor 1
• Pin1.0 .
• Pin 1.1

For motor 2
• Pin2.0
• Pin 2.1
Eight 10k pull up resistors are connected to the microcontroller
at port P0. Rest of the ports have inbuilt pullup resistors, so there
is no need to connect pull-up resistors to port1 , port2 and port3.

COMPONENTS USED

• IR Transmitter and Reciever

• Microcontroller (AT89S52)

• Motor Driver(L293D)

• Timer (LM555)

• DC Motor

• Voltage Regulator(LM7805)

• Variable Resistance

IR Transmitter

5
ROVER 2010
The IR Transmitter block is used to generate IR signal. It uses
timer IC555 in astable multivibrator mode to generate square
wave which have continuous pulses of 50% duty cycle of
frequency 38 KHz.

6
ROVER 2010

Circuit diagram IR transmitter

IR receiver Tsop (1738)

Description

7
ROVER 2010
IR sensor (TSOP 1738) which gives normally 5v at its
output but. after receiving infrared light , output of sensor is 0v.

The TSOP17.. — series are miniaturized receivers for infrared


remote control systems.
The demodulated output signal can directly be decoded by a
microprocessor.

Features

8
ROVER 2010
• Improved shielding against electrical field disturbance

• Output active low • Low power consumption


• High immunity against light
• Continuous data transmission possible (up to 2400 bps)
• Suitable burst length 10 cycles/burst

Circuit diagram IR receiver

9
ROVER 2010

IR sensor Module

MICROCONTROLLER
(AT89S52)
The AT89S52 is a low-power, high-performance CMOS 8-bit
microcomputer with 8 Kbytes of Flash programmable and

10
ROVER 2010
erasable read only memory (PEROM). The device is manufactured
using Atmels high density nonvolatile memory technology and is
compatible with the industry standard 80C51 instruction set and
pin out.
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
Flash on a monolithic chip the Atmel AT89S52 is a powerful
microcomputer which provides a highly flexible and cost effective
solution to many embedded control applications.

AT89S52

Pin Configurations:

11
ROVER 2010

Pin Description
Vcc
Supply voltage
GND
Ground

Port 0

• Port 0 is an 8-bit bidirectional IO 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 inputs.
• Port 0 can also be configured to be the multiplexed low-order
address data bits during accesses to external program and
data memory.

12
ROVER 2010

• Port 0 also receives the code bytes during Flash


programming and outputs the code bytes during program
verification. External pull-ups are required during program
verification.

Port 1

Port 1 can be used as input or output, In contrast to port 0, this port does
not need any pull-up resistors since it already has pull-up resistors internally. Upon
reset, port 1 is configured as an input port. To make port 1 an input port, it
must be programmed as such by writing 1to all its bits

Port 2

• Port 2 is an 8-bit bidirectional I/O port with internal pull-ups.


• The Port 2 output buffers can sink/source for TTL inputs. When 1s are
written to Port 2 pins, they are pulled high by the internal pull-ups and can
be used as inputs.
• 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 address.
• Port 2 also receives the high-order address bits and some
control signals during Flash programming and verification.

Port 3

• Port 3 is an 8-bit bidirectional I/O port with internal pull-ups.


• The Port 3 output buffers can sink/source for TTL inputs.
When 1s are written to Port 3 pins, they are pulled high by
the internal pull-ups and can be used as inputs.
• Port 3 also receives some control signals for Flash
programming and programming verification.

13
ROVER 2010
RST

Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device.

ALE/PROG
Address Latch Enable is an output pulse for latching the low byte
of the address during access 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.

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

XTAL2
Output from the inverting oscillator amplifier

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

14
ROVER 2010

15
ROVER 2010

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

The L293D can drive current of up to 600mA with voltage range of


4.5 to 36 volts. It is suitable to drive small DC-Geared motors,
bipolar stepper motor etc.

Specifications
. Supply Voltage Range 4.5V to 36V
. 600-mA Output current capability per driver
. Separate input- logic supply

16
ROVER 2010

Thermal Shutdown

High-Noise-immunity inputs

PIN CONFIGURATION

Pinout of L293D

Circuit implementation
L293D
L293D motor driver needs two voltage levels
• 12V at pin no.8
• 5V at pin no. 1 ,9 and 16.
The main function of driver is to amplify the 15mA current,

17
ROVER 2010
coming from the microcontroller which is incapable to drive 50mA
rating motor it can give output current upto 600mA.

L293d as Driver Circuit

The driver circuit basically consists two H-bridges for diving small
DC motors. In a H-bridge circuit there are four transistors of which
only two are in ON state which are located diagonally. The two
pairs of transistors gives the bidirectional rotation of motor.

18
ROVER 2010
OTHERS

TIMER
(LM555)

General Description

The LM555 is a highly stable device for generating accurate time


delays or oscillation. Additional terminals are provided for
triggering or resetting if desired. In the time delay mode of
operation, the time is precisely controlled by one external resistor
and capacitor. For astable operation as an oscillator, the free
running frequency and duty cycle are accurately controlled with
two external resistors and one capacitor.

LM555

19
ROVER 2010
ASTABLE OPERATION

If the circuit is connected as shown in Figure (pins 2 and 6


connected) it will trigger itself and run as a multivibrator. The
external capacitor charges through RA + RB and discharges
through other resistor. Thus the duty cycle may be precisely set
by the ratio of these two resistors.

In this mode of operation, the capacitor charges and dis charges


between 1/3 V and 2/3 V.

DC MOTOR (12v -50mA)

DC Motors are very commonly used in robotics. DC motors can


rotate in both directions depending upon the polarity of current
through the motor. These motors have high speed which can be
reduced with the help of gears and traded off for torque.

20
ROVER 2010

Dc Motor(45rpm)

Here a bidirectional DC motor is used so that the motors can


move in both forward and backward directions ,dodging any
obstacle that comes in its path.

VOLTAGE REGULATOR

(LM7805)
The LM78M05, a three-terminal positive voltage regulator
employs built-in current limiting, thermal shutdown, and
protection mechanism which makes them virtually immune to
damage from output overloads. With adequate heat sinking, they
can deliver in excess of O.5A output current.

Features

• Output current in excess of 0.5A


• No external components
• Internal thermal overload protection
• Output voltages of 5V

21
ROVER 2010

CIRCUIT IMPLEMENTATION
voltage Regulator is needed as because we have different voltage
level requirement in different components e.g motor requires 12v
supply but circuits like microcontroller board and voltage
comparator require only 5 V supply.

LM7805

22
ROVER 2010

VARIABLE RESISTANCE

Variable resistors consist of a resistance track with connections at


both ends and a wiper which moves along the track as you turn
the spindle. The track may be made from carbon, ceramic and
metal mixture or a coil of wire (for low resistances). The track is
usually rotary but straight track versions, usually called sliders,
are also available. Variable resistors are often called
potentiometers in books and catalogs. They are specified by their
maximum resistance, linear or logarithmic track, and their
physical size. The standard spindle diameter is 6mm.

Mechanical design
It is made up of light weight material , steel which provides easy
movement of the robotic vehicle. It has folowing provisions in it:
• Slot for DC motors.

• Rear support wheel.


• Slot to clamp sensors.
• 12V battery holder.

23
ROVER 2010

ALGORITHM

While (1)

Read sensor input

if left_obstacle

Stop

Move back

Move right

elseif right_obstacle

Stop

Move back

Move left

elseif front_obstacle

Stop

Move back

24
ROVER 2010
Move left

elseif left && front obstacle

Stop

Move back

Move right

elseif right && front obstacle

Stop

Move back

Move left

elseif left && right obstacle

Stop

Move back

Move left

elseif left && front && right obstacle

{
25
ROVER 2010
Stop

Move back

Move left

else

Move forward

26
ROVER 2010
SCREEN SHOTS OF KEIL PROGRAMING

Program written for the microcontroller chip is compiled using


the well known compiler keil uvision 4 which provides extensive
library for various microcontrollers and then converts the program
into hex file which is used to burn the flash of the microcontroller.
It also provides various utilities for debugging and simulation.

27
ROVER 2010

28
ROVER 2010

29
ROVER 2010

SCREEN SHOTS OF LOADING PROGRAM

30
ROVER 2010

31
ROVER 2010

32
ROVER 2010

33
ROVER 2010

34
ROVER 2010

35
ROVER 2010

36
ROVER 2010

PROBLEMS FACED

FAULTY MlCROCONTROLLER BOARD

37
ROVER 2010
The first microcontroller we used had its write enable
failed. Perhaps it was damaged during transportation.
Then we used other microcontroller but after burning the
microcontroller using the first code it seemed that no
program was written at all in the flash memory. Later on
we found that the microcontroller had some inherent
problem and we had to replace it.

Keil programming

The microcontroller board was not giving output as it seemed that


no program was stored in microcontroller although we had burnt
the program. After detailed analysis of the program we found that
we had not defined certain pins and then we made necessary
modifications in our program. Moreover we had to burn the flash
memory several times because the initial program did not take
into account several scenarios which became evident only after
test run. Finally after several iterations through the program we
finally created a robust code.

MOTOR DRIVER CIRCUIT

Initially we decided to use ULN2003 as motor driver circuit as it is


a darling on pair connection which also amplifies current but we
were unable to drive the motor with the help of this IC. Then we
decided to use L293D which as it has itself built-in two H bridge
circuits. This time we were successful to drive both the motors.

EXCESSIVE HEATING OF LM7805

we observed that when power supply was given continuously for


more than 6 to 7 mins. LM7805 got heated upto undesirable level
enough to burn human skin. To overcome this excessive heat we
incorporated almnini heat sink with both the LM7805 ICs.

FUTURE SCOPE

38
ROVER 2010
Some of the improvements that can be made are the following:

• The rover can be made to follow a specific pattern with slight


change in the program. Such improvement could be used in
industries where robots have to only traverse a specific path.

• The rover can be instructed dynamically over the wireless to


follow a particular path depending upon the information sent
to the base station. Such systems can be used as intelligent
transport systems without the need of a driver.

• The rover can also be used as vaccum cleaner with slight


change in hardware and programming.

• The rover can also be used as lawn mover after making


necessary changes.

• It can also be used as firefighting robot after incorporation of


thermal sensors and fire fighting mechanism and change in
code.

• It can also be used as mine detector after addition of mine


detecting module and necessary change in programming.

• Increment in number of sensors to enhance the obstacle


detection capability

• It can also be used as a spy robot.

DATA SHEETS

39
ROVER 2010

40
ROVER 2010

41
ROVER 2010

42
ROVER 2010

43
ROVER 2010

44
ROVER 2010

45
ROVER 2010

46
ROVER 2010

47
ROVER 2010
REFERENCE AND RESOURCES

• The 8051 Microcontroller and Embedded Systems Using


Assembly and C Second Edition byMuhammad Ali Mazidi

• Basic electronics by Millman Halkyies

• understanding electronic components by fillopovic d miomir

• Wikipedia/microcontroller

• www.engineeringprojects.org

• http://indianengineer.blog.co.in

• www.8051projects.com

• Basic Tutorial for Keil software Written by


www.microdigitalEd.com

48

Вам также может понравиться