You are on page 1of 53

HITECH ROBOT WITH CAMERA FOR BOMB SQUAD

CONTENTS
1. ABSTRACT
2. SCHEMATIC DIAGRAM
3. CIRCUIT DESCRIPTION
4. INTRODUCTION
4.1. INTRODUCTION TO EMBEDDED SYSTEMS
4.2. MICROCONTROLLER INTRODUCTION
4.3. KEIL MICRO VISION COMPILER
5. COMPONENT DESCRIPTION
5.1. AT89S52
5.2 LCD
5.3. MEAL SENSOR
5.4. ZIGBEE
5.5. MOTORS
5.6. MAX23
5.7. L293D
5.8. CAMERA
6. CODING
7. REFERENCE

1. ABSTRACT
A cost effective ZigBee-based wireless mine supervising system is presented in this
article. This scheme used intelligent helmets as voice terminal and ultra-low-power
nodes of wireless sensor network. The program adopted ZigBee wireless technology to
build wireless sensor networks, realized real-time surveillance with early-warning
intelligence on methane, temperature, humidity in mining area, and used speech
communication to reduce potential safety problems in coal production.
The ranges of electromagnetic frequencies are above the audio range and below visible
light. All broadcast transmission, from AM radio to satellites, falls into this range.
Radio Frequency (RF) itself has become synonymous with wireless and highfrequency signals, describing anything from AM radio from 535 kHz to 1605 kHz to
computer LANs at 2.4 GHz. However, Radio Frequency has traditionally defined
frequencies from a few kHz to ~ 1 GHz with Microwave being the consideration.
In this prototype project we fix wireless camera to the robot. Which is used to get audio
and video and also we can control the direction of the robot as we are in a need.
In this way this projects is useful for various like space, Industries, etc, and also
Discover that robots are capable of planning their own actions. Different situations and
tasks will be presented allowing you to explore the advantages of robots in terms of
efficiency, accuracy, and safety. In this prototype we can send the command from the PC
through Zigbee, these commands are received by the Zigbee receiver which is interfaced
to the MC. Based on Command received the MC control the ROBO direction by giving
the signals to the motors.

BLOCK DIAGRAM:
TRANSMITTER:

METAL
SENSOR

LCD

MICRO
CONTROLLER

Xbee
TX

RF CAM
MOTORS

RECEIVER:

Xbee
Rx

PC

RF CAM RECEIVER

2. SCHEMATIC DIAGRAM

3. CIRCUIT DESCRIPTION
Since the main intension of this project is to design Hitech Robot With Camera For
Bomb Squad.
Imagine the world without coal, copper, uranium, iron-ore, gold and aluminum. We
would have been in the era of early man even by now without these resources. All
these metals as we use them or know them are extracted from the ores. The ores are
naturally occurring minerals often buried deep inside the earth. These minerals are
available to us because of the hard work put in by thousands of people working in the
Mines. But have you ever thought of the kind of situation they work in? The reality is
mind boggling.

Hundreds of people die every year in the mines due to lack of safety measures.
Workers who work in the mines are always at a risk of death. The environment inside
the mine is very difficult and apart from risk of losing lives, their exposure to harmful
substances and the high probability of getting severe diseases is almost inevitable. An
average labor working inJharia( Dhanbad, India) in the coal mines get paid at barely
Rs. 50 per bori (15-20 kg) of coal that he mines out. Many children are also made to
work in those terrible conditions for free. And all this happens at the expense of their
lives and risk of getting dreadful diseases. Astonishingly, things have been so terrible
from the past few decades. Is it fair enough? Can human life be so cheap? Why cannot
we change this deadly scenario?
Thousands of people have lost their lives in Mines till date. History tells us about some
huge mine disasters that have happened all around the world. Although, some of the
disasters were not due to human mistakes but surely a consequence of mine safety
measures. Why cannot we have better technology for mine safety issues?
Advancements in technology are already taking at enormous rate, every day we come
across some new gadget, services and applications being launched. Unfortunately, the
uptake of technology is slow in the mining sector. So, why advancements in
technology for Mine safety should be left out in a corner?

In order to fulfill this application there are few steps that has been performed i.e.
1) Designing the power supply for the entire circuitry.
2) Selection of microcontroller that suits our application.
3) Selection of sensors.
3.1. POWER SUPPLY SECTION:
In-order to work with any components basic requirement is power supply. In this
section there is a requirement of 5V power supply. Now the aim is to design the power
supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to
reduce it to directly 5V DC, therefore we need a step-down transformer that reduces
the line voltage to certain voltage that will help us to convert it in to a 5V DC.
Considering the efficiency factor of the bridge rectifier, we came to a conclusion to
choose a transformer, whose secondary voltage is 3 to 4 V higher than the required
voltage i.e. 5V. For this application 0-9V transformers is used, since it is easily
available in the market.
The output of the transformer is 9V AC; it feed to rectifier that converts AC to
pulsating DC. As we all know that there are 3 kind of rectifiers that is
1) half wave
2) Full wave and
3) Bridge rectifier
Here we short listed to use Bridge rectifier, because half wave rectifier has we less in
efficiency. Even though the efficiency of full wave and bridge rectifier are the same,
since there is no requirement for any negative voltage for our application, we gone
with bridge rectifier.
Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure
DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter.

