Vous êtes sur la page 1sur 74

A Project Report

On

“SEARCH AND RESCUE ROBOT FOR THE VICTIMS


OF EARTHQUAKE”
Submitted in partial fulfilment of the requirements for the award of the
degree of
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING

BY

A.S. AARTHI (097F1A0401)


GUVVALA SRIKANTH (097F1A0427)
S. SWATHI (097F1A0430)

Under the guidance of

Mr. S. BALAKRISHNA
Asst. Professor
Department of ECE

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCES

Approved by AICTE, New Delhi & Affiliated to JNTU, Hyderabad.


Nadergul (V), Saroor Nagar (M), Ranga Reddy (Dist) A. P. – 501510
Date:
__________________

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify that Project entitled “S


SEARCH AND RESCUE ROBOT FOR
THE VICTIMS OF EARTHQUAKE” is a bonafide work carried out by A.S.
AARTHI (097F1A0401), GUVVALA SRIKANTH (097F1A0427), S.SWATHI
(097F1A0430) in partial fulfillment for the award of Bachelor of Technology in
Department of ECE, “VISHWA BHARATHI INSTITUTE OF TECHNOLOGY
AND SCIENCES”, Hyderabad during the year 2009-2013 under my supervision and
guidance. The result embodied in this Project Work has not been submitted to any
other University or Institute for the award of any Degree

INTERNAL GUIDE HEAD OF THE DEPARTMENT

Mr. S. BALAKRISHNA(Asst. Professor) Mr.C.ASHOK VISHNU

PRINCIPAL EXTERNAL EXAMINER

i
DECLARATION

We the undersigned, declare that the project title entitled “S


SEARCH AND RESCUE
ROBOT FOR THE VICTIMS OF EARTHQUAKE” carried out at “WINEYARD
TECHNOLOGIES” is original and is being submitted to the Department of ECE
“VISHWA BHARATHI INSTITUTE OF TECHNOLOGY AND SCIENCES”,
Hyderabad towards partial fulfillment for the award of Bachelor of Technology.

We, declare that, the result embodied in the Project work has not been submitted to
any other University or Institute for the award of any Degree.

A.S. AARTHI (097F1A0401)


GUVVALA SRIKANTH (097F1A0427)
S. SWATHI (097F1A0430)

iii
ACKNOWLEDGEMENT

The completion of this project work gives us an opportunity to convey our gratitude to
all those who have helped us to reach a stage where we have the confidence to launch
our career in the competitive world in the field of ELECTRONICS AND
COMMUNICATION ENGINEERING.

We express our sincere thanks to “Dr. D.MAHESHWAR REDDY” Principal,


“VISHWA BHARATHI INSTITUTE OF TECHNOLOGY AND SCIENCES”
for providing all necessary facilities in completing our project report.

We express our sense of gratitude to Mr. C.ASHOK VISHNU Head of Department


of ECE, who encouraged us to select the project and completion of this project with
providing necessary facilities

Our honest thankfulness to Mr. S. BALAKRISHNA, (Internal Guide) for his kind
help and for giving us the necessary guidance and valuable suggestions in completing
this project work and in preparing this report.

We take the opportunity to express gratitude to the Management, Teaching and Non
teaching Staff of “VISHWA BHARATHI INSTITUTE OF TECHNOLOGY AND
SCIENCES” for their kind co-operation during the period of my Study.

Finally, we would like to thank our parents & friends for their continuous
encouragement and support during the entire course of this project work.

iv
ABSTRACT

A rescue robot is a robot that has been designed for the purpose of aiding rescue
workers. Common situations that employ rescue robots are mining accidents, urban
disasters, hostage situations, and explosions. Rescue robots were used in the search
for victims and survivors after the September 11 attacks in New York. The benefits of
rescue robots to these operations include reduced personnel requirements, reduced
fatigue, and access to otherwise unreachable areas. Robotic search and rescue is
useful since robots may be deployed in dangerous environments without putting
human responders at risk. This project is a prototype which is widely used for military
applications.

PIR sensor is used to detect human. A Passive Infra Red sensor (PIR
sensor) is an electronic device which measures infrared light radiating from objects in
its field of view. Apparent motion is detected when an infrared source with one
temperature, such as a human, passes in front of an infrared source with another
temperature, it detects. It acts as a motion detector.

This robot uses Zigbee technology. This can be moved forward and
reverse direction using geared motors of 60RPM. Also this robot can take sharp
turnings towards left and right directions. This project uses AT89S52 MCU as its
controller. Also a wireless camera with voice is interfaced to the kit. This project uses
9V battery. This project is much useful for mines detection and surveillance
applications.

v
LIST OF CONTENTS

TITLE CONTENTS PAGE NO

Certificate of Department i
Certificate of Organization ii
Declaration iii
Acknowledgement iv
Abstract v
List of contents vi
List of figures viii
List of tables x

CHAPTER-1 INTRODUCTION 1

CHAPTER-2 BLOCK DIAGRAM 3


2.1 Transmitter block 3
2.2 Receiver block 4
2.3 Working procedure 5

CHAPTER-3 HARDWARE DETAILS 6


3.1 Introduction 6
3.2 Components used 6
3.3 Power supply 6
3.4 Buzzer 8
3.5 DC-motor 9
3.6 H-Bridge 12
3.7 Wireless camera with voice transmission 16
3.8 Zigbee 16
3.9 Microcontroller 17

CHAPTER-4 WIRELESS COMMUNICATION 18


4.1 Introduction 18
4.2 Application of Wireless Data Communication 18
4.3 Zigbee 19
4.4 Interfacing of Zigbee Transmitter and Receiver 25

CHAPTER-5 MICROCONTROLLER 26
5.1 Introduction 26
5.2 Features 26
5.3 Description 27

vi
5.4 Pin diagram of AT89S52 29
5.5 Pin description 30
5.6 8052 Microcontroller Memory Organization 34
5.7 Program Memory 34
5.8 Data Memory 35

CHAPTER-6 PIR(Passive Infrared Sensor) 36


6.1 Sensor 36
6.2 PIR Sensor Introduction 36
6.3 How PIR Sensor Work 37
6.4 Applications 37
6.5 Advantages 37
6.6 Disadvantages 37
6.7 Specification 38
6.8 Quick start CKT 38
6.9 Features 39
6.10 Theory of operation 39
6.11 Calibration 40
6.12 Sensitivity 40
6.13 Interfacing of PIR Sensor with MC 40

CHAPTER -7 SOFTWARE DETAILS 41


7.1 Keil Software 41
7.2 Introduction to keil software 43
7.3 Proload 51

CHAPTER-8 SCHEMATIC REPRESENTAION 53


8.1 Schematic Representation of TX 53
8.2 Schematic Representation of RX 54

CHAPTER-9 ADVANTAGES AND APPLICATONS 55


9.1 Advantages 55
9.2 Application 55

CHAPTER-10 RESULT 56
11.1 Transmitter (input) 56
11.2 Receiver (output) 57

CHAPTER-11 CONCLUSION AND FUTURE SCOPE 58

REFERENCES 59

APPENDIX 60

vii
LIST OF FIGURES

FIGURES PAGE NO

Fig: 3.1.Power supply 7

Fig: 3.2.Buzzer 8

