Beruflich Dokumente
Kultur Dokumente
A Project Report on
Prof. N.N.THUNE
CERTIFICATE
This is to certify that the seminar entitled ZIGBEE BASED
INDUSTRIAL AUTOMATION is a bona fide record of the project to done by
APURVA M. ACHARYA (B3483401), ANUYA S. BHOSLE (B3483409) and
KIRAN B. KULKARNI (B3483430) under my supervision and guidance, in
partial fulfillment of the requirements for the award of Degree of Bachelor of
Engineering in Electronics Engineering from University of Pune, for the year
2010-11.
PROF. S.N.NIPANIKAR
Project Co-ordinator
Dept. of Electronics
Engineering.
PROF. M.S.NAGMODE
Principal
PVPIT, Pune
PROF. N.N.THUNE
Guide
Dept. of Electronics
Engineering.
External Examiner
Engineering
Place:
Date:
PROF. S.D.JOSHI
Head
Dept. of Electronics
ACKNOWLEDGEMENT
Every orientation work has a imprint of many people and it becomes our
duty to express deepest gratitude for some.
We thank our project co-guide Prof. N.N.Thune for giving us opportunity
for presenting our project.
We would like to express our sincere thanks our project co-ordinator to
respected Prof. Nipanikar for increasing our morale and confidence and guiding
and co-operating with us in the project.
We also express our profound gratitude towards our H.O.D Prof. S.D.Joshi
for giving us opportunity for presenting our project. We would also like to thank
our project sponsors VARROC ENGINEERING LIMITED in giving us all
facilities and use their resources.
We especially thank Mr. Mariappan and Mr. Shishir Bhosle personally for
guiding us in our project.
We also thank to all teaching and non-teaching staff for their useful
cooperation.
APURVA M. ACHARYA
ANUYA S. BHOSLE
KIRAN B. KULKARNI
ABSTRACT
In the electronics industries due to manual errors the accuracy of the
system is reduced, this affects the reliability and efficiency of the system.
Electronics has achieved great importance in the field of automation, which deals
with the above problem.
In todays world the field of communication plays a leading role in long
distance data transfer. so one step ahead in the technical world weve decided to
club together both the electronic and the communication world .
In huge industries, it is very difficult to continuously monitor and control
the environmental conditions like temperature, pressure, humidity, etc in each
room. So, we are developing a system using zigbee which will monitor as well as
control the temperature of a room in an industry. According to the status of
temperature ON-OFF of heater/fan is done.
It is also very important to keep a track of current status of light in each
department but due to the large area covered by industry it is not possible to
control lighting system of the entire industry manually. We are developing a
system in which the lighting application is controlled via the zigbee module.
Hence, energy and time consumption is reduced to a great extent. Thus, the
project helps in monitoring and controlling the temperature of a room as well as in
controlling the lighting application.
INDEX
Chapter No.
Description
Page No.
Introduction
Problem Definition
1
1
Literature Survey
Block Diagram
Working
Circuit Diagram
Circuit Description
Selection of components
Zigbee
RS-232
Microcontroller MC9S08AW16
Relay
Temperature sensor
4
5
6
11
12
15
19
29
30
Layout
Artwork
31
34
Software
Algorithms
Flowcharts
Applications
36
36
38
41
8
8.1
8.2
9
Pros
Cons
Future scope
42
42
43
10
Conclusion
44
11
Bill Of Material
45
12
Bibliography
46
1
1.1
1.2
2
2.1
3
3.1
3.2
3.3
3.4
4
4.1
4.2
4.3
4.4
4.5
5
5.1
5.2
6
6.1
6.2
6.3
7
LIST OF FIGURES
Fig. no.
Title
Page No.
3.1.1
Master Circuit
3.1.2
Slave1 Circuit
3.1.3
Slave2 Circuit
3.3.1
3.3.2
3.3.3
Microcontroller Circuit
3.3.4
Sensor Circuit
3.3.5
Relay Circuit
10
4.1.1.1
Zigbee logo
12
4.1.1.2
13
4.1.1.3
4.2.2.1
RS-232 cable
16
4.2.2.2
16
4.3.1.1
19
4.3.2.1
4.3.2.2
22
4.4.1.1
Relay
29
4.4.2.1
Relay Symbol
29
4.5.1.1
BAV99
30
5.1.1
Microcontroller Layout
31
5.1.2
Microcontroller layout
32
5.1.3
Relay
33
5.2.1
Microcontroller
34
5.2.2
Relay
35
14
20
LIST OF TABLES
Table No.
Title
Page No.
4.1.1.3
13
4.2.2.1
4.3.1.1
20
17
CHAPTER 1: INTRODUCTION
1.1
INTRODUCTION
In todays scenario world is moving on very fast. Time constraint is very
severe problem due to which the old traditional methods do not find any place
now. Industries are booming day by day, new industries are emerging daily
where wireless communication plays a vital role. Due to the use of wireless
communication in industries the laborious work done by men is reduced up to
quite extent.There are many wireless communication modules like Bluetooth,
Zigbee , Wi-Fi , etc. As introducing new and new solutions, the basic factor that is
to be considered is safe working and quality assurance. The project deals with the
wireless module ZigBee which is a low cost, long battery life and low
power consuming wireless mesh networking standard (IEEE 802.15.4).
10
11
12
13
14
3.2 WORKING
Zigbee is wireless mesh networking standard. It is mainly used
to
control and monitor the application.Hence, we are using Zigbee for controlling
light system and monitoring sensors in automobile industry. The project
consists of 1 Master circuit and 2 Slave circuits.
3.2.1 Master circuit:
The master circuit consists of personal computer, Zigbee, microcontroller
and rs232 for compatibility.
The microcontroller is interfaced to the personal computer via rs232.and
the wireless module Zigbee is interfaced to the microcontroller. So the data sent
from slave circuits Zigbee is catched by antenna of master Zigbee, thus the
master Zigbee sends this data to microcontroller and hence sent to pc for display.
For the controlling application the flow of data will be from the pc to
master Zigbee via microcontroller and then to Zigbee of slave2.
3.2.2 Slave circuit 1:
The slave circuit 1 consists of Zigbee which is interfaced to
microcontroller. Temperature sensor, fan and heater are also interfaced to that
microcontroller. The sensor will sense the temperature and accordingly the
sensed value will be passed to Zigbee master from where it will be
displayed on PC .If the room temperature exceeds the
15
predecided value then the fan is turned ON automatically. If suppose the room
temperature goes below the predecided value then accordingly the heater will turn
ON.
16
17
18
19
20
3.4CIRCUIT DESCRIPTION:
3.4.1 Master:
Master circuit consist of Personal Computer ,1 microcontroller and 1 zigbee
module.Personal computer is interfaced to microcontroller via RS 232 and also
zigbee module is interface to that microcontroller.Pin 2 of RS232 of PC is connected
to pin 14 of MAX232D.Pin 13i.e.R1IN of MAX232D is connected to pin 3 of RS
232.Pin 12 of MAX232 connected to RX1 of
Serial communication
21
Fig.4.1.1.1ZigBee Logo
The name ZigBee is said to come from the domestic honeybee which uses
a zig-zag type of dance to communicate important information to other hive
members. This communication dance (the "ZigBee Principle") is what engineers
are trying to emulate with this protocol - a bunch of separate and simple
organisms that join together to tackle complex tasks.
ZigBee technology is a low data rate, low power consumption, low cost;
wireless networking protocol targeted towards automation and remote control
applications.
ZigBee compliant wireless devices are expected to transmit 10-75 meters,
depending on the RF environment and the power output consumption required for
a given application, and will operate in the unlicensed RF worldwide (2.4GHz
global, 915MHz Americas or 868 MHz Europe). The data rate is 250kbps at
2.4GHz, 40kbps at 915MHz and 20kbps at 868MHz.
22
PARAMETERS
ZIGBEE
BLUETOOTH
WI-FI
STANDARD
IEEE 802.15.4
IEEE 802.15.1
IEEE 802.15.11
NETWORK
mesh
p2p
p2p
NETWORK
70m
100m
100m
MAIN
-Sensors/control
-Voice applications.
APPLICATION
applications.
-Eliminating short
networks.
-Remote control
distance cabling
-WLAN.
RANGE
-Replace Ethernet
cables
STRONG
-Many devices/nodes.
-Dominating WLAN
POINTS
of mobile devices.
-Low power.
Fig. 4.1.1.2 Graph showing range and data rate of different wireless modules
23
Support for multiple network topologies such as star, cluster tree and mesh
networks
Data rates of 250 kbps (@2.4 GHz), 40 kbps (@ 915 MHz), and 20 kbps
(@868 MHz).
packages.
IEEE 802.15.4 compliant PHY.
256 kB Flash memory, 8 kB SRAM
15 digital and analogue I/O.
24
4.2 RS-232
4.2.1Specifications:
Baud rate : Common baud rates used are 2.4k, 9.6k, 19.2k.
25
26
TD (transmit data) :
The TD (transmit data) wire is the one through which data from a
DTE device is transmitted to a DCE device. This name can be deceiving,
because this wire is used by a DCE device to receive its data.The TD line
is kept in a mark ( logic 1) condition by the DTE device when it is idle.
RD (receive data) :
The RD (receive data) wire is the one on which data is received by
a DTE device, and the DCE device keeps this line in a mark condition
when idle.
27
special control characters transmitted from one device to another to tell the
other device to stop or start sending data. With software flow control the
RTS and CTS lines are not used.
CD (Carrier Detect) :
Carrier Detect is used by a modem to signal that it has a made a
connection with another modem, or has detected a carrier tone.
RI (Ring Indicator) :
The last remaining line is RI or Ring Indicator. A modem
toggles
the state of this line when an incoming call rings your phone
The Carrier Detect (CD) and the Ring Indicator (RI) lines are only
available in connections to a modem. Because most modems transmit
status information to a PC when either a carrier signal is detected (i.e.
when a connection is made to another modem) or when the line is ringing,
these two lines are rarely used.
28
4.3Microcontroller MC9S08AW16
4.3.1 Why HCS08?
29
PIC
89S52
FLASH
PROGRAM
MEMORY
DATA
MEMORY
PORTS
16K
4K/8K
8K
1K
192
2K
3-5
TIMERS
ADC
8 channel
8 channel
Not present
KBI
Present
Not present
Not present
MICROCONTROLLER
8 bit
8 bit
8 bit
4.3.2 MC9S08AW16Features:
30
31
VDD and VSS are the primary power supply pins for the MCU. This voltage
source supplies power to all I/O buffer circuitry and to an internal voltage
regulator. The internal voltage regulator provides regulated lower-voltage source
to the CPU and other internal circuitry of the MCU.
Typically, application systems have two separate capacitors across the
power pins. In this case, there should be a bulk electrolytic capacitor, such as a 10F tantalum capacitor, to provide bulk charge storage for the overall system and a
0.1-F ceramic bypass capacitor located as near to the paired V DD and VSS power
pins as practical to suppress high-frequency noise. The MC9S08AW16 has a
32
RESET Pin
RESET is a dedicated pin with a pullup device built in. It has input
hysteresis, a high current output driver and no output slew rate control. Internal
power-on reset and low-voltage reset circuitry typically make external reset
circuitry unnecessary. This pin is normally connected to the standard 6-pin
background debug connector so a development system can directly reset the MCU
system.
If desired, a manual external reset can be added by supplying a simple
switch to ground (pull reset pin low to force a reset). Whenever any reset is
initiated (whether from an external signal or from an internal system) the reset pin
is driven low for approximately 34 bus cycles, released, and sampled again
approximately 38 bus cycles later. If reset was caused by an internal source such
as low-voltage reset or watchdog timeout, the circuitry expects the reset pin
sample to return a logic1.The reset circuitry decodes the cause of reset and records
it by setting a corresponding bit in the system control reset status register (SRS).
4.3.5
mode fSelf-reset) equivalent to about 8-MHz crystal rate. This frequency source is
used during reset startup and can be enabled as the clock source for stop recover
to avoid the need for a long crystal startup delay.
This MCU also contains a trimmable internal clock generator (ICG)
module that can be used to run the MCU. The oscillator amplitude on XTAL and
EXTAL is gain limited for low-power oscillation. Typically, these pins have a 1-V
peak-to-peak signal. For noisy environments, the high gain output (HGO) bit can
be set to enable rail-to-rail oscillation. The oscillator in this MCU is a Pierce
oscillator that can accommodate a crystal or ceramic resonator in either of two
33
for
background
debug
communication.
While
functioning
as
background/mode select pin, the pin includes an internal pullup device, input
hysteresis, a standard output driver and no output slew rate control. If nothing is
connected to this pin, the MCU will enter normal operating mode at the rising
edge of reset.
If a debug system is connected to the 6-pin standard background debug
header, it can hold BKGD/MS low during the rising edge of reset which forces the
MCU to active background mode. The BKGD pin is used primarily for
background debug controller (BDC) communications using a custom protocol that
uses 16 clock cycles of the target MCUs BDC clock per bit time.
The target MCUs BDC clock could be as fast as the bus clock rate, so
there should never be any significant capacitance connected to the BKGD/MS pin
that could interfere with background serial communications.
4.3.7
MC9S08AW16
Series
includes
two
independent
serial
34
Features
Full-duplex
Double-buffered transmitter and receiver with separate enables
Programmable baud rates (13-bit modulo divider)
Interrupt-driven or polled operation:
- Transmit data register empty and transmission complete
- Receive data register full
- Receive overrun, parity error, framing error, and noise error
- Idle receiver detect
Hardware parity generation and checking
Programmable 8-bit or 9-bit character length
Receiver wakeup by idle-line or address-mark
Register Definition
The SCI has eight 8-bit registers to control baud rate, select SCI
options, report SCI status, and for transmit/receive data.
Modes of Operation
1. 8- and 9-bit data modes
2. Stop modes SCI is halted during all stop modes
3. Loop mode
4. Single-wire mode
1. 8- and 9-Bit Data Modes
The SCI system (transmitter and receiver) can be configured to
operate in 9-bit data mode by setting the M control bit in SCIxC1. In 9-bit
mode, there is a ninth data bit to the left of the MSB of the SCI data
register.
For the transmit data buffer, this bit is stored in T8 in SCIxC3. For
the receiver, the ninth bit is held in R8 in SCIxC3. When transmitting 9bit data, write to the T8 bit before writing to SCIxD for coherent writes to
the transmit data buffer. If the bit value to be transmitted as the ninth bit
35
36
10-bit
analog-to-digital
converter
(ADC)
is
successive
Features
Linear successive approximation algorithm with 10 bits resolution.
Up to 28 analog inputs.
Features
The timer system in the MC9S08AW16 Series includes a 4-channel TPM1
and a separate 2-channel TPM2.
A total of eight channels:
-Each channel may be input capture, output compare, or buffered edgealigned PWM
-Rising-edge, falling-edge, or any-edge input capture trigger
16-bit free-running or up/down (CPWM) count operation
16-bit modulus register to control counter range
Timer system enable
Clock sources independently selectable per TPM (multiple TPMs device)
Selectable clock sources :bus clock, fixed system clock, external pin.\
38
4.4 RELAY:
4.4.1 Relay
Fig.4.4.1.1 Relay
SPST Single Pole Single Throw. These have two terminals which can be
connected or disconnected. Including two for the coil, such a relay has four
terminals in total. It is ambiguous whether the pole is normally open or
39
4.4.3 Specifications:
Fig.4.5.1 BAV99
FEATURES:
40
41
42
43
44
45
46
47
CHAPTER 6 : SOFTWARE
6.1 SOFTWARE
Language used: Embedded c.
Software used: Code warrior.
Microsoft visual studio
Express pcb
6.1.1 CodeWarrior
CodeWarrior is a desktop PC integrated development environment (IDE)
which includes a C compiler for the HCS08 MCU and the other tools to generate a
downloadable image as well as a debugger that can download code into the
HCS08 MCUs flash memory.
CodeWarrior takes the output of BeeKit and compiles and links the C
source code and libraries into a binary image that may be downloaded into the
Flash memory of an HCS08 MCU using the background debug memory (BDM)
port.
6.2 ALGORITHMS
6.2.1 Master :
1) Start
2) Initialize micro-controller.
3) Initialize Zigbee module.
4) Wait for signal.
5) Check whether data frame is from computer or not.
6) If YES transfer data frame to slave2 via zigbee module and go to step
no.4.
48
49
6.3 FLOWCHARTS
6.3.1 Master:
50
6.3.2 Slave 1:
51
Slave 2:
52
53
CHAPTER 7: APPLICATIONS
1)
2) Home Automation
Light switches and lights
Computers, TVs, and other electronic devices
Smoke detectors and other safety equipment
Electricity, water, and gas meters.
3) Building Automation
Wireless sensing and control mesh networks can make building
automation easier and more efficient by combining lighting,security, safety
systems, and other monitoring networks into a single platform.
4) Automated meter reading (AMR)
Flexible and scalable mesh networks provide wireless AMR, which
helps to reduce effort and increase accuracy across many industries
including utility companies, manufacturers, and storage facilities.
5) Healthcare
-Within hospitals, adding patient monitors to a mesh network enables
faster detection of irregularities in a patients medical condition.
-Outside hospitals, patients can be treated at home, with doctors able to
monitor their vital statistics over the Internet.
6) Defense and national security
-Mesh networks can be used to monitor and protect installations that are
identified as potential targets, including military installations and sites
where hazards such as heat, gases, and toxins are manufactured or stored.
-Mesh networks can also be used for battlefield and shipboard monitoring.
54
Cons
interfaced to the
SR.NO COMPONENT
PART
1
2
3
4
5
6
7
8
9
10
11
C1
C2
C3,C4,C5,C6,C8,C9,C18
C7,C10
C11,C12
D1
D2,D3
D4
D5,D6,D7
F1
J1, J2,J3,J4,J5,
J6,J7,J8,J9,J11,J12,J13,J14
470uF/35V
1uF/63V
0.1uF/50V
10uF/50V
1nF
1N4007
BAV99L
3.3VZener
1N4148
Fuse(clip)
Connectors
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
P1
Q1,Q2,Q3
R1
R2
R4,R5,R6,R7
R8
R9
R10,R11,R12
SW1
U1
U2
U3
6 PIN FRC/M1
FAN
BULB
RL1,RL2,RL3
ZIGBEE MODULE
PCB
Others
TOTAL
QUANTITY COST
(Rs.)
3
18
3
7.50
17
8.50
3
7.5
2
1
3
1.50
6
12
1
1
5
2.5
3
12
13
2
1
5
1
1
4
1
1
3
3
1
3
1
1
1
4
5
3
5
5
2.5
0.5
0.5
1
0.5
0.5
1.5
5
12
1500
35
5
125
46
120
20,000
4050
100
26,083.5
59