The most easy way to regulate this voltage is by using a 7805 voltage regulator, whose
output voltage is constant 5V DC irrespective of any fluctuation in line voltage.
3.2. SELECTION OF MICROCONTROLLER
As we know that there so many types of micro controller families that are available in
the market. Those are
1) 8051 Family
2) AVR microcontroller Family
3) PIC microcontroller Family
4) ARM Family
Basic 8051 family is enough for our application; hence we are not concentrating on
higher end controller families. In order to fulfill our application basic that is AT89C51
controller is enough. But still we selected AT89S52 controller because of inbuilt ISP
(in system programmer) option.
3.3 SENSORS SELECTION:
Here sensors are used to read the any physical parameter conditions and converts
physical parameter conditions into voltage. For demonstration purpose we mainly
concentrated on temperature and smoke sensors.
SELECTION OF ZIGBEE:
As per RF communication basic RF modules works on 434MHz frequency. Based on
this frequency we are not able to transmit the data from transmitter to receiver with
proper synchronization. To overcome this problem we are using XBee modules as a
RF. These XBee modules works on 2.4GHz frequency, which is more than the basic
RF module frequency. By using these XBee modules we can transmit data for long
distances as compared to basic RF modules. This XBee module works as a transceiver
i.e. it is connected at both transmitter as well as receiver. For this application we are
using the XBee modules either transmitter or receiver.

3.4 CIRCUIT CONNECTION


1. Motors are connected through the P2 though the L293D;
2. Zigbee is interfaced to the Serial Port of Micro controller
through the MAX232 Level Shifter.
3. Sensors are interfaced through the ADC
3.5 CIRCUIT OPERATION:
In this prototype we can send the command from the PC through Zigbee, these
commands are received by the Zigbee receiver which is interfaced to the MC. Based on
Command received the MC control the ROBO direction by giving the signals to the
motors.

4. INTRODUCTION
4.1. INTRODUCTION TO EMBEDDED SYSTEMS
Embedded systems are electronic devices that incorporate microprocessors with in
their implementations. The main purposes of the microprocessors are to simplify the
system design and provide flexibility. Having a microprocessor in the device helps in
removing the bugs, making modifications, or adding new features are only matter of
rewriting the software that controls the device. Or in other words embedded computer
systems are electronic systems that include a microcomputer to perform a specific
dedicated application. The computer is hidden inside these products. Embedded
systems are ubiquitous. Every week millions of tiny computer chips come pouring out
of factories finding their way into our everyday products.

Embedded systems are self-contained programs that are embedded within a piece of
hardware. Whereas a regular computer has many different applications and software
that can be applied to various tasks, embedded systems are usually set to a specific
task that cannot be altered without physically manipulating the circuitry. Another way
to think of an embedded system is as a computer system that is created with optimal
efficiency, thereby allowing it to complete specific functions as quickly as possible.

Embedded systems designers usually have a significant grasp of hardware


technologies. They use specific programming languages and software to develop
embedded systems and manipulate the equipment. When searching online, companies
offer embedded systems development kits and other embedded systems tools for use
by engineers and businesses.

Embedded systems technologies are usually fairly expensive due to the necessary
development time and built in efficiencies, but they are also highly valued in specific
industries. Smaller businesses may wish to hire a consultant to determine what sort of
embedded systems will add value to their organization.

CHARACTERISTICS:
Two major areas of differences are cost and power consumption. Since many
embedded systems are produced in tens of thousands to millions of units range,
reducing cost is a major concern. Embedded systems often use a (relatively) slow
processor and small memory size to minimize costs.

The slowness is not just clock speed. The whole architecture of the computer is often
intentionally simplified to lower costs. For example, embedded systems often use
peripherals controlled by synchronous serial interfaces, which are ten to hundreds of
times slower than comparable peripherals used in PCs. Programs on an embedded
system often run with real-time constraints with limited hardware resources: often
there is no disk drive, operating system, keyboard or screen. A flash drive may replace
rotating media, and a small keypad and LCD screen may be used instead of a PC's
keyboard and screen.

Firmware is the name for software that is embedded in hardware devices, e.g. in one or
more ROM/Flash memory IC chips. Embedded systems are routinely expected to
maintain 100% reliability while running continuously for long periods, sometimes
measured in years. Firmware is usually developed and tested too much harsher
requirements than is general-purpose software, which can usually be easily restarted if
a problem occurs.

PLATFORM:
There are many different CPU architectures used in embedded designs. This in
contrast to the desktop computer market which is limited to just a few competing
architectures mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PCs
which are used in the Apple Macintosh. One common configuration for embedded

systems is the system on a chip, an application-specific integrated circuit, for which


the CPU was purchased as intellectual property to add to the IC's design.

