You are on page 1of 76

A

MAJOR PROJECT REPORT ON


War Field Wireless Spying Robot With An Land Mine
Detection And Sharpshooting Weapon
SUBMITTED TO

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY,


HYDERABAD, TS
IN PARTIAL FULFILLMENT OF THE REQUIREMENTS
FOR THE AWARD OF THE DEGREE
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
SUBMITTED BY
S.KRISHNAVENI (13EK1A0422)
K.MAHESH (13EK1A0408)
K.PRASHNATHI (14EK5A0407)
SD.RIYAZ (14EK5A0416)

Under the esteemed guidance of

CH.VENKATESHWARA RAO,Asst.Professor
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
VEPALAGADA, KOTHAGUDEM, BHADRADRI KOTHAGUDEM (Dist).
(Approved by AICTE New Delhi, Affiliated to JNTU, Hyderabad)
2016-2017
ABDUL KALAM INSTITUTE OF TECHNOLOGICAL SCIENCES

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE
This is to certify that this dissertation entitled War Field Wireless

Spying Robot With An Land Mine Detection And Sharpshooting


Weapon is a bonfide work done by

In partial fulfillment of the requirements for the award of the Degree of Bachelor of
Technology in Electronics and Communication Engineering from Jawaharlal
Nehru Technological University Hyderabad, (JNTUH) during the Academic year
2016-2017.

CH.VENKATESHWARA RAO Asst,prof K. RAVICHANDRA,Assoc prof


Internal Guide Head of the Department

External examiner
DECLARATION

We hereby declare that the project report entitled War Field Wireless Spying

Robot With An Land Mine Detection And Sharpshooting Weapon


Submitted to ABDUL KALAM INSTITUTE OF TECHNOLOGICAL
SCIENCES in partial fulfillment of the requirement for the award of degree of
Bachelor of Technology in Electronics and Communication Engineering by
JNTUH, the project is done by us and not has been submitted to any other institute or
university for the award of any degree or equivalent.

Place: KOTHAGUDEM
Date:

PROJECT ASSOCIATE
S.KRISHNAVENI (13EK1A0422)
K.MAHESH (13EK1A0408)
K.PRASHNATHI (14EK5A0407)
SD.RIYAZ (14EK5A0416)
ACKNOWLEDGEMENT

We would like to express my gratitude to all the people behind the screen who helped me
to transform an idea into a real application.

We would like to express my heart-felt gratitude to my parents without whom we would


not have been privileged to achieve and fulfill my dreams. We are grateful to our principal, Dr.
M.JANARDHAN who most ably run the institution and has had the major hand in enabling me
to do my project.

We profoundly thank Sri.K.RAVICHANDRA , Head of the Department of


Electronics and Communication Engineering who has been an excellent guide and also a great
source of inspiration to my work.

We would like to thank my internal guide Mr.CH.VENKATESHWARA RAO,Asst


Prof for his technical guidance, constant encouragement and support in carrying out my project.

The satisfaction and euphoria that accompany the successful completion of the task
would be great but incomplete without the mention of the people who made it possible with their
constant guidance and encouragement crowns all the efforts with success. In this context, We
would like thank all the other staff members, both teaching and non-teaching, which have
extended their timely help and eased my task.

PROJECT ASSOCIATE
S.KRISHNAVENI (13EK1A0422)
K.MAHESH (13EK1A0408)
K.PRASHNATHI (14EK5A0407)
SD.RIYAZ (14EK5A0416)
TABLE OF CONTENTS

CONTENTS PAGE NO

Abstract i

List of figures ii

1. INTRODUCTION TO EMBEDDED SYSTEM 1-5

1.1 Introduction To Embedded System 1

1.2 Applications Of Embedded Systems 3

1.3 Components Used 5

2. LITERATURE SURVEY 6

3. PROBLEM IDENTIFICATION 7

4. IMPLEMENTATION DETAILS 8-38

4.1 Microcontroller AT89S52: 8

4.1.1 FEATURES: 8

4.1.2 Pin Description 10

4.2 Regulated power supply 16

4.2.1 Circuit Features 17

4.3 RS232 (SERIAL PORT) 19

4.4 RS232 INTERFACED TO MAX 232 21

4.5 Max232 Interfaced To Microcontroller 22

4.6 Transistor 22
4.7 Gear Motor 25

4.8 Operation Principle 26

4.9 Speed Reduction 28

4.10 Liquid Crystal Display 29

4.11 Buzzer 36

5. EXCECUTION DETAILS KEIL COMPILATION TOOL 39-64

5.1 Introduction To Micro Vision Keil 39

5.2 CONCEPT OF COMPILER: 39

5.3 CONCEPT OF CROSS COMPILER 40

5.4 KEIL C CROSS COMPILER: 41

5.5 PCB Wizard 42

5.6 Flash Magic 43

5.6.1 Introduction 43

5.6.2 Five Step Programming 44

5.7 Programming Language 47

6. ADVANTAGES & APPLICATIONS 65

7. FUTURE SCOPE 66

8. CONCLUSION 67

9. BIBLIOGRAPHY 68
ABSTRACT

The project aims in designing a War field robot which is capable of detecting human
beings and land mines in its path and which is wirelessly controlled through PC using Wifi
technology. This robot also shoots using the laser light. It is a very low cost robot used to
monitor the Warfield. The robot can be moved in all the directions using the PC wirelessly.

Wifi is a PAN technology based on the IEEE 802.15.4 standard. Unlike Bluetooth or
wireless USB devices, Wifi devices have the ability to form a mesh network between nodes.
Meshing is a type of daisy chaining from one device to another. This technique allows the short
range of an individual node to be expanded and multiplied, covering a much larger area.

The modules in the project are: Wifi modules for establishing wireless communication,
Robot arm which is capable of diffusing bomb, DC motors is attached to the robot arm for the
movement of the robot and Microcontroller which performs the controlling operations of Robot
arm in diffusing the bombs.

The controlling device of the whole system is a Microcontroller. Whenever the user presses a
button in the PC, the data related to that button is sent through Wifi module interfaced to PC.
Whenever the appropriate keys are pressed in the keyboard of computer, the data related to those
keys will be transmitted over Wifi module. This data will be received by Wifi module at robot
arm and this data is fed as input to the controller. The Microcontroller checks the data with the
program embedded in it and performs appropriate actions on the robot arm. This data will be
received by the Wifi module in the robot system and feds this to Microcontroller which judges
the relevant task to the information received and acts accordingly. Whenever, land mines are
detected, it alerts through buzzer alarm system. The Microcontrollers used in the project are
programmed using Embedded C language.

i
List of figures page no

Figure1.1:A modern example of embedded system 1

Figure 1.2: Network communication embedded systems 3

Figure 1.3: Automatic coffee makes equipment 3

Figure 1.4: Fax machine 4

Figure 4.1 Pin Description of 8051 Microcontroller 9

Figure: 4.2. Regulators 17

Figure: 4.2(a) Block Diagram Of Power Supply 18

Figure: 4.2(b) Circuit Diagram Of Power Supply 18

Figure: 4.3 RS 232 Pin 20

Figure: 4.4 Rs232 Interfaced To Max232 21

Figure: 4.5 Max232 Interfaced To Microcontroller 22

Figure 4.6.1 Construction and circuit symbol for PNP and NPN transistors. 23

Figure 4.6.2 Characteristic curves for a transistor 24

Figure 4.6.3 Identification of Input and Output circuits for an NPN transistor 24

