A Mini Project report On ROBOT CONTROL USING ZIGBEE TECHNOLOGY Submitted in partial fulfillment of the requirement for the award by N.VENKATA POSI LAKSHMI (07AP1A0463) V.GOPI (07AP1A0459) V.SURYANARAYANA (07AP1A0461) Bachelor of Technology In Electronics and Communication Engineering Under the esteem guidance of Asst.Prof.K.MIRANJI , (M.Tech) Department of E.C.E Department of Electronics and Communication Engineering BHIMAVARAM INSTITUTE OF ENGINEERING & TECHNOLOGY BVRM Page 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
A Mini Project report
On
ROBOT CONTROL USING ZIGBEE TECHNOLOGYSubmitted in partial fulfillment of the requirement for the award by
N.VENKATA POSI LAKSHMI (07AP1A0463)
V.GOPI (07AP1A0459) V.SURYANARAYANA (07AP1A0461)
Bachelor of Technology
In
Electronics and Communication Engineering
Under the esteem guidance of
Asst.Prof.K.MIRANJI, (M.Tech)
Department of E.C.E
Department of Electronics and Communication Engineering
BHIMAVARAM INSTITUTE OF ENGINEERING & TECHNOLOGY(Approved by A.I.C.T.E., Affiliated to J.N.T.U., Kakinada)
PENNADA, BHIMAVARAM-534243. 2010-2011
BVRM Page 1
CONFIRMATION
Unique Embedded Technologies
#P.No:43,Bharat nagar Colony, Hyderabad-500018
Andhra Pradesh.
This is to confirm that the Project titled “ ROBOT CONTROL USING
ZIGBEE TECHNOLOGY”under going by the below mentioned students
of B.Tech in Electronics & communication Engineering from
BHIMAVARAM INSTITUTE OF ENGINEERING & TECHNOLOGY
These 3 members are doing this project under the guidance of “UNIQUE
EMBEDDED TECHNOLOGIES “, Hyderabad.
Name Reg. No:
N.VENKATA POSI LAKSHMI 07AP1A0463
V .GOPI 07AP1A0459
V.SURYANARAYANA 07AP1A0461
Project Guide ProjectTrainer
HOD, ECE
BVRM Page 2
CERTIFICATE
BHIMAVARAM INSTITUTE OF ENGINEERING &
TECHNOLOGY(Approved by A.I.C.T.E., Affiliated to
J.N.T.U.,Kakinada,), PENNADA, BHIMAVARAM-534243.
Department of Electronics and Communication
EngineeringThis is to certify that the project entitled “ROBOT CONTROL USING
ZIGBEE TECHNOLOGY” is being submitted by
N.VENKATA POSI LAKSHMI 07AP1A0463
V.GOPIKRISHNA 07AP1A0459
V.SURYANARAYANA 07AP1A0461
In partial fulfillment of the requirements for the award of BACHELOR OF
TECHNOLOGY to JNTU, Kakinada. This record is a bonafide work carried out by
them under my guidance and supervision. The result embodied in this project report has
not been submitted to any other university or institute for the award of any degree of
diploma.
Internal Guide External Guide
H. O. D.
BVRM Page 3
ACKNOWLEDGEMENT
We express our sincere thanks to Sri A.V.V.Satyanarayana Secretary and correspondent
of the college for making neccesary arrangements for mini project work at Bhimavaram
Institute of Engineering and Technology.
We wish to express our gratitude to Mr.J.Girish,principal of Bhimavaram Institute
of Engineering and Technology,Pennada,Bhimavaram for having given us permission to
carry out the miniproject. We express our sincere thanks to Mr.A.ANJANEYULU,HOD
of ECE,Bhimavaram Institute of Engineering and Technology,for his encoragement and
valuable suggestions through out the miniproject.
We express our sincere thanks and deep sense of gratitude for the inspiring guidence
and kind encouragement with unfailing support rendered by Mr.K.MIRANJI,Asst
Prof.Dept of ECE,Bhimavaram Institute of engineering and Technology.
We are also thankful to the staff of our ECE Department for their valuable
support,comments during the course of the miniproject and to all others who have directly
or indirectly contribute to the success of the miniproject .We owe our sincere thanks to
our parents with out whose encouragement our achievement is not possible.
We owe our gratitude to our Bhimavaram Institute of Engineering and
Technology for providing an opportunity to do our project.
8051 is one of the most popular microcontrollers in use today. Many derivative
microcontrollers have since been developed that are based on—and compatible with—the
8051.Thus, the ability to program an 8051 is an important skill for anyone who plans to
develop products that will take advantage of microcontrollers.
General-purpose microprocessors contains No RAM No ROM No I/O ports
Microcontroller has CPU (microprocessor) RAM ROMI/O ports Timer ADC and other
peripherals.
The fixed amount of on-chip ROM, RAM, and number of I/O ports makes them ideal
for many applications in which cost and space are critical In many applications, the space
it takes, the power it consumes, and the price per unit are much more critical
considerations than the computing poweri.cro-
ProcesWide availability and reliable sources of the microcontroller
The 8051 family has the largest number of diversified (multiple source) suppliers
Intel (original)
Atmel
Philips/Signetics
AMD
Infineon (formerly Siemens)
Matra
Dallas Semiconductor/Maxim
Department of Computer Science and Information Engineerin
Intel introduced 8051, referred as MCS-51, in 1981.The 8051 is an 8-bit processor
The CPU can work on only 8 bits of data at a time
The 8051 had128 bytes of RAM
4K bytes of on-chip ROM
BVRM Page 16
Two timers
One serial port
Four I/O ports, each 8 bits wide
6 interrupt sources
2.1) BLOCK DIAGRAM OF 8051 MICRO CONTROLLER :
Micro controller is the heart of total system. The micro controller controls all the
devices connected in the diagram. Micro controller sends pulses to all the devices,
which are connected to it.We can program it in any language i.e., in assembly or C or
C++, depending upon the user. In this flash memory is more compatible with others. In
our design, this controller is compatible and also reliable one.
8051 microcontroller is a 8bit microcontroller introduced by Intel Corporation in
1981 which comes in 40 pin dual inline package (DIP).
It has 4KB of inbuilt ROM i.e. onchip program space.
It has 128bytes of inbuilt RAM space and if required external memory of 64KB can be
interfaced to the microcontroller.
There are 4 parallel 8bit ports namely port 0, port 1, port 2 and port 3 which are
addressable as well as programmable.
BVRM Page 17
Fig 2.1:8051 Micro controller Architecture
It has an onchip crystal oscillator with crystal frequency 11.0592MHz (~12MHz).
It has full duplex serial I/O port having two pins namely TxD, RxD.
It has two 16bit timers namely Timer 0 and Timer 1 which can be used either as timer
for internal operation or as counter for external operation.
It has five interrupt sources. All of them are maskable as well as vector interrupts. They
are External Interrupt 0, Timer Interrupt 0, External Interrupt 1, Timer Interrupt 1, and
Serial Port Interrupt.
The programming mode of this microcontroller consists of general purpose registers
(GPRs), Special Purpose Registers (SPRs) and Special Function Registers (SFRs).
The instruction set of 8051 µc consists of more number of bit manipulations or boolean
variable manipulation group of instructions. The instructions are very much useful to
manipulate SFR bits and also port pins.
BVRM Page 18
Register and Internal RAM organization
8051 µc provides two 8bit general purpose registers – A (Accumulator) and B.
It provides 4 special purpose registers – 16bit Program Counter (PC), 8bit Stack Pointer
(SP), 16bit Data Pointer and 8bit Program Status Word (PSW).
It also provides few Special Function Registers. They are TMOD, TCON, IE, IP, SBUF,
SCON, PCON.
The 128bytes onchip RAM of 8051 µc is divided into three portions as given below.
00H – 1FH : These 32bytes are arranged as 4 register banks namely Bank 0, Bank 1,
Bank 2, Bank 3 where each bank consists of 8 registers namely R0 through R7.
20H – 2FH : These 16bytes (128bits) are made available as bit-addressable bytes.
30H – 7FH : These 80 bytes are available as scratch-pad RAM bytes.
2.2)8051 PIN CONFIGURATION:
Power - Vcc, Vss Reset - RST Crystal - XTAL[1,2] External device interfacing – EA, ALE, PSEN, WR, RD I/O Port – P0[7;0], P1[7:0], P2[7:0], P3 P3 is shared with control lines – Serial I/O RxD, TxD, – external interrupts INT0, INT1 – Counter control T0, T1 P0 and P2 are multiplexed with Address and Data bus
BVRM Page 19
Fig2.2:pin diagram of 8051 micro controller
BASIC CIRCUIT -THAT MAKES 8051 WORKS.
BVRM Page 20
Fig 2.3:Basic circuit for 8051 micro controller
EA/VP Pin
The EA on pin 31 is tied high to make the 8051 executes program from Internal ROM
Reset Circuit
RESET is an active High input When RESET is set to High,
8051 goes back to the power on state.
The 8051 is reset by holding the RST high for at least two machine cycles and
then returning it low.
Power-On Reset
- Initially charging of capacitor makes RST High
- When capacitor charges fully it blocks DC.
BVRM Page 21
Manual reset
-closing the switch momentarily will make RST High.
Oscillator Circuit
The 8051 uses the crystal for precisely that: to synchronize it’s operation.
Effectively,the 8051 operates using what are called "machine cycles."
A single machine cycle is the minimum amount of time in which a single
8051 instruction can be executed. although many instructions take multiple cycles.
8051 has an on-chip oscillator.
It needs an external crystal thats decides the operating frequency of the 8051.
Fig 2.4:circuit for crystal and TTL oscillator
This can be done in two ways,
The crystal is connected to pins 18 and 19 with stabilizing capacitors.
12 MHz(11.059MHz) crystal is often used and the capacitance ranges from 20pF to 40pF.
The oscillator can also be a TTL clock source connected with a NOT gate as shown.
How fast 8051 works ?
A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes
one machine cycle to execute, it will take 12 pulses of the crystal to execute.
Since we know the crystal is pulsing 11,059,000 times per second and that
BVRM Page 22
one machine cycle is 12 pulses, we can calculate how many instruction cycles the 8051
can execute per second:
11,059,000 / 12 = 921,583
Why is such an oddball crystal frequency?
11.0592 MHz crystals are often used because it can be divided to give you exact clock rates
for most of the common baud rates for the UART,especially for the higher speeds (9600,19200).
Despite the "oddball" value, these crystals are readily available and commonly used.
POWER SUPPLY
Fig 2.5:power supply connections
C1-1000 mf ,C2-100 mf
The 78L05 is a 5V regulator.
The input voltage ranges from 7V to 35V and the output voltage is about 5V.
Using Ports for I/O Operation
8051 is TTL logic device. TTL logic has two levels: Logic "High" (1) and logic "Low" (0).
The voltage and current involved for the two levels are as follows:
BVRM Page 23
Level Voltage CurrentHigh Above 2.4V Virtually no current flow
Low Below 0.9V1.6mA Sinking current from TTL input to ground(Depends on logic family)
Consider the atmel AT89S52 is a low-power, high-performance CMOS 8-bit
microcontroller with 8K bytes of in-system programmable Flash memory. The device is
manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry- standard 80C51 instruction set and pin out.
2.3)FEATURES OF MICRO CONTROLLER:
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 1000 Write/Erase Cycles
4.0V to 5.5V Operating Range
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Full Duplex UART Serial Channel
Fully Static Operation: 0 Hz to 33 MHz
2.4)8051 MICRO CONTROLLER INTERFACING:
Here port1(pin 1-8) used as output port.Port3 (pin 10-17) can be used as i/p. it has
9 DTR / SLEEP_RQ* / DI8 Input Pin Sleep Control Line or Digital Input 8
10 GND - Ground
11 AD4* / DIO4* Either Analog Input 4 or Digital I/O 4
12 CTS / DIO7* Either Clear-to-Send Flow Control or Digital I/O 7
13 ON / SLEEP Output Module Status Indicator
14 VREF* Input Voltage Reference for A/D Inputs
15 Associate / AD5* / DIO5* Either Associated Indicator, Analog Input 5 or Digital I/O 5
16 RTS* / AD6* / DIO6* Either Request-to-Send Flow Control, Analog Input 6 or
Digital I/O 6
17 AD3* / DIO3* Either Analog Input 3 or Digital I/O 3
18 AD2* / DIO2* Either Analog Input 2 or Digital I/O 2
19 AD1* / DIO1* Either Analog Input 1 or Digital I
20 AD0* / DIO0* Either Analog Input 0 or Digital I/O
HOW IT’S WORKS
ZigBee basically uses digital radios to allow devices to communicate with one another.
A typical ZigBee network consists of several types of devices. A network coordinator is
a device that sets up the network, is aware of all the nodes within its network, and
manages both the information about each node as well as the information that is being
BVRM Page 39
transmitted/received within the network. Every ZigBee network must contain a network
coordinator. Other Full Function Devices (FFD's) may be found in the network, and
these devices support all of the 802.15.4 functions. They can serve as network
coordinators, network routers, or as devices that interact with the physical world. The
final device found in these networks is the Reduced Function Device (RFD), which
usually only serve as devices that interact with the physical world. An example of a
ZigBee network is shown below in
Figure 5.2:Zigbee network
The figure above introduces the concept of the ZigBee network topology. Several
topologies are supported by ZigBee, including star, mesh, and cluster tree. Star and
mesh networking are both shown in the figure above. As can be seen, star topology is
most useful when several end devices are located close together so that they can
communicate with a single router node. That node can then be a part of a larger mesh
network that ultimately communicates with the network coordinator. Mesh
networking allows for redundancy in node links, so that if one node goes down,
devices can find an alternative path to communicate with one another. Figures 5.3
provide an example of
BVRM Page 40
Figure 5.3. Mesh Networking Path 1 [7].
ZigBee operates in two main modes: non-beacon mode and beacon mode. Beacon mode
is a fully coordinated mode in that all the device know when to coordinate with one
another. In this mode, the network coordinator will periodically "wake-up" and send out
a beacon to the devices within its network. This beacon subsequently wakes up each
device, who must determine if it has any message to receive. If not, the device returns to
sleep, as will the network coordinator, once its job is complete. Non-beacon mode, on the
other hand, is less coordinated, as any device can communicate with the coordinator at
will. However, this operation can cause different devices within the network to interfere
with one another, and the coordinator must always be awake to listen for signals, thus
requiring more power. In any case, ZigBee obtains its overall low power consumption
because the majority of network devices are able to remain inactive over long periods of
time.
BVRM Page 41
APPLICATIONS:
Figure5.4:Zigbee Applications
CHAPTER 6SOFTWARE TOOLS
a)Keil C51 COMPILER
Figure6.1:Keil Compiler Professional kit
BVRM Page 42
Keil Compiler:
Keil compiler is software used where the machine language code is written and compiled.After compilation, the machine source code is converted into hex code which is to be dumpedinto the microcontroller for further processing. Keil compiler also supports C language
code.
Fig 6.2compile the program
Fig 6..3 Run the compiled program
BVRM Page 43
Alternatively KEIL can be used to create source files; automatically compile, link and
covert using options set with an easy to use user interface and finally simulate or perform
debugging on the hardware with access to C variables and memory. Unless you have to
use the tolls on the command line, the choice is clear. KEIL Greatly simplifies the process
of creating and testing an embedded application.
Projects
The user of KEIL centers on “projects”. A project is a list of all the source files
required to build a single application, all the tool options which specify exactly how to
build the application, and – if required – how the application should be simulated. A
project contains enough information to take a set of source files and generate exactly the
binary code required for the application. KEIL can then execute each tool with the correct
options. It is also possible to create new projects in KEIL. Source files are added to the
project and the tool options are set as required. The project can then be saved to preserve
the settings. The project also stores such things as which windows were left open in the
simulator/debugger, so when a project is reloaded and the simulator or debugger started,
all the desired windows are opened. KEIL project files have the extension
Simulator/Debugger
The simulator/ debugger in KEIL can perform a very detailed simulation of a
micro controller along with external signals. It is possible to view the precise execution
time of a single assembly instruction, or a single line of C code, all the way up to the
entire application, simply by entering the crystal frequency. A window can be opened for
each peripheral on the device, showing the state of the peripheral. This enables quick
trouble shooting of mis-configured peripherals. Breakpoints may be set on either
assembly instructions or lines of C code, and execution may be stepped through one
instruction or C line at a time. The contents of all the memory areas may be viewed along
with ability to find specific variables. In addition the registers may be viewed allowing a
detailed view of what the microcontroller is doing at any point in time.
The Keil Software 8051 development tools listed below are the programs you
use to compile your C code, assemble your assembler source files, link your program
together, create HEX files, and debug your target program. µVision2 for Windows™
Integrated Development Environment: combines Project Management, Source Code
Editing, and Program Debugging in one powerful environment.
C51 ANSI Optimizing C Cross Compiler: creates relocatable object modules from
BVRM Page 44
your C source code,
A51 Macro Assembler: creates relocatable object modules from your 8051
assembler source code,
BL51 Linker/Locator: combines relocatable object modules created by the compiler
and assembler into the final absolute object module,
LIB51 Library Manager: combines object modules into a library, which may be used
by the linker,
OH51 Object-HEX Converter: creates Intel HEX files from absolute object
modules
SOFTWARE CODING:
#include<reg51.h>
#include<intrins.h>
sbit m1=P1^0;
sbit m12=P1^1;
sbit m2=P1^2;
sbit m21=P1^3;
void serial_init();
void DCmotorForward();
void DCmotorReverse();
void DCmotorLeft();
void DCmotorRight();
void stop();
void delay(unsigned int);
unsigned char flag;
void main()
{
serial_init();
while(1)
{
if(flag==1)
{
BVRM Page 45
if(SBUF=='f'||SBUF=='F')
{
DCmotorForward();
}
else if(SBUF=='b'||SBUF=='B')
{
DCmotorReverse();
}
else if(SBUF=='l'||SBUF=='L')
{
DCmotorLeft();
delay(10);
stop();
}
else if(SBUF=='r'||SBUF=='R')
{
DCmotorRight();
delay(10);
stop();
}
else if(SBUF=='s'||SBUF=='S')
{
stop();
}
}
}
}
void serial_init()
{
EA=1;
ES=1;
SCON=0X50;
TMOD=0X20;
BVRM Page 46
TH1=0XFD;
TR1=1;
}
void serial() interrupt 4
{
if(RI==1)
{
flag=1;
RI=0;
}
}
void DCmotorForward()
{
m1=1;
m12=0;
m2=1;
m21=0;
}
void DCmotorReverse()
{
m1=0;
m12=1;
m2=0;
m21=1;
}
void DCmotorRight()
{
m1=1;
m12=0;
m2=0;
m21=0;
}
void DCmotorLeft()
BVRM Page 47
{
m1=0;
m12=0;
m2=1;
m21=0;
}
void stop()
{
P1=0x00;
}
void delay(unsigned int T)
{
int j;
while(T--)
for(j=0;j<-180;j++);
}
.
RESULTS:HARDWARE KIT:
BVRM Page 48
CONCLUSION:
This project focuses on developing an embedded system to create a rescue robot which is
BVRM Page 49
used for fire fighters to send the robot into the fire building and help to rescue the people
from the building. Wireless personal Area Networking applies not only to household
devices, but also to individualised office automation applications, ZigBee is here to stay.
It is more than likely the basis of future home-networking solutions.