TOOLS:
Like a typical computer programmer, embedded system designers use compilers,
assemblers and debuggers to develop an embedded system. Those software tools can
come from several sources:

OPERATING SYSTEM:
They often have no operating system, or a specialized embedded operating system
(often a real-time operating system), or the programmer is assigned to port one of
these to the new system.

DEBUGGING:
Debugging is usually performed with an in-circuit emulator, or some type of debugger
that can interrupt the micro controllers internal microcode. The microcode interrupt
lets the debugger operate in hardware in which only the CPU works. The CPU-based
debugger can be used to test and debug the electronics of the computer from the
viewpoint of the CPU.
DESIGN OF EMBEDDED SYSTEMS:
The electronics usually uses either a microprocessor or a microcontroller. Some large
or old systems use general-purpose mainframes computers or minicomputers.

All embedded systems have start-up code. Usually it disables interrupts, sets up the
electronics, tests the computer (RAM, CPU and software), and then starts the
application code. Many embedded systems recover from short-term power failures by

restarting (without recent self-tests). Restart times under a tenth of a second are
common.
Many designers have found one of more hardware plus software-controlled LEDs
useful to indicate errors during development (and in some instances, after product
release, to produce troubleshooting diagnostics). A common scheme is to have the
electronics turn off the LED(s) at reset, whereupon the software turns it on at the first
opportunity, to prove that the hardware and start-up software have performed their job
so far. After that, the software blinks the LED(s) or sets up light patterns during normal
operation, to indicate program execution progress and/or errors. This serves to reassure
most technicians/engineers and some users.

4.2 INTRODUCTION TO MICROCONTROLLER


Microcontrollers as the name suggests are small controllers. They are like single chip
computers

that

are

often

embedded

into

other

systems

to

function

as

processing/controlling unit. For example the remote control you are using probably
has microcontrollers inside that do decoding and other controlling functions. They are
also used in automobiles, washing machines, microwave ovens, toys ... etc, where
automation is needed.
Micro-controllers are useful to the extent that they communicate with other devices,
such as sensors, motors, switches, keypads, displays, memory and even other microcontrollers. Many interface methods have been developed over the years to solve the
complex problem of balancing circuit design criteria such as features, cost, size,
weight, power consumption, reliability, availability, manufacturability. Many
microcontroller designs typically mix multiple interfacing methods. In a very
simplistic form, a micro-controller system can be viewed as a system that reads from
(monitors) inputs, performs processing and writes to (controls) outputs.
Embedded system means the processor is embedded into the required application. An
embedded product uses a microprocessor or microcontroller to do one task only. In an
embedded system, there is only one application software that is typically burned into
ROM. Example: printer, keyboard, video game player
Microprocessor - A single chip that contains the CPU or most of the computer
Microcontroller - A single chip used to control other devices
Microcontroller differs from a microprocessor in many ways. First and the most
important is its functionality. In order for a microprocessor to be used, other
components such as memory, or components for receiving and sending data must be
added to it. In short that means that microprocessor is the very heart of the computer.
On the other hand, microcontroller is designed to be all of that in one. No other

external components are needed for its application because all necessary peripherals
are already built into it. Thus, we save the time and space needed to construct devices.
MICROPROCESSOR VS MICROCONTROLLER
Microprocessor:

CPU is stand-alone, RAM, ROM, I/O, timer are separate

Designer can decide on the amount of ROM, RAM and I/O ports.

expensive

versatility general-purpose

Microcontroller:

CPU, RAM, ROM, I/O and timer are all on a single chip

fix amount of on-chip ROM, RAM, I/O ports

for applications in which cost, power and space are critical

single-purpose

4.3 KEIL MICRO VISION COMPILER


Many companies provide the 8051 assembler, some of them provide shareware version
of their product on the Web, Kiel is one of them. We can download them from their
Websites. However, the size of code for these shareware versions is limited and we
have to consider which assembler is suitable for our application.
KIEL U VISION2
This is an IDE (Integrated Development Environment) that helps you write, compile,
and debug embedded programs. It encapsulates the following components:
.

A project manager

A make facility

Tool configuration

Editor

A powerful debugger

To get start here are some several example programs


LIMITATIONS OF EVALUATION SOFTWARE
The following limitations apply to the evaluation versions of the C51, C251, or C166
tool chains. C51 Evaluation Software Limitations:
1. The compiler, assembler, linker, and debugger are limited to 2 Kbytes of object
code but source Code may be any size. Programs that generate more than 2
Kbytes of object code will not compile, assemble, or link the startup code
generated includes LJMP's and cannot be used in single-chip devices
supporting Less than 2 Kbytes of program space like the Philips 750/751/752.
2. The debugger supports files that are 2 Kbytes and smaller.
3. Programs begin at offset 0x0800 and cannot be programmed into single-chip
devices
4. No hardware support is available for multiple DPTR registers.
5. No support is available for user libraries or floating-point arithmetic.