Figure 4.6.4. Measurement parameters for hfe (see equation 3) 25

Figure 5.1 Flash Magic in Real Time 47

ii
WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-1

INTRODUCTION TO EMBEDDED SYSTEM

1.1 EMBEDDED SYSTEM

An embedded system is a computer system designed to perform one or a few


dedicated functions often with real-time computing constraints. It is embedded as part of
a complete device often including hardware and mechanical parts. By contrast, a general-
purpose computer, such as a personal computer (PC), is designed to be flexible and to
meet a wide range of end-user needs. Embedded systems control many devices in
common use today.

Embedded systems are controlled by one or more main processing cores that are
typically either microcontrollers or digital signal processors (DSP). The key
characteristic, however, is being dedicated to handle a particular task, which may require
very powerful processors. Since the embedded system is dedicated to specific tasks,
design engineers can optimize it to reduce the size and cost of the product and increase
the reliability and performance. Some embedded systems are mass-produced, benefiting
from economies of scale.

Fig 1.1:A modern example of embedded system

Dept. Of ECE 1 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

1.1.2 NEED OF EMBEDDED SYSTEM

The uses of embedded systems are virtually limitless, because every day new
products are introduced to the market that utilizes embedded computers in novel ways. In
recent years, hardware such as microprocessors, microcontrollers, and FPGA chips have
become much cheaper. So when implementing a new form of control, it's wiser to just
buy the generic chip and write your own custom software for it. Producing a custom-
made chip to handle a particular task or set of tasks costs far more time and money. Many
embedded computers even come with extensive libraries, so that "writing your own
software" becomes a very trivial task indeed.

1.1.3 CLASSIFICATIONS OF EMBEDDED SYSTEM

Stand Alone Embedded System

These systems takes the input in the form of electrical signals from transducers or
commands from human beings such as pressing of a button etc.., process them and
produces desired output. This entire process of taking input, processing it and giving
output is done in standalone mode.
E.g.: microwave oven, air conditioner etc.

Real-Time Embedded Systems

Embedded systems which are used to perform a specific task or operation in a


specific time period those systems are called as real-time embedded systems. There are
two types of real-time embedded systems.

Soft Real Time Embedded Systems

These embedded systems follow a relative dead line time period i.e.., if the task is
not done in a particular time that will not cause damage to the equipment.

E.g.: Consider a TV remote control system, if the remote control takes a few
milliseconds delay it will not cause damage either to the TV or to the remote control.

Dept. Of ECE 2 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Network Communication Embedded Systems

A wide range network interfacing communication is provided by using embedded


systems. Consider a web camera that is connected to the computer with internet can be
used to spread communication like sending pictures, images, videos etc.., to another
computer with internet connection throughout anywhere in the world.

Consider a web camera that is connected at the door lock.Whenever a person


comes near the door, it captures the image of a person and sends to the desktop of your
computer which is connected to internet. This gives an alerting message with image on to
the desktop of your computer, and then you can open the door lock just by clicking the
mouse.

Fig 1.2: Network communication embedded systems

1.2 APPLICATIONS OF EMBEDDED SYSTEMS

Consumer applications: At home we use a number of embedded systems which include


microwave oven, remote control, VCD players, DVD players, camera etc.

Fig 1.3: Automatic coffee makes equipment

Dept. Of ECE 3 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Office automation: We use systems like fax machine, modem, printer etc

Fig 1.4: Fax machine

BLOCK DIAGRAM

RPS

METAL
A
LCD
DETECTOR T

9 BUZZER
IR
SENSOR S

5
L293D
WIFI GEAR
2
MOTOR

Dept. Of ECE 4 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

1.3 COMPONENTS USED

HARDWARE COMPONENTS REQUIRED:

REGULATED POWER SUPPLY


AT89S52
GSM MODEM
LCD
METAL DETECTOR
IR SENSOR
MOTOR
L293D IC
BUZZER
MOBILE PHONE

SOFTWARE TOOLS REQUIRED:

Embedded C
The KEIL U version IDE which keil C51 product is a complete software
development environment for the 8051 microcontroller family.
Flash the device using Flash Magic, a free software utility sponsored by NXP
PCB WIZARD
Windows XP

Dept. Of ECE 5 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-2

LITERATURE SURVEY

In the event of explosion, earthquake that made the building collapse or fire
broke in the building, people faces several constraints in variety of aspect such as the
difficulties in entering the building, and make through several obstacles with small size of
hole. Besides that, a bomb is any of a range of explosive weapons that only rely on the
exothermic reaction of an explosive material to provide an extremely sudden and violent
release of energy (an explosive device). In this situation it hard for us as human to come
in to the building that consist of explosive material it can risk our life. When people
cannot enter the building, they also cannot see what happened inside the building and
know the source or type of explosion material used or trapped people inside. Others else,
nowadays it seems in recent years being busy has become the rule rather than the
exception. Busy lifestyle parents in taking care of baby or other things to watch every
moment it is hard to do. Lifestyle working from both mom and dad has become trend in
metropolis city. Monitoring camera device display can help the busy parent or others in
monitor the situation in a baby room, living hall or private room in a short distance
control used only on the laptop.

Dept. Of ECE 6 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-3

PROBLEM IDENTIFICATION

Now-a-days tracing and attacking enemies at different areas are very much difficult
for the soldiers. There is always a chance for loss of lives of the soldiers during war and
emergency situations. We are implemented a solution for the problem of replacing a soldier
with a Robot Soldier completely controlled with a wireless network

Dept. Of ECE 7 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-4

IMPLEMENTATION DETAILS

4.1 MICROCONTROLLER AT89S52:

Oscillator, disabling all other chip functions until the next interrupt or hardware
reset. 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
Atmels high-density nonvolatile memory technology and is compatible with the
industry-standard 80C51 instruction set and pinout. The on-chip Flash allows the
program memory to be reprogrammed in-system or by a conventional nonvolatile
memory pro-grammar. 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 con- tents but freezes the

4..1.1 FEATURES:

COMPATIBLE WITH MCS-51PRODUCTS


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
Dept. Of ECE 8 AKITS
WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

256 X 8-BIT INTERNAL RAM


32 PROGRAMMABLE I/O LINES
THREE 16-BIT TIMER/COUNTERS
EIGHT INTERRUPT SOURCES
FULL DUPLEX UART SERIAL CHANNEL
LOW-POWER IDLE AND POWER-DOWN MODES
INTERRUPT RECOVERY FROM POWER-DOWN MODE
WATCHDOG TIMER
DUAL DATA POINTER
POWER-OFF FLAG

PIN CONFIGURATION:

Figure 4.1 Pin Description of 8051 Microcontroller

Dept. Of ECE 9 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

4.1.2 Pin Description

VCC

Supply voltage.

GND

Ground

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.

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.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the
following table. Port 1 also receives the low-order address bytes during Flash
programming and verification

Dept. Of ECE 10 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

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 uses 8-bit addresses (MOVX @ RI), Port 2 emits
the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.

Port 3:

Port 3 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pullups. Port 3
also serves the functions of various special features of the AT89S52, as shown in the

Dept. Of ECE 11 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

following table. Port 3 also receives some control signals for Flash pro-gramming and
verification.

Table :1 Port 1 Configuration

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.

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

Dept. Of ECE 12 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

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. weakly pulled high. Setting the ALE-
disable bit has no effect if the microcontroller is in external execution mode.