Fig: 3.3.Buzer making 8

Fig: 3.4.2-Pole Dc motor 9

Fig: 3.5.Rotation of Dc motor 10

Fig: 3.6.3-Pole dc motor 11

Fig: 3.7.Dc motor 11

Fig: 3.8.Circuit of H-bridge 12

Fig: 3 .9.Block diagram 15

Fig: 3.10.Pin connections 15

Fig: 4.1.Zigbee module 19

Fig: 4.2.Architecture of Zigbee 22

Fig: 5.1.Block diagram 28

Fig: 5.2.Pin diagram of At89s52 29

Fig: 5.3.Oscillator connections 33

Fig: 5.4.Program memory 34

Fig: 5.5.Microcontroller with external memory 35

viii
Fig: 6.1.PIR Sensor 36

Fig: 6 .2.Sensor circuit 38

Fig: 6.3. Range of PIR sensor 39

ix
LIST OF TABLES

TABLES PAGE NO

Table 3.1: H -bridge 13

Table 3.2: Absolute maximum rating 15

Table 5.1: Port 0 of microcontroller 30

Table 5.2: Port 3 of microcontroller 31

x
SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-1
INTRODUCTION

1.1. INTRODUCTION

A Robot is a mechatronics device which also includes resourcefulness or autonomy.


A device with autonomy does its thing "on its own" without a human directly guiding
it moment-by-moment. Some authors would contend that all mechatronic devices are
robots, and that this book's restriction on robot entails only specialized software.

Robotics can be described as the current pinnacle of technical development.


Robotics is a confluence science using the continuing advancements of mechanical
engineering, material science, sensor fabrication, manufacturing techniques, and
advanced algorithms. The study and practice of robotics will expose a dabbler or
professional to hundreds of different avenues of study. For some, the romanticism of
robotics brings forth an almost magical curiosity of the world leading to creation of
amazing machines. A journey of a lifetime awaits in robotics.

Robotics can be defined as the science or study of the technology primarily


associated with the design, fabrication, theory, and application of robots. While other
fields contribute the mathematics, the techniques, and the components, robotics
creates the magical end product. The practical applications of robots drive
development of robotics and drive advancements in other sciences in turn. Crafters
and researchers in robotics study more than just robotics.

A rescue robot is a robot that has been designed for the purpose of aiding
rescue workers. Common situations that employ rescue robots are mining accidents,
urban disasters, hostage situations, and explosions. Rescue robots were used in the
search for victims and survivors after the September 11 attacks in New York. The
benefits of rescue robots to these operations include reduced personnel requirements,
reduced fatigue, and access to otherwise unreachable areas. Robotic search and rescue
is useful since robots may be deployed in dangerous environments without putting
human responders at risk. This project is a prototype which is widely used for military
applications.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 1


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

1.2. INTRODUCTION OF EMBEDDED SYSTEM:


An Embedded System is a combination of computer hardware and software, and
perhaps additional mechanical or other parts, designed to perform a specific function.
A good example is the microwave oven. Almost every household has one, and tens of
millions of them are used every day, but very few people realize that a processor and
software are involved in the preparation of their lunch or dinner. This is in direct
contrast to the personal computer in the family room. It too is comprised of computer
hardware and software and mechanical components (disk drives, for example).
However, a personal computer is not designed to perform a specific function rather; it
is able to do many different things.

Many people use the term general-purpose computer to make this distinction
clear. As shipped, a general-purpose computer is a blank slate; the manufacturer does
not know what the customer will do wish it. One customer may use it for a network
file server another may use it exclusively for playing games, and a third may use it to
write the next great American novel.

Frequently, an embedded system is a component within some larger system.


For example, modern cars and trucks contain many embedded systems. One
embedded system controls the anti-lock brakes, other monitors and controls the
vehicle's emissions, and a third displays information on the dashboard. In some cases,
these embedded systems are connected by some sort of a communication network, but
that is certainly not a requirement.

At the possible risk of confusing you, it is important to point out that a


general-purpose computer is itself made up of numerous embedded systems. For
example, my computer consists of a keyboard, mouse, video card, modem, hard drive,
floppy drive, and sound card-each of which is an embedded system. Each of these
devices contains a processor and software and is designed to perform a specific
function.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 2


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-2

BLOCK DIAGRAM

2.1. TRANSMITTER BLOCK:

Power
supply unit

Control
switches

A
T
8
9
Crystal S
5
2

RESET

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 3


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

2.2. RECEIVER BLOCK:

Wireless Camera with voice


transmission
Battery

BUZZER

Zigbee Geared
Receiver Motor
-I
AT H-
89S52 MCU Bridge

11.0592MHz
Crystal
Geared
Oscillator
Motor
- II

Power – On
Reset
PIR SENSOR

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 4


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

2.3. WORKING PROCEDURE:

The block diagram consists of data transmitter and data receiver blocks.

2.3.1 .TRANSMITTER BLOCK:

As the overall system contains two microcontroller units, the function of


microcontrollers differ to each other, two different software programs are prepared to
function as data transmitter and data receiver. The data transmitting unit consists of
four major devices they are: control switches, AT89S52 micro controller, Power
supply unit and zigbee transmitter. Control switches are given to port0,that is from
P0.0 to P0.3 and zigbee transmitter is given to port3,that is from P3.0 to P3.1.Through
this control switches we can control the robot, that is we can move the robot either
forward, reverse direction using geared motors of 60RPM.also this robot can take
sharp turning towards left and right directions.

Whenever any switch pressed from the control switches (sw0, sw1, sw2, sw3)
that is given to micro controller, through controller it is given to zigbee transmitter
and the same information will be passed to zigbee receiver through zigbee transmitter.
Whenever PIR sensor detects any object in the receiver block then automatically the
siren will be ON and the images which are captured through wireless camera will be
displayed on display screen.

2.3.2. RECEIVER BLOCK:

Similarly, the data receiving unit contains five major units, they are: zigbee receiver,
AT89S52 microcontroller unit, PIR sensor, buzzer, wireless camera. From zigbee
transmitter the switch, which is pressed at transmitter, will be transmitted to the
zigbee receiver, depending on the zigbee receiver information the robot will be moved
forward, reverse, left and right directions using geared motors of 60 RPM. Whenever
PIR sensor detects any object the microcontroller makes the buzzer ON and
simultaneously the video will be viewed in the monitor.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 5


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-3

HARDWARE DETAILS

3.1. INTRODUCTION:

A rescue robot is a robot that has been designed for the purpose of aiding rescue
workers. Common situations that employ rescue robots are mining accidents, urban
disasters, hostage situations, and explosions. Rescue robots were used in the search
for victims and survivors after the September 11 attacks in New York. The benefits of
rescue robots to these operations include reduced personnel requirements, reduced
fatigue, and access to otherwise unreachable areas.

3.2. COMPONENTS USED:

• Power supply
• Buzzer
• Motors
• Wireless camera.
• Zigbee
• Microcontroller

3.3. POWER SUPPLY:

The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a
rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order
to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to
remove any a.c components present even after rectification. Now, this voltage is given
to a voltage regulator to obtain a pure constant dc voltage.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 6


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Fig.3.1:Power supply

3.3.1. TRANSFORMER:

Usually, DC voltages are required to operate various electronic equipment and these
voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the
a.c input available at the mains supply i.e., 230V is to be brought down to the required
voltage level. This is done by a transformer. Thus, a step down transformer is
employed to decrease the voltage to a required level.

3.3.2. RECTIFIER:

The output from the transformer is fed to the rectifier. It converts A.C. into pulsating
D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge
rectifier is used because of its merits like good stability and full wave rectification.

3.3.3. FILTER:

Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the
output stage.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 7


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

3.3.4. VOLTAGE REGULATOR:

As the name itself implies, it regulates the input applied to it. A voltage regulator is an
electrical regulator designed to automatically maintain a constant voltage level. In this
project, power supply of 5V and 12V are required. In order to obtain these voltage
levels, 7805 and 7812 voltage regulators are to be used. The first number 78
represents positive supply and the numbers 05, 12 represent the required output
voltage levels.

3.4. BUZZER:

Fig3.2: Buzzer

An electric coil is wound on a plastic bobbin, the latter having a central sleeve within
which a magnetic core is slide ably positioned. One end of the sleeve is closed and
projects beyond the coil. An inverted cup-shaped housing surrounds the coil and
bobbin and has a central opening through which the closed end of the sleeve projects.
The core projects into the closed end of the sleeve beyond the margin of the opening
in the housing to augment the magnetic coupling between the housing and the core.
The open end of the housing is attached to a support bracket of magnetic material,
there being a spring between the bracket and bobbin normally urging the core toward
the closed end of the sleeve.

3.4.1. BUZZER MAKING:

Fig3.3: Buzzer making

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 8


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Buzzers have a positive and a negative terminal, marked on their case. The positive
terminal should be connected to the positive voltage supply. The negative terminal
should be connected to the signal from the driver.

3.5. DC MOTOR:

A DC motor is an electric motor that runs on direct current (DC) electricity.

3.5.1. DC MOTOR CONNECTIONS:


Figure shows schematically the different methods of connecting the field and
armature circuits in a DC Motor. The circular symbol represents the armature circuit,
and the squares at the side of the circle represent the brush commutator system. The
direction of the arrows indicates the direction of the magnetic fields.

3.5.2. PRINCIPLES OF OPERATION:


In any electric motor, operation is based on simple electromagnetism. A current-
carrying conductor generates a magnetic field; when this is then placed in an external
magnetic field, it will experience a force proportional to the current in the conductor,
and to the strength of the external magnetic field. The internal configuration of a DC
motor is designed to harness the magnetic interaction between a current-carrying
conductor and an external magnetic field to generate rotational motion.Let's start by
looking at a simple 2-pole DC electric motor (here red represents a magnet or winding
with a "North" polarization, while green represents a magnet or winding with a
"South" polarization).

Fig3.4: 2-pole dc motor

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 9


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and all that
Beamers will see), the external magnetic field is produced by high-strength permanent
magnets. The stator is the stationary part of the motor -- this includes the motor
casing, as well as two or more permanent magnet pole pieces. The rotor (together with
the axle and attached commutator) rotates with respect to the stator. The rotor consists
of windings (generally on a core), the windings being electrically connected to the
commutator.The above diagram shows a common motor layout -- with the rotor
inside the stator (field) magnets.

The geometry of the brushes, commutator contacts, and rotor windings are
such that when power is applied, the polarities of the energized winding and the stator
magnet(s) are misaligned, and the rotor will rotate until it is almost aligned with the
stator's field magnets. As the rotor reaches alignment, the brushes move to the next
commutator contacts, and energize the next winding. Given our example two-pole
motor, the rotation reverses the direction of current through the rotor winding, leading
to a "flip" of the rotor's magnetic field, driving it to continue rotating. In real life,
though, DC motors will always have more than two poles (three is a very common
number). In particular, this avoids "dead spots" in the commutator.

Meanwhile, with a two-pole motor, there is a moment where the commutator


shorts out the power supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy, and damage
motor components as well. Yet another disadvantage of such a simple motor is that it
would exhibit a high amount of torque "ripple" (the amount of torque it could produce
is cyclic with the position of the rotor).

Fig3.5: rotation of dc motor

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 10


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

So since most small DC motors are of a three-pole design, let's tinker with the
workings of one via an interactive animation.

Fig3.6: 3 pole dcmotor

You'll notice a few things from this -- namely, one pole is fully energized at a time
(but two others are "partially" energized). As each brush transitions from one commutator
contact to the next, one coil's field will rapidly collapse, as the next coil's field will rapidly
charge up (this occurs within a few microsecond). We'll see more about the effects of this
later, but in the meantime you can see that this is a direct result of the coil windings' series
wiring:

Fig3.7: Dc motor

The use of an iron core armature (as in the Mabuchi, above) is quite common,
and has a number of advantages. First off, the iron core provides a strong, rigid
support for the windings -- a particularly important consideration for high-torque
motors. The core also conducts heat away from the rotor windings, allowing the
motor to be driven harder than might otherwise be the case.
Iron core construction is also relatively inexpensive compared with other
construction types. But iron core construction also has several disadvantages.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 11


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

The iron armature has a relatively high inertia which limits motor acceleration.
This construction also results in high winding inductances which limit brush and
commutator life.
In small motors, an alternative design is often used which features a 'coreless'
armature winding. This design depends upon the coil wire itself for structural
integrity. As a result, the armature is hollow, and the permanent magnet can be
mounted inside the rotor coil. Coreless DC motors have much lower armature
inductance than iron-core motors of comparable size, extending brush and
commutator life.

3.6. H-BRIDGE:
An H-bridge is an electronic circuit which enables DC electric motors to be run

Fig3.8: Circuit of H-bridge