PERIPHERAL SIMULATION:
The u vision2 debugger provides complete simulation for the CPU and on chip
peripherals of most embedded devices. To discover which peripherals of a device are
supported, in u vision2. Select the Simulated Peripherals item from the Help menu.
You may also use the web-based device database. We are constantly adding new
devices and simulation support for on-chip peripherals so be sure to check Device
Database often.

5. COMPONENT DESCRIPTION
5.1. MICROCONTROLLER 89S52
FEATURES:
8K Bytes of In-System Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
Fully Static Operation: 0 Hz to 24 MHz
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Programmable Serial Channel
Low-power Idle and Power-down Modes
DESCRIPTION:
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with
8Kbytes of Flash programmable and erasable read only memory (PEROM). The onchip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU
with Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer,
which provides a highly flexible and cost-effective solution to many embedded control
applications.

PIN DIAGRAM - AT89S52:

PIN DESCRIPTION:
VCC - Supply voltage.
GND - Ground.
Port 0:
Port 0 is an 8-bit open drain bi-directional 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 highimpedance 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 bi-directional 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 (I IL) 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.
Port 2:
Port 2 is an 8-bit bi-directional 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 (I IL) 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 pullups
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 bi-directional 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 (I IL) because of the pullups. Port 3
also serves the functions of various special features of the AT89C51. Port 3 also
receives some control signals for Flash programming and verification.
PORT3 ALTERNATE FUNCTIONS:
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe).
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG:
Address Latch Enable is an output pulse for latching the low byte of the address during
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.
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.
PSEN:
Program Store Enable is the read strobe to external program memory. When the
AT89C52 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.

EA/VPP:
External Access Enable (EA) must be strapped to GND in order to enable the device to
fetch code from external pro-gram memory locations starting at 0000H up to FFFFH.
However, 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
12V programming enable voltage (VPP) during Flash programming when 12V
programming is selected.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
It is an output from the inverting oscillator amplifier.

BLOCK DIAGRAM OF 89S52:


EXTERNAL
INTERRUPTS
INTERRUPT
CONTROL

ON-CHIP
ROM FOR
PROGRAM
CODE

ONCHIP
RAM

TIMER/CO
UNTER

TIMER 1
TIMER 0

CPU

OSC

BUS
CONTROL

4 I/O
PORTS

P0 P1 P2 P3

SERIAL
PORT

Tx

Rx

COUNTER
INPUTS

ARCHITECHTURE OF 8052 MICROCONTROLLER:

Architecture of 89S52

OSCILLATOR CHARACTERISTICS:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier,
which can be configured for use as an on-chip oscillator. 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. 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.
IDLE MODE:
In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain
active. The mode is invoked by software. The content of the on-chip RAM and all the
special functions registers remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset. It should be noted that
when idle is terminated by a hardware reset, the device normally resumes program
execution, from where it left off, up to two machine cycles before the internal reset
algorithm takes control. On-chip hardware inhibits access to internal RAM in this
event, but access to the port pins is not inhibited. To eliminate the possibility of an
unexpected write to a port pin when Idle is terminated by reset, the instruction
following the one that invokes Idle should not be one that writes to a port pin or to
external memory.
OSCILLATOR CONNECTIONS:

Note: C1, C2 = 30 pF 10 pF for Crystals

5.2 INTRODUCTION TO LIQUID CRYSTAL DISPLAY (LCD)


Liquid crystal display is a type of display which used in digital watches and many
portable computers. LCD displays utilize two sheets of polarizing material with a
liquid crystal solution between them. An electric current passed through the liquid
causes the crystals to align so that light cannot pass through them. Each crystal,
therefore, is like a shutter, either allowing light to pass through or blocking the light.
The liquid crystals can be manipulated through an applied electric voltage so that light
is allowed to pass or is blocked. By carefully controlling where and what wavelength
(color) of light is allowed to pass, the LCD monitor is able to display images. A back
light provides LCD monitors brightness.

Other advances have allowed LCDs to greatly reduce liquid crystal cell response
times. Response time is basically the amount of time it takes for a pixel to change
colors. In reality response time is the amount of time it takes a liquid crystal cell to go
from being active to inactive.
They make complicated equipment easier to operate. LCDs come in many shapes and
sizes but the most common is the 16 character x 4 line (16x4) display with no
backlight. It requires only 11 connections eight bits for data (which can be reduced
to four if necessary) and three control lines (we have only used two here). It runs off a
5V DC supply and only needs about 1mA of current. The display contrast can be
varied by changing the voltage into pin 3 of the display,
PIN DESCRIPTION OF LCD:

From this description, the interface is a parallel bus, allowing simple and fast
reading/writing of data to and from the LCD. This waveform will write an ASCII Byte
out to the LCD's screen.
PIN DESCRIPTIONS:
VCC, VSS and VEE:
While VCC and VSS provide +5V and ground respectively, VEE is used for
controlling LCD contrast.
PIN

SYMBOL

I/O

DESCRIPTION

1
2
3

VSS
VCC
VEE

----