PSEN:

Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external pro-gram memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped during
each access to external data memory. Program Store Enable (PSEN) is the read strobe to
external program memory. When the AT89S52 is executing code from external pro-
gram memory, PSEN is activated twice each machine cycle, except that two PSEN
activations are skipped during each access to external data memory. Note, however, that
if lock bit 1 is programmed, EA w internally latched on reset. EA should be strapped to
VCC for internal programming. This pin also receives the 12-volt programming enable
age (VPP) during Flash programming.

XTAL1:

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

XTAL2:

Output from the inverting oscillator amplifier.

Special Function Registers:

A map of the on-chip memory area called the Special Function Register (SFR) space
is. Note that not all of the addresses are occupied, and unoccupied addresses may not be
implemented on the chip. Read accesses to these addresses will in general return random
data, and write accesses will have an indeterminate effect. User software should not write

Dept. Of ECE 13 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

1s to these unlisted locations, since they may be used in future products to invoke new
features. In that case, the reset or inactive values of the new bits will always be 0. Timer 2
Registers: Control and status bits are contained in registers T2CON (shown in Table 2)
and T2MOD (shown in Table 3) for Timer 2. The register pair (RCAP2H, RCAP2L) are
the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload
mode. Interrupt Registers: The individual interrupt enable bits are in the IE register. Two
priorities can be set for each of the six interrupt sources in the IP register.

Dual Data Pointer Registers:

To facilitate accessing both internal and external data memory, two banks of 16-
bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1
at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user
should always initialize the DPS bit to the appropriate value before accessing the
respective Data Pointer Register.

Power off Flag:

The Power off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is
set to 1 during power up. It can be set and rest under software control and is not
affected by reset.

Memory Organization

MCS-51 devices have a separate address space for Program and Data Memory. Up
to 64K bytes each of external Program and Data Memory can be addressed.

Program Memory

If the EA pin is connected to GND, all program fetches are directed to external
memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses
0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H
through FFFFH are to external memory.

Dept. Of ECE 14 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Data Memory:

The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers. This means that the
upper 128 bytes have the same addresses as the SFR space but are physically separate
from SFR space. When an instruction accesses an internal location above address 7FH,
the address mode used in the instruction specifies whether the CPU accesses the upper
128 bytes of RAM or the SFR space. Instructions which use direct addressing access of
the SFR space. For example, the following direct addressing instruction accesses the SFR
at location 0A0H (which is P2).

UART:

The UART in the AT89S52 operates the same way as the UART in the AT89C51
and AT89C52. For further information on the UART operation, refer to the ATMEL Web
site (http://www.atmel.com). From the home page, select Products, then 8051-
Architecture Flash Microcontroller, then Product Overview.

Timer 0 and 1:

Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer
1 in the AT89C51 and AT89C52. For further information on the timers operation, refer
to the ATMEL Web site (http://www.atmel.com). From the home page, select Products,
then 8051-Architecture Flash Microcontroller, then Product Overview.

Timer 2:

Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event


counter. The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table
2). Timer 2 has three operating modes: capture, auto-reload (up or down counting), and
baud rate generator. The modes are selected by bits in T2CON Timer 2 consists of two 8-
bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every

Dept. Of ECE 15 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is
1/12 of the oscillator frequency.

Table: Timer 2 Operating Modes:

In the Counter function, the register is incremented in response to a 1-to-0


transition at its corresponding external input pin, T2. In this function, the external input is
sampled during S5P2 of every machine cycle. When the samples show a high in one cycle
and a low in the next cycle, the count is incremented. The new count value appears in the
register during S3P1 of the cycle following the one in which the transition was detected.
Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0
transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a
given level is sampled at least once before it changes, the level should be held for at least
one full machine cycle.

4.2 Regulated power supply

A variable regulated power supply, also called a variable bench power supply,
is one where you can continuously adjust the output voltage to your requirements.
Varying the output of the power supply is the recommended way to test a project after
having double checked parts placement against circuit drawings and the parts
placement guide.

This type of regulation is ideal for having a simple variable bench power
supply. Actually this is quite important because one of the first projects a hobbyist
should undertake is the construction of a variable regulated power supply. While a

Dept. Of ECE 16 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

dedicated supply is quite handy e.g. 5V or 12V, it's much handier to have a variable
supply on hand, especially for testing.

Most digital logic circuits and processors need a 5 volt power supply. To use
these parts we need to build a regulated 5 volt source. Usually you start with an
unregulated power To make a 5 volt power supply, we use a LM7805 voltage
regulator IC (Integrated Circuit). The IC is shown below.

Fig: 4.2. Regulators

The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin,
connect the negative lead to the Common pin and then when you turn on the power,
you get a 5 volt supply from the Output pin.

4.2.1 CIRCUIT FEATURES

Brief description of operation: Gives out well regulated +5V output, output
current capability of 100 mA.

Circuit protection: Built-in overheating protection shuts down output when


regulator IC gets too hot

Dept. Of ECE 17 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Circuit complexity: Very simple and easy to build

Circuit performance: Very stable +5V output voltage, reliable operation

Availability of components: Easy to get, uses only very common basic


components

Design testing: Based on datasheet example circuit, I have used this circuit
successfully as part of many electronics projects

Applications: Part of electronics devices, small laboratory power supply

Power supply voltage: Unregulated DC 8-18V power supply

Power supply current: Needed output current + 5 mA

Component costs: Few dollars for the electronics component plus the input
t.ransformer cost

Figure: 4.2(a) Block Diagram Of Power Supply

Figure: 4.2(b) Circuit Diagram Of Power Supply


Dept. Of ECE 18 AKITS
WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

4.3 RS232 (SERIAL PORT)

RS-232 (Recommended Standard - 232) is a telecommunications standard for binary


serial communications between devices. It supplies the roadmap for the way devices speak to
each other using serial ports. The devices are commonly referred to as a DTE (data terminal
equipment) and DCE (data communications equipment); for example, a computer and
modem, respectively.

RS232 is the most known serial port used in transmitting the data in communication
and interface. Even though serial port is harder to program than the parallel port, this is the
most effective method in which the data transmission requires less wires that yields to the
less cost. The RS232 is the communication line which enables the data transmission by only
using three wire links. The three links provides transmit, receive and common ground...

The transmit and receive line on this connecter send and receive data between the
computers. As the name indicates, the data is transmitted serially. The two pins are TXD &
RXD. There are other lines on this port as RTS, CTS, DSR, DTR, and RTS, RI. The 1 and
0 are the data which defines a voltage level of 3V to 25V and -3V to -25V respectively.

The electrical characteristics of the serial port as per the EIA (Electronics Industry
Association) RS232C Standard specifies a maximum baud rate of 20,000bps, which is slow
compared to todays standard speed. For this reason, we have chosen the new RS-232D
Standard, which was recently released.

The RS-232D has existed in two types. i.e., D-TYPE 25 pin connector and D-TYPE
9 pin connector, which are male connectors on the back of the PC. You need a female
connector on your communication from Host to Guest computer. The pin outs of both D-9 &
D-25 are show below.

Dept. Of ECE 19 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Fig: 4.3 RS 232 Pin

D-Type-9 pin D-Type-25 pin


Pin outs Function
no. no.
3 2 RD Receive Data (Serial data input)
2 3 TD Transmit Data (Serial data output)
Request to send (acknowledge to modem that
7 4 RTS
UART is ready to exchange data
Clear to send (i.e.; modem is ready to exchang
8 5 CTS
data)
6 6 DSR Data ready state (UART establishes a link)
5 7 SG Signal ground
Data Carrier detect (This line is active whe
1 8 DCD
modem detects a carrier
4 20 DTR Data Terminal Ready.
Ring Indicator (Becomes active when modem
9 22 RI
detects ringing signal from PSTN

Table 3: Pin Outs Of D-9 And D-25

When communicating with various micro processors one needs to convert the RS232
levels down to lower levels, typically 3.3 or 5.0 Volts. Here is a cheap and simple way to do
that. Serial RS-232 (V.24) communication works with voltages -15V to +15V for high and
low. On the other hand, TTL logic operates between 0V and +5V. Modern low power
consumption logic operates in the range of 0V and +3.3V or even lower

Dept. Of ECE 20 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

RS-232 TTL Logic

-15V -3V +2V +5V High

+3V +15V 0V +0.8V Low

Table 4: Logic Levels Of TTL & Rs232

Thus the RS-232 signal levels are far too high TTL electronics, and the negative RS-
232 voltage for high cant be handled at all by computer logic. To receive serial data from an
RS-232 interface the voltage has to be reduced. Also the low and high voltage level has to
be inverted. This level converter uses a Max232 and five capacitors. The max232 is
quite cheap (less than 5 dollars) or if youre lucky you can get a free sample from Maxim.
The MAX232 from Maxim was the first IC which in one package contains the necessary
drivers and receivers to adapt the RS-232 signal voltage levels to TTL logic

4.4 RS232 INTERFACED TO MAX 232

J2
C1
U3 1uf
16

9 5
8 4 13 12 P3.0 RXD
VCC

7 3 T1OUT 8 R1IN R1OUT 9


6 2 R2IN R2OUT
1 10 14 T1OUT
TXD P3.1 11 T2IN T1OUT 7
C4 T1IN T2OUT
5V 1
3 C1+
C5
0.1uf 4 C1-
5 C2+
C6 C2-
0.1uf 2
GND

0.1uf 6 V+
V-
C7
15

MAX3232
0.1uf

Figure: 4.4 Rs232 Interfaced To Max232

Rs232 is 9 pin db connector, only three pins of this are used ie 2,3,5 the transmit pin
of RS232 is connected to rx pin of microcontroller

Dept. Of ECE 21 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

4.5 MAX232 INTERFACED TO MICROCONTROLLER

Figure:4.5 Max232 Interfaced To Microcontroller

MAX232 is connected to the microcontroller as shown in the figure above 11, 12 pin
are connected to the 10 and 11 pin ie transmit and receive pin of microcontroller.

4.6 TRANSISTOR

A transistor is a solid-state, semiconductor device with three electrical connections


(emitter, base, collector). A small current flowing between base and emitter has the ability
to control a much larger current flowing between the collector and emitter. Transistors can
Dept. Of ECE 22 AKITS
WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

be manufactured in two distinct configurations: PNP or NPN. The N's and P's refer to the
kind of impurity introduced into the crystal structure of the various regions of the transistor.
This determines which way the currents flow through the transistor. The circuit symbol for
a transistor reveals its configuration by the direction of an arrow placed on the emitter lead
and distinguishes the emitter from the collector as shown in Figure 1.

N P N Transistor

Figure 4.6.1 Construction and circuit symbol for PNP and NPN transistors.

If, in the case of an NPN transistor, a positive voltage is applied to the collector (and
the emitter connected to the negative terminal to complete the circuit) no current will flow
unless a small current is allowed to flow through the base to the emitter. (For older types of
transistor a small leakage current, uncontrolled by the IB, but dependent on the temperature,
flows between the emitter and collector). The amount of collector current depends almost
entirely on the amount of base current and the first part of the experiment is concerned with
determining the extent of this dependence by plotting a set of curves known as the collector
characteristics. The collector characteristics are a family of curves showing the collector
current flowing as a function of collector voltage for various values of base current as shown
in Figure 2. From the collector characteristics the current amplification of the transistor may
be determined.

Dept. Of ECE 23 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Figure 4.6.2 Characteristic curves for a transistor

At any point X (in Figure 2) we may define a current ratio

Ic (X) (1)
h FE =
IB (X)

which typically may be from 10 to 500 depending on the transistor. Few are less than 10
(unless they are faulty) and a value in excess of 500 would indicate a rather exceptional
transistor. In some references FE or may be used instead of hFE.

The symbol h refers to what are known as "hybrid parameters", of which there are
four to describe most of the circuit properties of a transistor at low frequencies. The F
identifies the h-parameter as the Forward Current Amplification Factor and the E refers to
circuit operation with the Emitter common to both the input and output circuits surrounding
the transistor, as shown in Figure 3.

Figure 4.6.3. Identification of Input and Output circuits for an NPN transistor

Dept. Of ECE 24 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

A small current IB in the input circuit will control a larger current and

IC = hFE IB (2)

In most applications, such as amplifiers or radios, an alternating (AC) signal current


is amplified. An alternating current flows in both forward and reverse directions but
transistor action occurs only for current flowing in one direction through the transistor. This
is achieved by adding a D.C. bias to the signal. The forward half-cycles of the A.C. signal
add to the bias current and the reverse half-cycles subtract from it. To measure the
amplification produced by the transistor for A.C. signals we use

IC (X)
h fe = (3)
IB (X)

at a constant VCE as shown in Figure 4.

Figure 4.6.4. Measurement parameters for hfe (see equation 3)

4.7 GEAR MOTOR

What Is a Gear Motor?

Gear motors are complete motive force systems consisting of an electric motor
and a reduction gear train integrated into one easy-to-mount and -configure package. This
greatly reduces the complexity and cost of designing and constructing power tools,

Dept. Of ECE 25 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

machines and appliances calling for high torque at relatively low shaft speed or RPM.
Gear motors allow the use of economical low-horsepower motors to provide great motive
force at low speed such as in lifts, winches, medical tables, jacks and robotics. They can
be large enough to lift a building or small enough to drive a tiny clock.

12V High Torque DC GEAR MOTOR

4.8 Operation Principle

Most synchronous AC electric motors have output ranges of from 1,200 to 3,600
revolutions per minute. They also have both normal speed and stall-speed torque
specifications. The reduction gear trains used in gear
motors are designed to reduce the output speed while increasing the torque. The increase
in torque is inversely proportional to the reduction in speed. Reduction gearing allows
small electric motors to move large driven loads, although more slowly than larger

Dept. Of ECE 26 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

electric motors. Reduction gears consist of a small gear driving a larger gear. There may
be several sets of these reduction gear sets in a reduction gear box.

Gear

Toothed wheel that transmits the turning movement of one shaft to another shaft.
Gear wheels may be used in pairs or in threes if both shafts are to turn in the same
direction. The gear ratio the ratio of the number of teeth on the two wheels determines
the torque ratio, the turning force on the output shaft compared with the turning force on
the input shaft. The ratio of the angular velocities of the shafts is the inverse of the gear
ratio.

The common type of gear for parallel shafts is the spur gear, with straight teeth parallel
to the shaft axis. The helical gear has teeth cut along sections of a helix or corkscrew
shape; the double form of the helix gear is the most efficient for energy transfer. Bevel
gears, with tapering teeth set on the base of a cone, are used to connect intersecting
shafts.

Dept. Of ECE 27 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

The toothed and interlocking wheels which make up a typical gear movement.
Gear ratio is calculated by dividing the number of teeth on the driver gear by the number
of teeth on the driven gear (gear ratio = driver/driven); the idler gears are ignored. Idler
gears change the direction of rotation but do not affect speed. A high driven to driver
ratio (middle) is a speed-reducing ratio.

Different gears are used to perform different engineering functions depending on


the change in direction of motion that is needed. Rack and pinion gears are the
commonest gears and are used in car steering mechanics.

4.9 SPEED REDUCTION


Sometimes the goal of using a gear motor is to reduce the rotating shaft speed of a
motor in the device being driven, such as in a small electric clock where the tiny
synchronous motor may be spinning at 1,200 rpm but is reduced to one rpm to
drive the second hand, and further reduced in the clock mechanism to drive the
minute and hour hands. Here the amount of driving force is irrelevant as long as it
is sufficient to overcome the frictional effects of the clock mechanism.

Torque Multiplication
Another goal achievable with a gear motor is to use a small motor to generate a
very large force albeit at a low speed. These applications include the lifting
mechanisms on hospital beds, power recliners, and heavy machine lifts where the
great force at low speed is the goal.

Motor Varieties
Most industrial gear motors are AC-powered, fixed-speed devices, although there
are fixed-gear-ratio, variable-speed motors that provide a greater degree of
control. DC gear motors are used primarily in automotive applications such as

Dept. Of ECE 28 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

power winches on trucks, windshield wiper motors and power seat or power
window motors.

Many Applications
What power can openers, garage door openers, stair lifts, rotisserie motors, timer
cycle knobs on washing machines, power drills, cake mixers and
electromechanical clocks have in common is that they all use various integrations
of gear motors to derive a large force from a relatively small electric motor at a
manageable speed. In industry, gear motor applications in jacks, cranes, lifts,
clamping, robotics, conveyance and mixing are too numerous to count.

4.10 LIQUID CRYSTAL DISPLAY

Vcc, at pin 16 controls the background contrast.


Vcc, at pin 2 controls the display contrast.
Pin 7 - 14 gets input data.
Pin 1 and pin 3 controls the brightness of the display.
Pin 5, gets a read/write signal.
Pin 6, enable signal.
Pin 4, data register select.

Dept. Of ECE 29 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Interfacing Example - 16 Character x 2 Line LCD

Description:

This is the first interfacing example for the Parallel Port. We will start with
something simple. This example doesn't use the Bi-directional feature found on newer
ports, thus it should work with most, if no all Parallel Ports. It however doesn't show the
use of the Status Port as an input. So what are we interfacing? A 16 Character x 2 Line

Dept. Of ECE 30 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

LCD Module to the Parallel Port. These LCD Modules are very common these days, and
are quite simple to work with, as all the logic required running them is on board.

Schematic:

Circuit Description:

Above is the quite simple schematic. The LCD panel's Enable and Register Select
is connected to the Control Port. The Control Port is an open collector / open drain output.
While most Parallel Ports have internal pull-up resistors, there are a few which don't.
Therefore by incorporating the two 10K external pull up resistors, the circuit is more
portable for a wider range of computers, some of which may have no internal pull up
resistors.

We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on
the data lines. As a result we cannot read back the LCD's internal Busy Flag which tells us
if the LCD has accepted and finished processing the last instruction. This problem is
overcome by inserting known delays into our program.

Dept. Of ECE 31 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a bench power
supply set to 5v or use a onboard +5 regulator. Remember a few de-coupling capacitors,
especially if you have trouble with the circuit working properly. The 2 line x 16 character
LCD modules are available from a wide range of manufacturers and should all be
compatible with the HD44780. The one I used to test this circuit was a Power trip PC-
1602F and an old Philips LTN211F-10 which was extracted from a Poker Machine! The
diagram to the right shows the pin numbers for these devices. When viewed from the
front, the left pin is pin 14 and the right pin is pin

The LCD panel requires a few instructions to be sent, to order to turn on the
display and initialize it. This is what the first for loop does. These instructions must be
sent to the LCD's Instruction Register which is controlled by the Register Select (Pin 4).
When pin 4 is low the instruction register is selected, thus when high the data register
must be selected. We connect this to the Parallel Port's Select Printer line which happens
to be hardware inverted. Therefore if we write a '1' to bit 3 of the Control Register the
Select Printer line goes low.

We want to first send instructions to the LCD module. Therefore the Register
Select line must be low. As it is hardware inverted, we will want to set bit 3 of the
Control Register to '1'. However we don't want to upset any other bits on the Control Port.
We achieve this by reading the Control Port and Oaring 0x80 to it. E.g. out port
(CONTROL, in port b (CONTROL) | 0x08); this will only set bit 3.

After we place a data byte on the data lines, we must then signal to the LCD
module to read the data. This is done using the Enable line. Data is clocked into the LCD
module on the high to low transition. The Strobe is hardware inverted, thus by setting bit
0 of the Control Register we get a high to low transition on the Strobe line. We then wait
for a delay, and return the line to a high state ready for the next byte.

After we initialize the LCD Module, we want to send text to it. Characters are sent
to the LCD's Data Port, thus we want to clear bit 3. Once again we must only change the

Dept. Of ECE 32 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

one bit, thus we use out port b (CONTROL, in port b(CONTROL) & 0xF7);. Then we set
up another for loop to read a byte from the string and send it to the LCD panel. This is
repeated for the length of the string.

The delays should be suitable for most machines. If the LCD panel is not
initializing properly, you can try increasing the delays. Likewise if the panel is skipping
characters, e.g. Test, 2. On the other hand, if the LCD module is repeating characters e.g.
testing then you may have a faulting Enable connection. Check your Enable to Strobe
connection.

L293D MOTOR DRIVER IC:

Fig 4.10.1L293D IC Pin Diagram

Dept. Of ECE 33 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

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

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 solenoides, 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.

Dept. Of ECE 34 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

BLOCK DIAGRAM:

Fig: 4.10.2 Block Diagram of L293D

ABSOLUTE MAXIMUM RATINGS:

Dept. Of ECE 35 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

THERMAL DATA:

Symbol Description DIP SO Unit

Rth j-pins Thermal Resistance Junction-pins 14 C/W


max.

Rth j-amb Thermal Resistance junction-ambient 80 50(*) C/W


max.

TRUTH TABLE:

4.11 BUZZER

A buzzer or beeper is an audio signalling device, which may be mechanical,


electromechanical, or electronic. Typical uses of buzzers and beepers include alarms,
timers and confirmation of user input such as a mouse click or keystroke.

Dept. Of ECE 36 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

FEATURES
The PB series are high-performance buzzers with a unimorph piezoelectric ceramic
element and an integral self-excitation oscillator circuit.
They exhibit extremely low power consumption in comparison to electromagnetic units.
They are constructed without switching contacts to ensure long life and no electrical
noise.
Compact, yet produces high acoustic output with minimal voltage.

Mechanical

A joy buzzer is an example of a purely mechanical buzzer.

Electromechanical

Early devices were based on an electromechanical system identical to an electric


bell without the metal gong. Similarly, a relay may be connected to interrupt its own
actuating current, causing the contacts to buzz. Often these units were anchored to a wall
or ceiling to use it as a sounding board. The word "buzzer" comes from the rasping noise
that electromechanical buzzers made.

VOLTAGE BUZZER SOUND CONTROLS


When resistance is connected in series (as shown in illustrations (a) and (b)),
abnormal oscillation may occur when adjusting the sound volume. In this case, insert a
capacitor in parallel to the voltage oscillation board (as shown in illustration (c)). By
doing so, abnormal oscillation can be prevented by grounding one side. However, the
voltage VB added to the voltage oscillation board must be within the maximum input
voltage range, and as capacitance of 3.3F or greater should be connected.

Dept. Of ECE 37 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

A piezoelectric element may be driven by an oscillating electronic circuit or other


audio signal source. Sounds commonly used to indicate that a button has been pressed are
a click, a ring or a beep. Electronic buzzers find many applications in modern days.

Uses

Annunciator panels
Electronic metronomes
Game shows
Microwave ovens and other household appliances
Sporting events such as basketball games

Dept. Of ECE 38 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER 5

EXCECUTION DETAILS KEIL COMPILATION TOOL

5.1 INTRODUCTION TO MICRO VISION KEIL (IDE)

Keil is a cross compiler. So first we have to understand the concept of compilers and
cross compilers. After then we shall learn how to work with keil.

5.2 CONCEPT OF COMPILER:

Compilers are programs used to convert a High Level Language to object code. Desktop
compilers produce an output object code for the underlying microprocessor, but not for other
microprocessors. I.E the programs written in one of the HLL like C will compile the code
to run on the system for a particular processor like x86 (underlying microprocessor in the
computer). For example compilers for Dos platform is different from the Compilers for Unix
platform.

So if one wants to define a compiler then compiler is a program that translates source
code into object code. The compiler derives its name from the way it works, looking at the
entire piece of source code and collecting and reorganizing the instruction. See there is a bit
little difference between compiler and an interpreter. Interpreter just interprets whole
program at a time while compiler analyzes and execute each line of source code in
succession, without looking at the entire program.

The advantage of interpreters is that they can execute a program immediately. Secondly
programs produced by compilers run much faster than the same programs executed by an
interpreter. However compilers require some time before an executable program emerges.
Now as compilers translate source code into object code, which is unique for each type of
computer, many compilers are available for the same language.

Dept. Of ECE 39 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

5.3 CONCEPT OF CROSS COMPILER

A cross compiler is similar to the compilers but we write a program for the target
processor (like 8052 and its derivatives) on the host processors (like computer of x86).

It means being in one environment you are writing a code for another environment is
called cross development. And the compiler used for cross development is called cross
compiler.

So the definition of cross compiler is a compiler that runs on one computer but produces
object code for a different type of computer. Cross compilers are used to generate software
that can run on computers with a new architecture or on special-purpose devices that cannot
host their own compilers. Cross compilers are very popular for embedded development,
where the target probably couldn't run a compiler. Typically an embedded platform has
restricted RAM, no hard disk, and limited I/O capability. Code can be edited and compiled
on a fast host machine (such as a PC or Unix workstation) and the resulting executable code
can then be downloaded to the target to be tested. Cross compilers are beneficial whenever
the host machine has more resources (memory, disk, I/O etc) than the target. Keil C
Compiler is one such compiler that supports a huge number of host and target combinations.
It supports as a target to 8 bit microcontrollers like Atmel and Motorola etc.

The advantages of using cross compiler described as follows

By using this compilers not only can development of complex embedded systems be
completed in a fraction of the time, but reliability is improved, and maintenance is
easy.
Knowledge of the processor instruction set is not required.
A rudimentary knowledge of the 8052s memory architecture is desirable but not
necessary.
Register allocation and addressing mode details are managed by the compiler.
The ability to combine variable selection with specific operations improves program
readability.

Dept. Of ECE 40 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Keywords and operational functions that more nearly resemble the human thought
process can be used.
Program development and debugging times are dramatically reduced when compared
to assembly language programming.
The library files that are supplied provide many standard routines (such as formatted
output, data conversions, and floating-point arithmetic) that may be incorporated into
your application.
Existing routine can be reused in new programs by utilizing the modular
programming techniques available with C.
The C language is very portable and very popular. C compilers are available for
almost all target systems. Existing software investments can be quickly and easily
converted from or adapted to other processors or environments.

Now after going through the concept of compiler and cross compilers lets we start with
Keil C cross compiler.

5.4 KEIL C CROSS COMPILER:

Keil is a German based Software development company. It provides several


development tools like

IDE (Integrated Development environment)

Project Manager

Simulator

Debugger

C Cross Compiler, Cross Assembler, Locator/Linker

Keil Software provides you with software development tools for the ARM
microcontrollers. With these tools, you can generate embedded applications for the multitude
of ARM derivatives. Keil provides following tools for ARM development

Dept. Of ECE 41 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

1. ARM Optimizing C Cross Compiler,

2. Macro Assembler,

3. ARM Utilities (linker, object file converter, library manager),

4. Source-Level Debugger/Simulator,

5. Vision for Windows Integrated Development Environment.

The keil ARM tool kit includes three main tools, assembler, compiler and linker.

An assembler is used to assemble your ARM assembly program

A compiler is used to compile your C source code into an object file

A linker is used to create an absolute object module suitable for your in-circuit
emulator.

8052 project development cycle:

These are the steps to develop ARM project using keil

1. Create source files in C or assembly.


2. Compile or assemble source files.
3. Correct errors in source files.
4. Link object files from compiler and assembler.
5. Test linked application
5.5 PCB Wizard

PCB Wizard 3 is a highly innovative package for designing single-sided and


double sided printed circuit boards. It provides a comprehensive range of tools covering
all the traditional steps in PCB production, including schematic drawing, schematic
capture, component placement, automatic routing, and bill of materials reporting and files
generation for manufacturing.

Dept. Of ECE 42 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Designing circuit boards

PCB Wizard 3 is both easy to learn and easy to use. To design a circuit board,
simple drag and drop components onto your document and connect them together using
the intelligent writing tool. Then select the menu option convert to PCB and leave PCB
Wizard 3 to do the rest for you. If you want to simulate your design before turning it into
a circuit board, PCB Wizard 3 offers tight integration.

Component placing and automatic routing

Strategic component placement is critical to achieving successful routing and


PCB Wizard 3 has been greatly enhanced in this area. The process is now fully automated
and it is able to calculate an optimum board size for you and intelligently position
components in preparation for automatic routing.

5.6 Flash Magic

5.6.1 Introduction

Flash Magic is Windows software from the Embedded Systems Academy that
allows easy access to all the ISP features provided by the devices. These features include:

Erasing the Flash memory (individual blocks or the whole device)

Programming the Flash memory

Modifying the Boot Vector and Status Byte

Reading Flash memory

Performing a blank check on a section of Flash memory

Reading the signature bytes

Reading and writing the security bits

Direct load of a new baud rate (high speed communications)

Dept. Of ECE 43 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Sending commands to place device in Boot loader mode

Flash Magic provides a clear and simple user interface to these features and more
as described in the following sections. Under Windows, only one application may have
access the COM Port at any one time, preventing other applications from using the COM
Port. Flash Magic only obtains access to the selected COM Port when ISP operations are
being performed. This means that other applications that need to use the COM Port, such
as debugging tools, may be used while Flash Magic is loaded.

The screenshot of the main Flash Magic window is as shown in the figure. The
appearance may differ slightly depending on the device selected. It contains five blocks.
The five blocks are explained as follows:

5.6.2 Five Step Programming

Step 1 Connection Settings

Select the desired COM port from the drop down list or type the desired COM
port directly into the box. If you enter the COM port yourself then you must enter it in
one of the following formats:

COM n

Select the baud rate to connect at. Try a low speed first. The maximum speed that
can be used depends on the crystal frequency on your hardware.

Recommendation:

Try 9600 baud first. If it does not work or does


not work reliably then try 7200 baud.

Select the device being used from the drop down


list. Ensure you select the correct one as different
devices have different feature sets and different methods
of setting up the serial communications.

Dept. Of ECE 44 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Select the interface being used, if any. An interface is a device that connects
between your PC and the target hardware. If you simply have a serial cable or USB to
serial cable connecting your COM port to the target hardware, then chooses "None
(ISP)". Choosing the correct interface will automatically configure Flash Magic for that
interface, along with enabling and disabling the relevant features.

Enter the oscillator frequency used on the hardware. Do not round the frequency,
instead enter it as precisely as possible. Some devices do not require the oscillator
frequency to be entered, so this field will not be displayed.

Step 2 Erasing

This step is optional, however if you attempt to


program the device without first erasing at least one Flash
block, then Flash Magic will warn you and ask you if you
are sure you want to program the device. Select each
Flash block that you wish to erase by clicking on its name.
If you wish to erase all the Flash then check that option. If you want to erase a Flash
block and all the Flash then the Flash block will not be erased individually. If you wish to
erase only the Flash blocks used by the hex file you are going to select, then check that
option.

Step 3 Selecting the Hex File

This step is optional. If you do not wish to program a Hex File then do not select
one. You can either enter a path name in the text box or click on the Browse button to
select a Hex File by browsing to it. Also you can choose Open from the File menu.
Note that the Hex file is not loaded or cached in any way. This means that if the Hex File
is modified, you do not have to reselect it in Flash Magic. Every time the Hex File is
programmed it is first re-read from the location specified in the main window. This
information is updated whenever the hex file is modified

Dept. Of ECE 45 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Step 4 Options

This section is optional, however Verify


After Programming, Fill Unused Flash and Gen
Block Checksums may only be used if a Hex
File is selected (and therefore being
programmed), as they all need to know either
the Hex File contents or memory locations used
by the Hex File. Checking the Execute option will cause the downloaded firmware to be
executed automatically after the programming is complete. Note that this will not work if
using the Hardware Reset option or a device that does not support this feature.

Step 5 Performing the Operations

Clicking the Start button will result in all the selected operations in the main
window taking place. They will be in order:

Erasing Flash

Programming the Hex File

Verifying the Hex File

Filling Unused Flash Executing the firm

Dept. Of ECE 46 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

Figure 5.1 Flash Magic in Real Time

5.7 Programming Language

Programming language used in this project is C. C is a general purpose structured


programming language that is powerful, efficient and compact. It has emerged as the
language of choice for most applications due to speed, portability and compactness of
code. The C compiler combines the capabilities of an assembler language with the
features of high level language.

C is highly portable. This means that C programs written for one computer can be
on another with little or no modification. Portability is important if we plan to use a new
computer with a different operating system.

C language is well suited for structured programming thus requiring the user to
think of a problem in terms of function modules and blocks. A proper collection of these

Dept. Of ECE 47 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

modules make a complete program. This modular structure makes program debugging,
testing and maintenance easier.

Another important feature of C is its ability to extend itself. A C program is


basically a collection of functions that are supported by the C library. We can
continuously add our own functions to the C library. With the availability of a large
number of functions, the programming task becomes simple.

Program:

#include<reg52.h>

//P1^5,P1^6,P1^7 are connected to phases by converting r y b to dc 5v individually.

#include<stdio.h>

#include<string.h>

#define lcd_data P2

sbit lcd_rs = P2^0;

sbit lcd_en = P2^1;

sbit pir = P1^4;

sbit metal = P1^5;

sbit relay = P1^6;

sbit m1a = P1^0;

sbit m1b = P1^1;

sbit m2a = P1^2;

sbit m2b = P1^3;

sbit buzzer = P3^7;

Dept. Of ECE 48 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

unsigned convert(unsigned int);

unsigned convert1(unsigned int);

unsigned char chr='x',chr1='s',chr2='s';

void Edelay(unsigned int);

void delay(unsigned int v)

unsigned int i,j;

for(i=0;i<=v;i++)

for(j=0;j<=275;j++);

void MSDelay(unsigned int value)

unsigned int x,y;

for(x=0;x<1275;x++)

for(y=0;y<value;y++);

void lcdcmd(unsigned char value) // LCD COMMAND

lcd_data=value&(0xf0); //send msb 4 bits

lcd_rs=0; //select command register

lcd_en=1; //enable the lcd to execute command

Dept. Of ECE 49 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

delay(3);

lcd_en=0;

lcd_data=((value<<4)&(0xf0)); //send lsb 4 bits

lcd_rs=0; //select command register

lcd_en=1; //enable the lcd to execute command

delay(3);

lcd_en=0;

void lcd_init(void)

lcdcmd(0x02);

lcdcmd(0x02);

lcdcmd(0x28); //intialise the lcd in 4 bit mode*/

lcdcmd(0x28); //intialise the lcd in 4 bit mode*/

lcdcmd(0x0e); //cursor blinking

lcdcmd(0x06); //move the cursor to right side

lcdcmd(0x01); //clear the lcd

void lcddata(unsigned char value)

lcd_data=value&(0xf0); //send msb 4 bits

Dept. Of ECE 50 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

lcd_rs=1; //select data register

lcd_en=1; //enable the lcd to execute data

delay(3);

lcd_en=0;

lcd_data=((value<<4)&(0xf0)); //send lsb 4 bits

lcd_rs=1; //select data register

lcd_en=1; //enable the lcd to execute data

delay(3);

lcd_en=0;

delay(3);

void msgdisplay(unsigned char b[]) // send string to lcd

unsigned char s,count=0;

for(s=0;b[s]!='\0';s++)

count++;

if(s==16)

lcdcmd(0xc0);

if(s==32)

Dept. Of ECE 51 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

lcdcmd(1);

count=0;

lcddata(b[s]);

unsigned char rx()

unsigned char rx;

while(RI == 0);

rx=SBUF;

RI=0;

return rx;

void tx(unsigned char *tx)

// unsigned char v;

for(;*tx != '\0';tx++)

SBUF=*tx;

while(TI == 0);

Dept. Of ECE 52 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

TI=0;

//v= receive();

//delay(2);

void tx1(unsigned char tx)

// unsigned char v;

SBUF=tx;

while(TI == 0);

TI=0;

// v= receive();

// delay(2);

void okc()

unsigned char rr;

do{

rr = rx();

}while(rr != 'K');

Dept. Of ECE 53 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

void wifiinit()

//stringlcd(0x80,"Wifi Initilizing");

lcdcmd(1);lcdcmd(0x80);msgdisplay("Wifi Initializing");

tx("AT\r\n");

//okc();

delay(400);

tx("ATE0\r\n");

okc();

delay(400);

tx("AT+CWMODE=3\r\n");

delay(400);

// txs("AT+CWSAP=\"org_6327\",\"connectnow\",5,0\r\n"); //1st time enable after


disable

// delay(400);

tx("AT+CIPMUX=1\r\n");

delay(400);

tx("AT+CIPSERVER=1,23\r\n");

/*stringlcd(0x80,"WAITING FOR CONNCT");

stringlcd(0xC0,"org_6327");

*/

Dept. Of ECE 54 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

lcdcmd(1);lcdcmd(0x80);msgdisplay("Waiting for Connct");

lcdcmd(0xc0);msgdisplay("org_6547");

while(rx()!='L');

void sendwifi(unsigned char *chr,unsigned int length)

unsigned char temp[20];

tx("AT+CIPSEND=0,");

sprintf(temp,"%u",length);

tx(temp);

tx("\r\n");

while(rx()!='>');

delay(100);

tx(chr);

delay(400);

void sie()

//ET0 = 0;

ES = 1; /* allow serial interrupts */

EA = 1;

Dept. Of ECE 55 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

void sid()

//ET0 = 1;

ES = 0; /* allow serial interrupts */

EA = 0;

unsigned converts(unsigned int value)

unsigned char a,b,c,d;

a=value/100;

b=value%100;

c=b/10;

d=b%10;

a=a|0x30;

c=c|0x30;

d=d|0x30;

tx1(a);

tx1(c);

tx1(d);

return 1;

Dept. Of ECE 56 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

void main(void)

unsigned char robos='s';

P2=0xff;

pir=1;metal=1; relay=0;

m1a=m1b=0;

m2a=m2b=0;

buzzer=1;

lcd_init();

//Power grid monitoring and fault detection for distribution system using gsm&gps
technologiesPower grid monitoring and fault detection for distribution system using
gsm&gps technologies

msgdisplay("War field Robot"); //83

delay(800);

TMOD=0x20;

TH1=0xfd; //9600

SCON=0x50;

TR1=1;

wifiinit();

lcdcmd(1);

Dept. Of ECE 57 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

msgdisplay("CONNECTED");

delay(800);

lcdcmd(1);

msgdisplay("PIR:"); //0x84,5,6

lcdcmd(0xc0);

msgdisplay("Metal:");//0xc6,7,8

sie();

while(1)

if(pir == 0)

if(robos == 's')

lcdcmd(0x87);msgdisplay("ON "); buzzer=0;

tx("AT+CIPSEND=0,8\r\n"); delay(400);// while(rx()!='>');

tx("PIR ON\r\n"); delay(700); buzzer=1;

if(robos == 'm')

lcdcmd(0x87);msgdisplay("---");

Dept. Of ECE 58 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

if(pir == 1)

if(robos == 's')

lcdcmd(0x87);msgdisplay("OFF");

if(robos == 'm')

lcdcmd(0x87);msgdisplay("---");

if(metal == 1)

lcdcmd(0xc6);msgdisplay("ON "); buzzer=0;

tx("AT+CIPSEND=0,10\r\n"); delay(400);

tx("Metal ON\r\n"); delay(700);

buzzer=1;

if(metal == 0)

Dept. Of ECE 59 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

lcdcmd(0xc6);msgdisplay("OFF");

if(chr1 == 'f')

//chr1='x';

robos='m';

m1a=1;m1b=0;

m2a=1;m2b=0;

if(chr1 == 'b')

//chr1='x';

robos='m';

m1a=0;m1b=1;

m2a=0;m2b=1;

if(chr1 == 'l')

{ //chr1='x';

robos='m';

m1a=1;m1b=0;

m2a=0;m2b=1;

Dept. Of ECE 60 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

if(chr1 == 'r')

{ //chr1='x';

robos='m';

m1a=0;m1b=1;

m2a=1;m2b=0;

if(chr1 == 's')

{ //chr1='x';

robos='s';

m1a=0;m1b=0;

m2a=0;m2b=0;

if(chr2 == '1')

{chr2='x';

relay=1; lcdcmd(0xcc);msgdisplay("Lon ");

if(chr2 == '0')

{chr2='x';

relay=0; lcdcmd(0xcc);msgdisplay("Loff");

Dept. Of ECE 61 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

unsigned convert(unsigned int value)

unsigned int a,b,c,d,e,f,g,h;

a=value/10000;

b=value%10000;

c=b/1000;

d=b%1000;

e=d/100;

f=d%100;

g=f/10;

h=f%10;

a=a|0x30;

c=c|0x30;

e=e|0x30;

g=g|0x30;

h=h|0x30;

// lcddata(a);

// lcddata(c);

Dept. Of ECE 62 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

lcddata(e); lcddata(g);lcddata(h);//lcddata(' ');lcddata(' ');

return 1;

unsigned convert1(unsigned int value)

unsigned int a,b,c,d,e,f,g,h;

a=value/10000;

b=value%10000;

c=b/1000;

d=b%1000;

e=d/100;

f=d%100;

g=f/10;

h=f%10;

a=a|0x30;

c=c|0x30;

e=e|0x30;

g=g|0x30;

h=h|0x30;

tx1(a);

tx1(c);

Dept. Of ECE 63 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

tx1(e); tx1(g);tx1(h);//lcddata(' ');lcddata(' ');

return 1;

void serial_int (void) interrupt 4

if (RI == 1)

chr = SBUF;

RI = 0;

if(chr == '*')

chr1 = rx();

if(chr == '#')

chr2 = rx();

Dept. Of ECE 64 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-6

ADVANTAGES & APPLICATIONS

Advantages

1) Wirelessly send audio/video information.

2) Work in hazardous/dangerous environment.

3) Streaming of Video without visible light.

4) Work efficiently for long distance.

5) Moveable Camera.

Applications

1) In military and police department.

2) Disaster affected area surveillance and general surveillance.

3) Search and rescue operation.

4) Maneuvering in hazardous environment.