Forward,Backwards. These circuits are often used in robotics. H-bridges are available
as integrated circuits, or can be built from discrete components. The two basic states
of a H-bridge. The term "H-bridge" is derived from the typical graphical
representation of such a circuit. An H-bridge is built with four switches (solid-state or
mechanical). When the switches S1 and S4 (according to the first 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.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 12


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Using the nomenclature above, the switches S1 and S2 should never be closed at the
same time, as this would cause a short circuit on the input voltage source. The same
applies to the switches S3 and S4. This condition is known as shoot-through.

3.6.1. OPERATION:

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

S1 S2 S3 S4 Result

Motor moves
1 0 0 1
right

Motor moves
0 1 1 0
left

Motor free
0 0 0 0
runs

0 1 0 1 Motor brakes

Table3.1: H-bridge table

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 13


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

3.6.2. H-BRIDGE DRIVER L293D (DUAL MOTORS DRIVERS):


The switching property of this H-Bridge can be replace by a Transistor or a Relay or a
Mosfet or even by an IC. Here we are replacing this with an IC named L293D as the
driver whose description is as given below.

3.6.3. FEATURES:

• 600mA OUTPUT CURRENT CAPABILITY


• PER CHANNEL
• 1.2A PEAK OUTPUT CURRENT (non repetitive)
• PER CHANNEL
• ENABLE FACILITY
• OVERTEMPERATURE PROTECTION
• LOGICAL "0" INPUT VOLTAGE UP TO 1.5 V
• (HIGH NOISE IMMUNITY)
• INTERNAL CLAMP DIODES

3.6.4. DESCRIPTION:

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. To
simplify use as two bridges each pair of channels is equipped with an enable input. A
separate supply input is provided for the logic, allowing operation at a lower voltage
and internal clamp diodes are included. This device is suitable for use in switching
applications at frequencies up to 5 kHz. The L293D is assembled in a 16 lead plastic
package which has 4 center pins connected together and used for heat sinking The
L293DD is assembled in a 20 lead surface mount which has 8 center pins connected
together and used for heat sinking.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 14


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

3.6.5. BLOCK DIAGRAM:

Fig3.9: Block diagram of H-bridge(L293D)

3.6.6. ABSOLUTE MAXIMUM RATINGS:

Table3.2: Absolute maximum rating

3.6.7. PIN CONNECTIONS:

Fig3.10: Pin connections

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 15


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

3.7. WIRELESS CAMERA WITH VOICE TRANSMISSION:

A portable small-sized camera has a case having a ball-point pen appearance in a


portion thereof and a through hole in one side, and a camera circuit part built in the
case and for photographing an object through the through hole. The portable small-
sized camera has the ball-point pen appearance, photographing a particular location in
secret is possible without exposure to others. The camera circuit part is connected to a
wireless transmission device for outputting a signal by a cable.

A wireless receiving device at a remote location from the wireless


transmission device receives a signal of the wireless transmission device for
outputting or recording. The portable camera further includes a microphone and the
transmission device transmits a voice signal.

3.8. ZIGBEE:

ZigBee is an established set of specifications for wireless personal area networking


(WPAN), i.e. digital radio connections between computers and related devices.
WPAN Low Rate or ZigBee provides specifications for devices that have low data
rates, consume very low power and are thus characterized by long battery life. ZigBee
makes possible completely networked homes where all devices are able to
communicate and be controlled by a single unit. The ZigBee Alliance, the standards
body which defines ZigBee, also publishes application profiles that allow multiple
OEM vendors to create interoperable products. The current list of application profiles
either published or in the works are:
• Home Automation
• ZigBee Smart Energy
• Telecommunication Applications
• Personal Home

The relationship between IEEE 802.15.4 and ZigBee is similar to that between
IEEE 802.11 and the Wi-Fi Alliance. For non-commercial purposes, the ZigBee
specification is available free to the general public.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 16


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

An entry level membership in the ZigBee Alliance, called Adopter, costs US$ 3500
annually and provides access to the as-yet unpublished specifications and permission
to create products for market using the specifications. ZigBee is one of the global
standards of communication protocol formulated by the relevant task force under the
IEEE 802.15 working group. The fourth in the series, WPAN Low Rate/ZigBee is the
newest and provides specifications for devices that have low data rates, consume very
low power and are thus characterized by long battery life. Other standards like
Bluetooth and IrDA address high data rate applications such as voice, video and LAN
communications.

ZigBee devices are actively limited to a through rate of 250Kbps, compared to


Bluetooth's much larger pipeline of 1Mbps, operating on the 2.4 GHz ISM band,
which is available throughout most of the world. Further description of zigbee
technology will be explained in chapter-5.

3.9. MICROCONTROLLERS:

Microprocessors and microcontrollers are widely used in embedded systems products.


Microcontroller is a programmable device. A microcontroller has a CPU in addition
to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single
chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in
microcontrollers makes them ideal for many applications in which cost and space are
critical.

The Intel 8052 is Harvard architecture, single chip microcontroller (µC) which
was developed by Intel in 1980 for use in embedded systems. It was popular in the
1980s and early 1990s, but today it has largely been superseded by a vast range of
enhanced devices with 8052-compatible processor cores that are manufactured by
more than 20 independent manufacturers including Atmel, Infineon Technologies and
Maxim Integrated Products.8052 is an 8-bit processor, meaning that the CPU can
work on only 8 bits of data at a time. Further description of microcontroller will be
explained in chapter-4.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 17


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-4

WIRELESS COMMUNICATION

4.1. INTRODUTION:
In the world today, everything would be incredibly different if it were not for wireless
communication devices. The fact that we can communicate with people in other parts
of our own country and the world is amazing and has led to lots of changes in human
history.

4.2.APPLICATIONS OF WIRELESS DATA COMMUNICATIONS:

Wireless data communications are an essential component of mobile computing. The


various available technologies differ in local availability, coverage range and
performance, and in some circumstances, users must be able to employ multiple
connection types and switch between them. To simplify the experience for the user,
connection manager software can be used, or a mobile VPN deployed to handle the
multiple connections as a secure, single virtual network. Supporting technologies
include:

Wi-Fi is a wireless local area network that enables portable computing devices
to connect easily to the internet. Standardized as IEEE 802.11a, b, g, n, Wi-
Fi approaches speeds of some types of wired Ethernet. Wi-Fi has become the de facto
standard for access in private homes, within offices, and at public hotspots. Some
businesses charge customers a monthly fee for service, while others have begun
offering it for free in an effort to increase the sales of their goods.

Cellular data service offers coverage within a range of 10-15 miles from the
nearest cellsite. Speeds have increased as technologies have evolved, from earlier
technologies such as GSM, CDMA and GPRS, to3G networks

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 18


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Mobile Satellite Communications may be used where other wireless connections are
unavailable, such as in largely rural areas or remote locations Satellite
Communication are especially important for transportation, aviation, maritime and
military.

4.3. ZIGBEE:

Fig 4.1: Zigbee module

ZigBee module. The €1 coin, shown for size reference, is about 23 mm (0.9 inch) in
diameter. ZigBee is a specification for a suite of high level communication protocols
using small, low-power digital radios based on the IEEE 802.15.4-2003 standard for
wireless personal area networks (WPANs), such as wireless headphones connecting
with cell phones via short-range radio. The technology defined by the ZigBee
specification is intended to be simpler and less expensive than other WPANs, such as
Bluetooth. ZigBee is targeted at radio-frequency (RF) applications that require a low
data rate, long battery life, and secure networking. The ZigBee Alliance is a group of
companies that maintain and publish the ZigBee standard.

ZigBee is an established set of specifications for wireless personal area


networking (WPAN), i.e. digital radio connections between computers and related
devices. ZigBee makes possible completely networked homes where all devices are
able to communicate and be controlled by a single unit. The current list of application
profiles either published or in the works are:

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 19


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

• Home Automation

• ZigBee Smart Energy

• Telecommunication Applications

• Personal Home

The relationship between IEEE 802.15.4 and ZigBee is similar to that between IEEE
802.11 and the Wi-Fi Alliance. For non-commercial purposes, the ZigBee
specification is available free to the general public. An entry level membership in the
ZigBee Alliance, called Adopter, costs US$ 3500 annually and provides access to the
as-yet unpublished specifications and permission to create products for market using
the specifications.

ZigBee is one of the global standards of communication protocol formulated by


the relevant task force under the IEEE 802.15 working group. The fourth in the series,
WPAN Low Rate/ZigBee is the newest and provides specifications for devices that
have low data rates, consume very low power and are thus characterized by long
battery life. Other standards like Bluetooth and IrDA address high data rate
applications such as voice, video and LAN communications. ZigBee devices are
actively limited to a through rate of 250Kbps, compared to Bluetooth's much larger
pipeline of 1Mbps, operating on the 2.4 GHz ISM band, which is available throughout
most of the world. In the consumer market ZigBee is being explored for everything
from linking low-power household devices such as smoke alarms to a central housing
control unit, to centralized light controls.

The specified maximum range of operation for ZigBee devices is 250 feet (76m),
substantially further than that used by Bluetooth capable devices, although security
concerns raised over "sniping" Bluetooth devices remotely, may prove to hold true for
ZigBee devices as well. Due to its low power output, ZigBee devices can sustain
themselves on a small battery for many months, or even years, making them ideal for
install-and-forget purposes, such as most small household systems. Predictions of
ZigBee installation for the future, most based on the explosive use of ZigBee in
automated household tasks in China, look to a near future when upwards of sixty

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 20


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

ZigBee devices may be found in an average American home, all communicating with
one another freely and regulating common tasks seamlessly. The goal is “to provide
the consumer with ultimate flexibility, mobility, and ease of use by building wireless
intelligence and capabilities into every day devices. With acceptance and
implementation of ZigBee, interoperability will be enabled in multi-purpose, self-
organizing mesh networks.

4.3.1. ZIGBEE CHARACTERISTICS:

The focus of network applications under the IEEE 802.15.4 / ZigBee standard include
the features of low power consumption, needed for only two major modes (Tx/Rx or
Sleep), high density of nodes per network, low costs and simple implementation.
These features are enabled by the following characteristics,

• 2.4GHz and 868/915 MHz dual PHY modes. This represents three license-free
bands: 2.4-2.4835 GHz, 868-870 MHz and 902-928 MHz the number of channels
allotted to each frequency band is fixed at sixteen (numbered 11-26), one (numbered
0) and ten (numbered 1-10) respectively. The higher frequency band is applicable
worldwide, and the lower band in the areas of North America, Europe, Australia and
New Zealand.

• Low power consumption, with battery life ranging from months to years.
Considering the number of devices with remotes in use at present, it is easy to see that
more numbers of batteries need to be provisioned every so often, entailing regular (as
well as timely), recurring expenditure. In the ZigBee standard, longer battery life is
achievable by either of two means: continuous network connection and slow but sure
battery drain, or intermittent connection and even slower battery drain.

• Maximum data rates allowed for each of these frequency bands are fixed as 250
kbps @2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868 MHz

• High throughput and low latency for low duty cycle applications (<0.1%)

• Channel access using Carrier Sense Multiple Access with Collision Avoidance
(CSMA - CA)

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 21


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

• Addressing space of up to 64 bit IEEE address devices, 65,535 networks.

4.3.2. ARCHITECTURE:

Fig4.2: Architecture of zigbee

ZigBee is a home-area network designed specifically to replace the proliferation of


individual remote controls. ZigBee was created to satisfy the market's need for a cost-
effective, standards-based wireless network that supports low data rates, low power
consumption, security, and reliability.

It may be helpful to think of IEEE 802.15.4 as the physical radio and ZigBee
as the logical network and application software. Following the standard Open Systems
Interconnection (OSI) reference model, ZigBee's protocol stack is structured in layers.
The first two layers, physical (PHY) and media access (MAC), are defined by the
IEEE 802.15.4 standard. ZigBee-compliant products operate in unlicensed bands
worldwide, including 2.4GHz (global), 902 to 928MHz (Americas), and 868MHz
(Europe). Raw data throughput rates of 250Kbps can be achieved at 2.4GHz (16
channels), 40Kbps at 915MHz (10 channels), and 20Kbps at 868MHz (1 channel).
The transmission distance is expected to range from 10 to 75m, depending on power
output and environmental characteristics.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 22


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Like Wi-Fi, Zigbee uses direct-sequence spread spectrum in the 2.4GHz band,
with offset-quadrature phase-shift keying modulation. Channel width is 2MHz with
5MHz channel spacing. The 868 and 900MHz bands also use direct-sequence spread
spectrum but with binary-phase-shift keying modulation.

4.3.3. PROTOCOLS:
The protocols build on recent algorithmic research (Ad-hoc On-demand Distance
Vector, neuRFon) to automatically construct a low-speed ad-hoc network of nodes. In
most large network instances, the network will be a cluster of clusters. It can also
form a mesh or a single cluster. The current profiles derived from the ZigBee
protocols support beacon and non-beacon enabled networks.

In non-beacon-enabled networks (those whose beacon order is 15), an


unslotted CSMA/CA channel access mechanism is used. In this type of network,
ZigBee Routers typically have their receivers continuously active, requiring a more
robust power supply. However, this allows for heterogeneous networks in which some
devices receive continuously, while others only transmit when an external stimulus is
detected. The typical example of a heterogeneous network is a wireless light switch:
The ZigBee node at the lamp may receive constantly, since it is connected to the
mains supply, while a battery-powered light switch would remain asleep until the
switch is thrown. The switch then wakes up, sends a command to the lamp, receives
an acknowledgment, and returns to sleep. In such a network the lamp node will be at
least a ZigBee Router, if not the ZigBee Coordinator; the switch node is typically a
ZigBee End Device.

In beacon-enabled networks, the special network nodes called ZigBee Routers


transmit periodic beacons to confirm their presence to other network nodes. Nodes
may sleep between beacons, thus lowering their duty cycle and extending their battery
life.

Beacon intervals may range from 15.36 milliseconds to 15.36 ms * 214 = 251.65824
seconds at 250 Kbit/s, from 24 milliseconds to 24 ms * 214 = 393.216 seconds at 40
kbit/s and from 48 milliseconds to 48 ms * 214 = 786.432 seconds at 20 kbit/s.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 23


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

However, low duty cycle operation with long beacon intervals requires precise timing,
which can conflict with the need for low product cost.

In general, the ZigBee protocols minimize the time the radio is on so as to


reduce power use. In beaconing networks, nodes only need to be active while a
beacon is being transmitted. In non-beacon-enabled networks, power consumption is
decidedly asymmetrical: some devices are always active, while others spend most of
their time sleeping

4.3.4. Zigbee/IEEE 802.15.4 - General Characteristics:

• Dual PHY (2.4GHz and 868/915 MHz)


• Data rates of 250 kbps (@2.4 GHz), 40 kbps (@ 915 MHz), and 20 kbps
(@868 MHz)
• Optimized for low duty-cycle applications (<0.1%)
• CSMA-CA channel access Yields high throughput and low latency for low
duty cycle devices like sensors and controls
• Low power (battery life multi-month to years)
• Multiple topologies: star, peer-to-peer, mesh

4.3.5. USES:

Zigbee protocols are intended for use in embedded applications requiring low data
rates and low power consumption. ZigBee's current focus is to define a general-
purpose, inexpensive, self-organizing mesh network that can be used for industrial
control, embedded sensing, medical data collection, smoke and intruder warning,
building automation, home automation, etc. The resulting network will use very small
amounts of power — individual devices must have a battery life of at least two years
to pass Zigbee certification.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 24


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

4.4. INTERFACING OF ZIGBEE TRANSMITTER AND


RECEIVER WITH AT89S52:

4.4.1. TRANSMITTER:

The above figure, shows the interfacing of zigbee transmitter with microcontroller in
which zigbee transmitter is connected to Port3.Whenever any switch pressed from the
control switches (sw0, sw1, sw2, sw3) that is given to micro controller, through
controller it is given to zigbee transmitter.

4.4.2. RECEIVER:

The above figure, shows the interfacing of zigbee receiver with microcontroller in
which zigbee receiver is connected to Port3.From zigbee transmitter, the information
will be transmitted to the zigbee receiver.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 25


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-5

MICROCONTROLLER

5.1. INTRODUCTION:

Microprocessors and microcontrollers are widely used in embedded systems products.


Microcontroller is a programmable device. A microcontroller has a CPU in addition
to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single
chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in
microcontrollers makes them ideal for many applications in which cost and space are
critical. The Intel 8052 is Harvard architecture, single chip microcontroller (µC)
which was developed by Intel in 1980 for use in embedded systems. It was popular in
the 1980s and early 1990s, but today it has largely been superseded by a vast range of
enhanced devices with 8052-compatible processor cores that are manufactured by
more than 20 independent manufacturers including Atmel, Infineon Technologies and
Maxim Integrated Products. The present project is implemented on Keil uVision. In
order to program the device, proload tool has been used to burn the program onto the
microcontroller.

5.2. FEATURES:

• Compatible with MCS-51® Products


• 8K Bytes of In-System Programmable (ISP) Flash Memory
– Endurance: 1000 Write/Erase Cycles
• 4.0V to 5.5V Operating Range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-level Program Memory Lock
• 256 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-bit Timer/Counters
• Eight Interrupt Sources
• Full Duplex UART Serial Channel

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 26


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

• Low-power Idle and Power-down Modes


• Interrupt Recovery from Power-down Mode
• Watchdog Timer
• Dual Data Pointer
• Power-off Flag

5.3. DESCRIPTION:

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with


8K bytes of in-system programmable Flash memory. The device is manufactured
using Atmel’s 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 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.

The AT89S52 provides the following standard features: 8K bytes of Flash,


256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port,
on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with
static logic for operation down to zero frequency and supports two software selectable
power saving modes. The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port, and interrupt system to continue functioning. The Power-
down mode saves the RAM contents but freezes the oscillator, disabling all other chip
functions until the next interrupt or hardware reset.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 27


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Fig5.1: Block diagram

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 28


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5.4. PIN DIAGRAM OF AT89S52:

Fig5.2: Pin diagram of AT89S52

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 29


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5.5. PIN DESCRIPTION:

5.5.1. VCC:

Supply voltage.

5.5.2. GND:

Ground.

5.5.3. Port 0:

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. External pull-
ups are required during program verification.

5.5.4. Port 1:

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.

Table5.1: Port0 of microcontroller

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 30


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5.5.5. Port 2:

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four 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. As inputs, Port 2 pins
that are externally being pulled low will source current (IIL) because of the 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 use 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.

5.5.6. Port 3:

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four 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. As inputs, Port 3 pins
that are externally being pulled low will source current (IIL) because of the pull-ups.
Port 3 also serves the functions of various special features of the AT89S52, as shown
in the following table. Port 3 also receives some control signals for Flash
programming and verification.

Table5.2: Port 3 of microcontroller

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 31


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5.5.7. 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 96 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.

5.5.8. 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. Note, however, that one ALE pulse is skipped during each access to
external data memory. If desired, ALE operation can be disabled by setting bit 0 of
SFR location 8EH. 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.

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

5.5.10. EA/VPP:

External Access Enable. 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 FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on
reset.

EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 32


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5.5.11. XTAL1

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

5.5.12. 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. 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
the below figure. 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 maximum voltage high and low time specifications must
be observed.

Fig5.3: Oscillator Connections

C1, C2 = 30 pF ± 10 pF for Crystals

= 40 pF ± 10 pF for Ceramic Resonators

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 33


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5.6. 8052 MICROCONTROLLER MEMORY ORGANIZATION:

The microcontroller memory is divided into Program Memory and Data Memory.
Program Memory (ROM) is used for permanent saving program being executed,
while Data Memory (RAM) is used for temporarily storing and keeping intermediate
results and variables. Depending on the model in use (still referring to the whole 8052
microcontroller family) at most a few Kb of ROM and 128 or 256 bytes of RAM can
be used. However All 8052 microcontrollers have 16-bit addressing bus and can
address 64 kb memory. It is neither a mistake nor a big ambition of engineers who
were working on basic core development. It is a matter of very clever memory
organization which makes these controllers a real “programmers’ tidbit“.

5.7. PROGRAM MEMORY:

The oldest models of the 8052 microcontroller family did not have any internal
program memory. It was added from outside as a separate chip. These models are
recognizable by their label beginning with 803 (for ex. 8031 or 8032). All later
models have a few Kbytes ROM embedded, Even though it is enough for writing
most of the programs, there are situations when additional memory is necessary. A
typical example of it is the use of so called lookup tables. They are used in cases when
something is too complicated or when there is no time for solving equations
describing some process. The example of it can be totally exotic (an estimate of self-
guided rockets’ meeting point) or totally common (measuring of temperature using
non-linear thermo element or asynchronous motor speed control).

Fig5.4: Program memory

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 34


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Fig5.5: Microcontroller with external memory

EA=0 In this case, internal program memory is completely ignored, only a program
stored in external memory is to be executed.

EA=1 In this case, a program from built-in ROM is to be executed first (to the last
location). Afterwards, the execution is continued by reading additional memory.

in both cases, P0 and P2 are not available to the user because they are used for data
and address transmission. Besides, the pins ALE and PSEN are used too.

5.8. Data Memory:


As already mentioned, Data Memory is used for temporarily storing and keeping data
and intermediate results created and used during microcontroller’s operating. Besides,
this microcontroller family includes many other registers such as: hardware counters
and timers, input/output ports, serial data buffers etc. The previous versions have the
total memory size of 256 locations, while for later models this number is incremented
by additional 128 available registers. In both cases, these first 256 memory locations
(addresses 0-FFh) are the base of the memory. Common to all types of the 8052 micro
controllers. Locations available to the user occupy memory space with addresses from
0 to 7Fh. First 128 registers and this part of RAM is divided in several blocks.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 35


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-6

PASSIVE INFRARED SENSOR (PIR)

6.1. SENSOR:
A sensor is a device that measures a physical quantity and converts it into a signal
which can be read by an observer or by an instrument. For example, a mercury-in-
glass thermometer converts the measured temperature into expansion and contraction
of a liquid which can be read on a calibrated glass tube. A thermocouple converts
temperature to an output voltage which can be read by a voltmeter.

6.2. PIR SENSOR INTRODUCTION:

This Passive Infrared Sensor (PIR) module is used for motion detection. It can be uses
as motion detector on your robot. It can work from 5V to 9V DC and gives digital
output. It requires 10-60 seconds of settling time before starting its operation. It
consists of pyroelectric sensor that detects motion by measuring change in the infrared
levels emitted by the objects. It can detect motion up to 6 meters.

6.2.1. PIR SENSOR:

A PIR sensor, or Passive Infrared sensor, is a type of detector that is capable of


detecting infrared light emitting from objects within its field of view. PIR sensors
differ from other infrared sensors because they are only able to receive infrared waves
rather than being able to emit and receive them. Because all objects emit infrared
(electromagnetic waves that travel with heat), PIR sensors are able to detect objects
that are in front of them. In fact, PIR sensors can see many things that humans cannot.

Fig6.1: PIR sensor

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 36


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

6.3. HOW PIR SENSORS WORK:

PIR sensors are made of pyro electric (or thermoelectric) materials and usually
contain lenses or mirrors in order to focus the infrared light for maximum reception.
As infrared light comes in contact with the pyro electric material, which is usually a
thin sheet, it creates an electrical current that can be measured to determine the
intensity of the infrared light (depth perception) and the direction that it came from.
Because of these properties, PIR sensors are able to determine not how far away a
person is, but also whether or not he/she is approaching the sensor.

6.4.APPLICATIONS:

PIR sensors are used for a wide variety of applications. For example, PIR sensors are
used on television sets and television accessory devices, such as VCRs and DVD
players, to receive infrared light coming from a television remote. PIR sensors are
also used as motion detectors for most public doorways in grocery stores, hospitals,
and libraries. PIR sensors can also be used for military applications in the form of
laser range finding, night vision, and heat-seeking missiles.

6.5.ADVANTAGES:

PIR sensors have several important advantages. For example, PIR sensors are able to
detect infrared light from between several feet and several yards away, depending on
how the device is calibrated. PIR sensors are generally compact and can be fitted into
virtually any electronic device. PIR sensors also do not need an external power source
as they generate electricity as they absorb infrared light.

6.6.DISADVANTAGES:

Although PIR sensors can be advantageous, they also have several disadvantages. For
example, PIR sensors are only capable of receiving infrared light and cannot emit it
like other types of infrared sensors. PIR sensors can also be expensive not only to
purchase, but to install and calibrate as well.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 37


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

6.7.SPECIFICATIONS:

• Single bit output


• Small size makes it easy to conceal
• Sensitivity: Preset able
• Size: Length 32mm, Width 24mm, Thickness 26mm
Application Ideas
• Alarm Systems

6.8. QUICK START CIRCUIT:

Note: The sensor is active high when the jumper (shown in the upper left) is in either
position.

Fig6.2: Sensor circuit

The Passive Infrared Sensor (PIR) sensor module is used for motion detection. It can
be used as motion detector for security systems or robotics. It works from 3.3V to 5V
DC and gives TTL output which can be directly given to microcontroller or to relay
through a transistor. It consists of pyroelectric sensor and Fresnel lens that detects
motion by measuring change in the infrared levels emitted by the objects. It can detect
motion up to 20ft. This module is very sensitive to change in infrared levels subjected
by human movement.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 38


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

Fig6.3: Range of PIR sensor

6.9. FEATURES:

• Supply: 3.3V Dc to 5V DC
• Detection range: 6meters
• Output: 5V TTL
• Adjustable sensitivity levels (High or Low)
• Settling time: 60 seconds
• Size: Length 32mm, Width 24mm, Height 26mm

6.10. THEORY OF OPERATION:


Pyroelectric devices, such as the PIR sensor, have elements made of a crystalline
material that generates an electric charge when exposed to infrared radiation. The
changes in the amount of infrared striking the element change the voltages generated,
which are measured by an on-board amplifier. The device contains a special filter
called a Fresnel lens, which focuses the infrared signals onto the element. As the
ambient infrared signals change rapidly, the on-board amplifier trips the output to
indicate motion.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 39


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

6.11. CALIBRATION:

The PIR Sensor requires a ‘warm-up’ time in order to function properly. This is due to
the settling time involved in ‘learning’ its environment. This could be anywhere from
10-60 seconds. During this time there should be as little motion as possible in the
sensors field of view.

6.12. SENSITIVITY:

The PIR Sensor has a range of approximately 20 feet. This can vary with
environmental conditions. The sensor is designed to adjust to slowly changing
conditions that would happen normally as the day progresses and the environmental
conditions change, but responds by making its output high when sudden changes
occur, such as when there is motion.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 40


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-7

SOFTWARE DETAILS

7.1. KEIL SOFTWARE:


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.

7.1.1. STEPS TO WRITE AN ASSEMBLY / C LANGUAGE


PROGRAM IN KEIL AND HOW TO COMPILE IT:

1. Install the Keil Software in the PC in any of the drives.


2. After installation, an icon will be created with the name “Keil uVision3”. Just
drag this icon onto the desktop so that it becomes easy whenever you try to
write programs in keil.
3. Double click on this icon to start the keil compiler.
4. A page opens with different options in it showing the project workspace at the
leftmost corner side, output window in the bottom and an ash colored space
for the program to be written.
5. Now to start using the keil, click on the option “project”.
6. A small window opens showing the options like new project, import project,
open project etc. Click on “New project”.
7. A small window with the title bar “Create new project” opens. The window
asks the user to give the project name with which it should be created and the
destination location. The project can be created in any of the drives available.
You can create a new folder and then a new file or can create directly a new
file.
8. After the file is saved in the given destination location, a window opens where
a list of vendors will be displayed and you have to select the device for the
target you have created.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 41


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

9. The most widely used vendor is Atmel. So click on Atmel and now the family
of microcontrollers manufactured by Atmel opens. You can select any one of
the microcontrollers according to the requirement.
10. When you click on any one of the microcontrollers, the features of that
particular microcontroller will be displayed on the right side of the page. The
most appropriate microcontroller with which most of the projects can be
implemented is the AT89S52. Click on this microcontroller and have a look at
its features. Now click on “OK” to select this microcontroller.
11. A small window opens asking whether to copy the startup code into the file
you have created just now. Just click on “No” to proceed further.
12. Now you can see the TARGET and SOURCE GROUP created in the project
workspace.
13. Now click on “File” and in that “New”. A new page opens and you can start
writing program in it.
14. After the program is completed, save it with any name but with the .asm or .c
extension. Save the program in the file you have created earlier.
15. You can notice that after you save the program, the predefined keywords will
be highlighted in bold letters.
16. Now add this file to the target by giving a right click on the source group. A
list of options open and in that select “Add files to the source group”. Check
for this file where you have saved and add it.
17. Right click on the target and select the first option “Options for target”. A
window opens with different options like device, target, output etc. First click
on “target”.
18. Since the set frequency of the microcontroller is 11.0592 MHz to interface
with the PC, just enter this frequency value in the Xtal (MHz) text area and put
a tick on the Use on-chip ROM. This is because the program what we write
here in the keil will later be dumped into the microcontroller and will be stored
in the inbuilt ROM in the microcontroller.
19. Now click the option “Output” and give any name to the hex file to be created
in the “Name of executable” text area and put a tick to the “Create HEX file”
option present in the same window. The hex file can be created in any of the
drives. You can change the folder by clicking on “Select folder for Objects”.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 42


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

20. Now to check whether the program you have written is errorless or not, click
on the icon exactly below the “Open file” icon which is nothing but Build
Target icon. You can even use the shortcut key F7 to compile the program
written.
21. To check for the output, there are several windows like serial window,
memory window, project window etc. Depending on the program you have
written, select the appropriate window to see the output by entering into debug
mode.
22. The icon with the letter “d” indicates the debug mode.
23. Click on this icon and now click on the option “View” and select the
appropriate window to check for the output.
24. After this is done, click the icon “debug” again to come out of the debug
mode.
25. The hex file created as shown earlier will be dumped into the microcontroller
with the help of another software called Proload.

7.2. INTRODUCTION TO KEIL SOFTWARE:

7.3.1. ABOUT KEIL:

1. Click on the Keil u Vision4 Icon on Desktop


2. .The following fig will appear

3. Click on the Project menu from the title bar


4. Then Click on New Project

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 43


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

5. Save the Project by typing suitable project name with no extension in u r


own folder sited in either C:\ or D:\

6. Then Click on save button above.


7. Select the component for u r project. i.e. Atmel……
8. Click on the + Symbol beside of Atmel

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 44


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

9. Select AT89S52 as shown below

10. Then Click on “OK”


11. The Following fig will appear

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 45


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

12. Then Click either YES or NO………mostly “NO”


13. Now your project is ready to USE
14. Now double click on the Target1, you would get another option “Source group
1” as shown in next page.

:
15. Click on the file option from menu bar and select “new”

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 46


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.

Now start writing program in either in “C” or “ASM”

17. For a program written in Assembly, then save it with extension “. asm” and
for “C” based program save it with extension “ .C”

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 47


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

18. Now right click on Source group 1 and click on “Add files to Group Source”

20. Now you will get another window, on which by default “C” files will appear.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 48


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

19. Now select as per your file extension given while saving the file
20. Click only one time on option “ADD”
21. Now Press function key F7 to compile. Any error will appear if so happen.

22. If the file contains no error, then press Control+F5 simultaneously.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 49


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

23. The new window is as follows

24. Then Click “OK”


25. Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 50


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

26. Drag the port a side and click in the program file.

27. Now keep Pressing function key “F11” slowly and observe.
28. You are running your program successfully

7.3. PROLOAD:
Proload is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller placed in the
programmer kit and this is done by the Proload. Programmer kit contains a
microcontroller on it other than the one which is to be programmed. This
microcontroller has a program in it written in such a way that it accepts the hex file
from the keil compiler and dumps this hex file into the microcontroller which is to be
programmed. As this programmer kit requires power supply to be operated, this
power supply is given from the power supply circuit designed above. It should be
noted that this programmer kit contains a power supply section in the board itself but
in order to switch on that power supply, a source is required. Thus this is
accomplished from the power supply board with an output of 12volts or from an
adapter connected to 230 V AC.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 51


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

1. Install the Proload Software in the PC.


2. Now connect the Programmer kit to the PC (CPU) through serial cable.
3. Power up the programmer kit from the ac supply through adapter.
4. Now place the microcontroller in the GIF socket provided in the programmer
kit.
5. Click on the proload icon in the PC. A window appears providing the
information like Hardware model, com port, device type, Flash size etc. Click
on browse option to select the hex file to be dumped into the microcontroller
and then click on “Auto program” to program the microcontroller with that
particular hex file.
6. The status of the microcontroller can be seen in the small status window in the
bottom of the page .After this process is completed, remove the
microcontroller from the programmer kit and place it in your system board.
Now the system board behaves according to the program written in the
microcontroller.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 52


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-8

SCHEMATIC REPRESENTATION

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 53


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 54


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER -9

ADVANTAGES AND APPLICATIONS

9.1. ADVANTAGES:

 It reduces complexity in finding living objects.


 It helps in tracking the living objects when they got struck in collapse
building, underground mines, fire accidents ect.

9.2. DISADVANTAGE:

 The coverage area of our PIR sensor is limited and it can be increased in real
time applications when it is actually implemented in rescuing living objects.

9.3. APPLICATIONS:

 Can be used in collapse building.


 Can be used in underground mines.
 Can be used in fire accidents.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 55


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-10

RESULT

10.1. TRANSMITTER (INPUT):

Fig: When the transmitter is in the on state

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 56


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

10.2. RECEIVER (OUTPUT):

Fig: when PIR sensor detects any living objects

Fig: Displaying the image at the transmitter using wireless camera

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 57


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

CHAPTER-11

CONCLUSION AND FUTURE SCOPE

CONCLUSION

This project presents the Search and Rescue robot for victims of earthquake and other
natural calamities is been designed and implemented with Atmel 89S52 MCU in
embedded system domain. Experimental work has been carried out carefully. The
result shows that higher efficiency is indeed achieved using the embedded system
according to requirement of the user.

FUTURE SCOPE
 In future, we can do this project using GSM, by using GSM modem we can send
message to the ambulance, PS, etc.

 By increasing the sensors in all directions we can make the system


omidirectional.

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 58


SEARCH AND RESCUE ROBOT FOR THE VICTIMS OF EARTHQUAKE ECE

REFERENCES

1. 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS BY MAZZIDI


2. Magazines:
 Electronics for you
 Electrikindia
3. WWW.Electronic projects.com

VISHWA BHARATHI INSTITUTE OF TECHNOLOGY & SCIENCE (VBITS) Page 59


APPENDIX

SOURCECODE:

TRANSMITTER:
#include<reg52.h>
Sbit key1 = P0^4;
sbit key2 = P0^5;
sbit key3 = P0^6;
sbit key4 = P0^7;
Void send_com (unsigned char arr_ch)
{
SBUF=arr_ch;
While (TI==0);//
TI=0;
}
Void main ()
{
TMOD=0X20;
TH1=0XFD;
SCON=0X50;
TR1=1;
while (1)
{
If (key1==0)
{
send_com ('1');
}
If (key2==0)
{
send_com ('2');
}
If (key3==0)
{
send_com ('3');
}
If (key4==0)
{
send_com ('4');

}
}
}

RECEIVER:
#include"reg52.h"
sbit ip1 = P2^0; //H-Bridge
sbit ip2 = P2^1;
sbit ip3 = P2^2;
sbit ip4 = P2^3;
Void serial_int ();
Void stop (void);
Void DelayMs (unsigned int count);
Unsigned char i;
Void main()
{
serial_int ();
While (1)
{
If (RI==1)
{
If (SBUF == '2')
{
ip1=1;
ip2=0;
ip3=1;
ip4=0;
}
If (SBUF == '4')
{
for (i=0;i<=20;i++)
{
ip1=1;
ip2=0;
ip3=0;
ip4=1;
DelayMs(15);
stop ();
DelayMs(1);
}
}
If (SBUF == '6')
{
for (i=0;i<=20;i++)
{
ip1=0;
ip2=1;
ip3=1;
ip4=0;
DelayMs(15);
stop();
DelayMs(1);
}
state=0;
}
If (SBUF == '8')
{
ip1=0;
ip2=1;
ip3=0;
ip4=1;
}
if (SBUF == '0')
{
stop ();
}
RI = 0;
}
}
}

Void DelayMs(unsigned int count)


{
Unsigned int i;
while (count)
{
i = 100;
While(i>0)
i--;
Count--;
}
}
Void stop (void)
{
ip1=ip2=ip3=ip4=0;
}
Void serial_int ()
{
TMOD=0X21;
TH1=0X0FD;
SCON=0X50;
TR1=1;
}

Vous aimerez peut-être aussi