Ground
+5V power supply
Power supply to

control contrast
RS=0
to
select

RS

command register
RS=1 to select data
5

R/W

register
R/W=0 for write

6
7
8
9
10
11
12
13
14

EN
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7

I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O

R/W=1 for read


Enable
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus

The three control lines are referred to as EN, RS, and RW.
EN: The EN line is called "Enable". This control line is used to tell the LCD that you
are sending it data. To send data to the LCD, your program should first set this line
high (1) and then set the other two control lines and/or put data on the data bus. When
the other lines are completely ready, bring EN low (0) again. The 1-0 transition tells

the 44780 to take the data currently found on the other control lines and on the data
bus and to treat it as a command.
RS: The RS line is the "Register Select" line. When RS is low (0), the data is to be
treated as a command or special instruction (such as clear screen, position cursor, etc.).
When RS is high (1), the data that is sent is a text data which should be displayed on
the screen. For example, to display the letter "T" on the screen you would set RS high.
RW: The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD
status") is a read command. All others are write commands, so RW will almost be low.
ADVANTAGES:
LCD interfacing with 8051 is a real-world application. In recent years the LCD is
finding widespread use replacing LEDs (seven segment LEDs or other multi segment
LEDs).
This is due to following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters. An intelligent LCD displays two
lines, 20 characters per line, which is interfaced to the 8051.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU to
keep displaying the data.
4. Ease of programming for characters and graphics.

BASIC COMMANDS OF LCD:

When LCD is powered up the display should show a series of dark squares, possibly
only on part of display. These characters are actually in their off state, so the contrast
control should be adjusted anti-clockwise until the squares are just visible.
The display module resets itself to an initial state when power is applied, which
curiously the display has blanked off so that even if characters are entered, they cannot
be seen. It is therefore necessary to issue a command at this point, to switch the
display on.
CODE (Hex)
REGISTER

COMMAND TO LCD INTRODUCTION

CLEAR DISPLAY SCREEN


RETURN HOME
DECREMENT CURSOR (SHIFT CURSOR TO LEFT)
INCREMENT CURSOR (SHIFT CURSOR TO RIGHT)
SHIFT DISPLAY RIGHT
SHIFT DISPLAY LEFT
DISLAY OFF, CURSOR OFF
A

DISPLAY OFF, CURSOR ON

DISPLAY ON, CURSOR OFF

DISPLAY ON, CURSOR BLINKING

DISPLAY ON, CURSOR BLINKING

10

SHIFT CURSOR POSITION TO LEFT

14

SHIFT CURSOR POSITION TO RIGHT

18

SHIFT THE ENTIRE DISPLAY TO THE LEFT

1C

SHIFT THE ENTIRE DISPLAY TO THE RIGHT

FORCE CURSOR TO BEGINNING OF 1ST LINE


CIRCUIT DESCRIPTION OF LCD EXPERIMENT:
C0
FORCE CURSOR TO BEGINNING OF 2ND LINE
38

2 LINES AND 5x7 MATRIX


The circuit can be wired up on a plug-in-style prototyping board, using

dual-in-line switches for the data lines (S1-S8). A toggle switch for the RS input (S10)
and a momentary action switch (or macro switch) for usage.

Most of the LCD modules conform to a standard interface specification. A


14pin access is provided having eight data lines, three control lines and three power
lines. The connections are laid out in one of the two common configurations, either
two rows of seven pins, or a single row of 14 pins.
One of the, pins are numbered on the LCDs print circuit board (PCB), but if not, it is
quite easy to locate pin1. Since this pin is connected to ground, it often has a thicker
PCB track, connected to it, and it is generally connected to metalwork at same point.

07

D0

08

D1

09

11

12

10

D2

+5V

D3

D4

-5v

13

D5

14

D6

D7

RS

R/W EN

The LCD plays a major role in the entire operation as it has the ability to display the
certain data that the user has entitled. LCD display varies from input to input as there
is no specific outline for it to operate.

5.3 METAL DETECTOR

The simplest form of a metal detector consists of an oscillator producing an alternating


current that passes through a coil producing an alternating magnetic field. If a piece of
electrically conductive metal is close to the coil, eddy currents will be induced in the
metal, and this produces an alternating magnetic field of its own. If another coil is used
to measure the magnetic field (acting as a magnetometer), the change in the magnetic
field due to the metallic object can be detected.

A proximity sensor is a sensor able to detect the presence of nearby objects without
any physical contact.A proximity sensor often emits
an electromagnetic or electrostatic field, or a beam of electromagnetic
radiation (infrared, for instance), and looks for changes in the field or return signal.
The object being sensed is often referred to as the proximity sensor's target. Different
proximity sensor targets demand different sensors. For example,
a capacitive or photoelectric sensor might be suitable for a plastic target;
an inductive proximity sensor requires a metal target.

5.4 ZIGBEE