5) Wireless security and surveillance in hot spots.

6) In Mines at high radiation situations where its threatening for a human presence.

Dept. Of ECE 65 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-7

FUTURE SCOPE

We can connect this system directly to internet by using zigbee with Wi-Fi. By using
internet we can control the system via remote location. We do not require any simulation tool
by using GUI software. Halogen light can be used for the vision of the robot. We can also
control the device by giving it voice command thereby making it a voice recognition system.

Dept. Of ECE 66 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-8

CONCLUSION

The primary need for our paper would be accuracy. We have been able to view
the things accurately that are currently happening in the surrounding area. Our design has
not caused any sort of disturbances. The robot will move depending on the motor
direction based upon the input we give through command by remote section unit. It
display the current operation is going on as example left robot, near to object, clear up.
With the help of the camera we are able to view the things that are happening in the
surrounding area where the robot is hidden. By keeping the circuit easy and simple, most
users will be able to use it easily. Thus we should be able to manipulate its path when
necessary, to create the robot safely. To all that, a control unit is needed, where control
units RF signal is used. By using these signals encoding is done & signal is sent through
the transmitter. At the receiver end these decoded signal are given as input to drive the
motor.

Dept. Of ECE 67 AKITS


WAR FIELD SPYING ROBOT WITH HUMAN DETECTION

CHAPTER-9

BIBLIOGRAPHY

[1] Robert L Boylestad and Louis Nashelsky, Electronic Device And Circuit Theory
,8th edition 2006.

[2] Mr Lokesh Mehta, Mr. Pawan Sharma Spy Night Vision Robot with Moving
Wireless Video Camera. International journal of research in engineering technology and
management (IJRETM), 2014.

[3] The 8051 microcontroller and embedded system using assembly and C, 2nd edition
(ISBN: 9780131194021) by Mazidi Muhammad Ali (2008).

[4] Dhiraj Singh Patel Mobile Operated Spy Robot International journal of emerging
technology and advanced engineering (IJETAE), 2013.

WEBSITES:

1. http://www.8051projects.com/
2. http://www.scribd.com/

Dept. Of ECE 68 AKITS

You might also like