ZigBee is a software-based protocol that sits on top of the 802.11 RF wireless devices
standard similar to Bluetooth. Unlike Bluetooth, ZigBee is capable of forming large
networks of nodes and boasts advanced features such as mesh networking, simple
addressing structures, route detection, route repair, guaranteed delivery and low power
operation modes.
ZigBee provides a transparent layer for sending and receiving data from the network.
Therefore once the module has been configured and assigned to the correct address
then sending and receiving data is as simple as sending and receiving RS232 bytes
through the chips UART.

ZigBee is the name of a specification for a suite of high level communication protocols
using small, low-power digital radios based on the IEEE 802.15.4-2006 standard for
wireless personal area networks (WPAN), such as wireless headphones connecting
with cell phones via short-range radio. The technology is intended to be simpler and
less expensive than other WPAN, such as Bluetooth. ZigBee is targeted at radiofrequency (RF) applications that require a low data rate, long battery life, and secure
networking.
ZigBee is a low-cost, low-power, wireless mesh networking standard. The low cost
allows the technology to be widely deployed in wireless control and monitoring
applications, the low power-usage allows longer life with smaller batteries, and the
mesh networking provides high reliability and larger range.

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 generalpurpose, 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.
Typical application areas include

Home Entertainment and Control Smart lighting, advanced temperature


control, safety and security, movies and music

Home Awareness Water sensors, power sensors, smoke and fire detectors,
smart appliances and access sensors

Mobile Services m-payment, m-monitoring and control, m-security and


access control, m-healthcare and tele-assist

Commercial Building Energy monitoring, HVAC, lighting, access control

Industrial Plant Process control, asset management, environmental


management, energy management, industrial device control

FEATURES:

ZigBee Wireless communications

Flow code macros available

Compatible with global RF standards

Onboard ZigBee module

Status LED

Full 2007 ZigBee Pro / ZNET compliance

128-bit AES Encryption

Range of approx 100m per node

XBee OPERATION:

The ZigBee boards use a XBEE module to interface to the ZigBee network. The V2
XBEE modules come in two varieties. One is configured to be the ZigBee network
coordinator (EB051C) and the other is configured to be either a router node or an end
device node (EB051R). Coordinator nodes are responsible for creating the ZigBee
network and allowing other ZigBee nodes to join. Only one coordinator node can exist
on any single network. Router nodes are responsible for routing signals to other
routers or to end nodes. End device nodes are responsible for collecting or depositing
real world data to and from the ZigBee network.
The Coordinator node and Router nodes are capable of handling up to eight children
devices. The children devices can consist of either other Router nodes or End device
nodes. If an End device node is configured to sleep then the parent device associated
for that node will be responsible for buffering any incoming data. Therefore if you are
using sleeping End devices you must make sure to poll the parent for data every time
the device comes out of sleep mode.
POWER REQUIREMENTS:
Series 1 (XBee / XBee-PRO):
Supply voltage: 2.8 3.4 VDC /2.8 3.4 VDC
Transmit current (@ 3.3 V):45 mA / 215 mA
Receive current (@ 3.3 V):50 mA / 55 mA
Power-down current :< 10 uA / <10 Ua
Series 2 (XBee):
Supply voltage: 2.1 3.6 VDC
Transmit current (@ 3.3 V): 35 mA (40 mA boost mode)
Receive current (@ 3.3 V): 38 mA (40 mA boost mode)
Power-down current: <1 uA (@ 25 C)
PERFORMANCE:

GENERAL:
RF data rate: 250 Kbps
Operating temperature: -40 C to 85 C (-40 F to 185 F)
Series 1 (XBee / XBee-PRO)
Indoor/Urban range: 100 ft (30 m) / 300 ft (90 m)
Outdoor/RF line-of-sight range: 300 ft (90 m) / 1 mi (1.6 km)
Transmit power output: 1 mW (0 dBm) / 60 mW (+18 dBm)
Series 2 (XBee)
Indoor/Urban range: 133 ft (40 m)
Outdoor/RF line-of-sight range: 400 ft (120 m)
Transmit power output: 1.25 mW (+1 dBm) (2 mW (+3 dBm)
boost mode)
Receiver sensitivity (1% PER): -97 dBm (-98 dBm boost
mode)

5.5 DC MOTOR
A DC motor is designed to run on DC electric power. Two examples of pure DC
designs are Michael Faraday's homopolar motor (which is uncommon), and the ball
bearin motor, which is (so far) a novelty. By far the most common DC motor types are
the brushed and brushless types, which use internal and external commutation
respectively to create an oscillating AC current from the DC source -- so they are not
purely DC machines in a strict sense.

Types of dcmotors:
1. Brushed DC Motors
2. Brushless DC motors
3. Coreless DC motors
Brushed DC motors:
The classic DC motor design generates an oscillating current in a wound rotor with a
split ring commutator, and either a wound or permanent magnet stator. A rotor consists
of a coil wound around a rotor which is then powered by any type of battery.

Many of the limitations of the classic commutator DC motor are due to the need for
brushes to press against the commutator. This creates friction. At higher speeds,
brushes have increasing difficulty in maintaining contact. Brushes may bounce off the
irregularities in the commutator surface, creating sparks. This limits the maximum
speed of the machine. The current density per unit area of the brushes limits the output
of the motor. The imperfect electric contact also causes electrical noise. Brushes
eventually wear out and require replacement, and the commutator itself is subject to
wear and maintenance. The commutator assembly on a large machine is a costly
element, requiring precision assembly of many parts. there are three types of dc motor
1. dc series motor 2. dc shunt motor 3. dc compound motor - these are also two type a.
cummulative compound b. deffercial compounnd
Brushless DC motors:
Some of the problems of the brushed DC motor are eliminated in the brushless design.
In this motor, the mechanical "rotating switch" or commutator/brushgear assembly is
replaced by an external electronic switch synchronised to the rotor's position.
Brushless motors are typically 85-90% efficient, whereas DC motors with brushgear
are typically 75-80% efficient.
Midway between ordinary DC motors and stepper motors lies the realm of the
brushless DC motor. Built in a fashion very similar to stepper motors, these often use a
permanent magnet external rotor, three phases of driving coils, one or more Hall effect
sensors to sense the position of the rotor, and the associated drive electronics. The coils
are activated, one phase after the other, by the drive electronics as cued by the signals
from the Hall effect sensors. In effect, they act as three-phase synchronous motors
containing their own variable-frequency drive electronics. A specialized class of
brushless DC motor controllers utilize EMF feedback through the main phase
connections instead of Hall effect sensors to determine position and velocity. These
motors are used extensively in electric radio-controlled vehicles. When configured
with the magnets on the outside, these are referred to by modelists as outrunner
motors.

Brushless DC motors are commonly used where precise speed control is necessary, as
in computer disk drives or in video cassette recorders, the spindles within CD, CDROM (etc.) drives, and mechanisms within office products such as fans, laser printers
and photocopiers. They have several advantages over conventional motors:

Compared to AC fans using shaded-pole motors, they are very efficient,


running much cooler than the equivalent AC motors. This cool operation leads
to much-improved life of the fan's bearings.

Without a commutator to wear out, the life of a DC brushless motor can be


significantly longer compared to a DC motor using brushes and a commutator.
Commutation also tends to cause a great deal of electrical and RF noise;
without a commutator or brushes, a brushless motor may be used in electrically
sensitive devices like audio equipment or computers.

The same Hall effect sensors that provide the commutation can also provide a
convenient tachometer signal for closed-loop control (servo-controlled)
applications. In fans, the tachometer signal can be used to derive a "fan OK"
signal.

The motor can be easily synchronized to an internal or external clock, leading


to precise speed control.

Brushless motors have no chance of sparking, unlike brushed motors, making


them better suited to environments with volatile chemicals and fuels. Also,
sparking generates ozone which can accumulate in poorly ventilated buildings
risking harm to occupants' health.

Brushless motors are usually used in small equipment such as computers and
are generally used to get rid of unwanted heat.

They are also very quiet motors which is an advantage if being used in
equipment that is affected by vibrations.

Modern DC brushless motors range in power from a fraction of a watt to many


kilowatts. Larger brushless motors up to about 100 kW rating are used in electric
vehicles. They also find significant use in high-performance electric model aircraft.

Coreless DC motors:
Nothing in the design of any of the motors described above requires that the iron
(steel) portions of the rotor actually rotate; torque is exerted only on the windings of
the electromagnets. Taking advantage of this fact is the coreless DC motor, a
specialized form of a brush or brushless DC motor. Optimized for rapid acceleration,
these motors have a rotor that is constructed without any iron core. The rotor can take
the form of a winding-filled cylinder inside the stator magnets, a basket surrounding
the stator magnets, or a flat pancake (possibly formed on a printed wiring board)
running between upper and lower stator magnets. The windings are typically stabilized
by being impregnated with Electrical epoxy potting systems. Filled epoxies that have
moderate mixed viscosity and a long gel time. These systems are highlighted by low
shrinkage and low exotherm. Typically UL 1446 recognized as a potting compound for
use up to 180C (Class H) UL File No. E 210549.
Because the rotor is much lighter in weight (mass) than a conventional rotor formed
from copper windings on steel laminations, the rotor can accelerate much more
rapidly, often achieving a mechanical time constant under 1 ms. This is especially true
if the windings use aluminum rather than the heavier copper. But because there is no
metal mass in the rotor to act as a heat sink, even small coreless motors must often be
cooled by forced air.
These motors were commonly used to drive the capstan(s) of magnetic tape drives and
are still widely used in high-performance servo-controlled systems, like radiocontrolled vehicles/aircraft, humanoid robotic systems, industrial automation, medical
devices, etc.

5.6 MAX 232


A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is -3V
to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD pins of
the microcontroller thus need a converter chip. A MAX232 chip has long been using in
many microcontrollers boards. It is a dual RS232 receiver / transmitter that meets all
RS232 specifications while using only +5V power supply. It has two onboard charge
pump voltage converters which generate +10V to -10V power supplies from a single
5V supply. It has four level translators, two of which are RS232 transmitters that
convert TTL/CMOS input levels into +9V RS232 outputs. The other two level
translators are RS232 receivers that convert RS232 input to 5V. Typical MAX232
circuit is shown below.

Features:
1. Operates With Single 5-V Power Supply
2. LinBiCMOSE Process Technology
3. Two Drivers and Two Receivers
4. 30-V Input Levels
5. Low Supply Current . 8 mA Typical
6. Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28
7. Designed to be Interchangeable With
Maxim MAX232

8. Applications
TIA/EIA-232-F
Battery-Powered Systems
Terminals
Modems
Computers
9. ESD Protection Exceeds 2000 V Per
MIL-STD-883, Method 3015
10. Package Options Include Plastic
Small-Outline (D, DW) Packages and
Standard Plastic (N) DIPs
Circuit connections:
A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1'
is -3V to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD
pins of the uC chips, thus need a converter chip. A MAX232 chip has long been using
in many uC boards. It provides 2-channel RS232C port and requires external 10uF
pacitors. Carefully check the polarity of capacitor when soldering the board. A DS275
however, no need external capacitor and smaller. Either circuit can be used without
any problems.

L293D (QUADRUPLE HALF H-DRIVERS)


The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed
to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The
L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages
from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays,
solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage
loads in positive-supply applications. All inputs are TTL compatible. Each output is a
complete totem-pole drive circuit, with a Darlington transistor sink and a pseudoDarlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN
and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated
drivers are enabled, and their outputs are active and in phase with their inputs. When
the enable input is low, those drivers are disabled, and their outputs are off and in the
high-impedance state. With the proper data inputs, each pair of drivers forms a full-H
(or bridge) reversible drive suitable for solenoid or motor applications.
Features:

Featuring Unitrode L293 and L293D


Products Now From Texas Instruments

Wide Supply-Voltage Range: 4.5 V to 36 V

Separate Input-Logic Supply

Internal ESD Protection

Thermal Shutdown

High-Noise-Immunity Inputs

Functionally Similar to SGS L293 and


SGS L293D

Output Current 1 A Per Channel


(600 mA for L293D)

Peak Output Current 2 A Per Channel


(1.2 A for L293D)

Output Clamp Diodes for Inductive

Transient Suppression (L293D)


Pin diagram:

Description:

On the L293, external high-speed output clamp diodes should be used for inductive
transient suppression. A VCC1 terminal, separate from VCC2, is provided for the logic
inputs to minimize device power dissipation. The L293and L293D are characterized
for operation from 0C to 70C.
Block diagram:

Logic diagram:

Applications:

Audio

Automotive

Broadband

Digital control

Military

Optical networking

Security

Telephony

Video & Imaging

Wire less

WIRELESS CAMERA
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 smallsized 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.

6. CODE
#include<reg52.h>
#include<lcd.h>
sbit sw1 =P2^0;
sbit sw2 =P2^1;
sbit sw3 =P2^2;
sbit sw4 =P2^3;
sbit sw5 =P2^4;

sbit buzzer = P0^1;

void print(char *str)


{
while(*str)
{

SBUF = *str++;

while(TI == 0);
TI = 0;
}
}

void main()
{
char ch;
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xFD;
TR1 = 1;
init_lcd();
display_lcd("Security Robot");
buzzer=0;
sw1=sw2=sw3=sw4=sw5=1;
while(1)
{
if(RI==1)

{
while(RI==0);
ch=SBUF;
RI=0;
if(ch=='P')
buzzer=1;
cmd_lcd(0x01);
display_lcd("Person Identified");
delay_ms(500);

buzzer=0;
}
if(sw1==0)
{
cmd_lcd(0x01);
display_lcd("FORWARD");
print("F\r\n");
delay_ms(50);
}

if(sw2==0)
{
cmd_lcd(0x01);
display_lcd("BACK");
print("B\r\n");
delay_ms(50);
}
if(sw3==0)
{
cmd_lcd(0x01);
display_lcd("RIGHT");
print("R\r\n");
delay_ms(50);
}
if(sw4==0)
{
cmd_lcd(0x01);
display_lcd("LEFT");
print("L\r\n");

delay_ms(50);
}
if(sw5==0)
{
cmd_lcd(0x01);
display_lcd("STOP");
print("S\r\n");
delay_ms(50);
}

}
}

7. REFERENCE
TEXT BOOKS REFERED:
1. The 8051 Microcontroller and Embedded Systems by Muhammad Ali
Mazidi and Janice Gillispie Mazidi, Pearson Education.
2. 8051

Microcontroller Architecture,

programming

and

application

KENNETH JAYALA
3.

ATMEL 89s52 Data sheets

4.

Hand book for Digital ICs from Analogic Devices

WEBSITES VIEWED:

www.atmel.com

www.beyondlogic.org

www.dallassemiconductors.com

www.maxim-ic.com

www.alldatasheets.com

www.howstuffworks.com

by

You might also like