ABSTRACT India is agriculture country and require the system to increase agriculture products with the help of existing environment conditions by optimize use. Also to save the manpower, water resources, energy resources, we need optimized system to increase the agriculture products. Greenhouse is the best system in the world. To monitor and controlling various parameters such as humidity, temperature, light, water level etc. in the greenhouse, a low cost, effective wireless system is required. Zigbee is wireless sensor networks due to their low cost, simplicity and mobility, is best suitable for the wireless system. In the current study, we will compare the advantages of Zigbee with other two similar wireless networking protocols like Wi-Fi &Bluetooth, and will propose a wireless solution for greenhouse monitoring and controlling system based on Zigbee technology. i
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
ABSTRACT
India is agriculture country and require the system to increase
agriculture products with the help of existing environment conditions by
optimize use. Also to save the manpower, water resources, energy
resources, we need optimized system to increase the agriculture products.
Greenhouse is the best system in the world.
To monitor and controlling various parameters such as humidity,
temperature, light, water level etc. in the greenhouse, a low cost, effective
wireless system is required.
Zigbee is wireless sensor networks due to their low cost, simplicity
and mobility, is best suitable for the wireless system. In the current study,
we will compare the advantages of Zigbee with other two similar wireless
networking protocols like Wi-Fi &Bluetooth, and will propose a wireless
solution for greenhouse monitoring and controlling system based on
Zigbee technology.
i
LIST OF FIGURES
No. Figure Description Page
No.
2.1 The Greenhouse Effect
3.1 Basic Model Of System
3.2 Temperature Sensor
3.3 Humidity Sensor
3.4 Light Sensor
3.5 Circuit Diagram
3.6 Soil Moisture Sensor
3.7 Getting Data From Analog World
3.8 Block Diagram Of ADC0808/0809
3.9 Pin Diagram Of ADC 0808/0809
3.10 ADC 0808 Pin Detail Used For This
Application
3.11 Pin Diagram Of AT89S52
3.12 Block Diagram Of Microcontroller(AT89S52)
3.13 Power-On Reset Circuit
3.14 The Oscillator Clock Circuit
3.15 Pin Diagram Of LCD Display
3.16 Sugar Cube Relay
3.17 Relay Circuitry
3.18 Block Diagram Of Power Supply Connection
3.19 +5V Power Supply Connection
3.20 +12V Power Supply Connection
ii
3.21 Star Topology
3.22 Peer to Peer Topology
3.23 Cluster Tree Topology
3.24 Architecture Of Zigbee
iii
LIST OF TABLES
Table
No.
Name of Table Page No.
3.1 Selection Of The Input Channel
3.2 Alternate Function Of Port 3
3.3 Pin Description Of The LCD
3.4 Difference Between Zigbee, Wi-Fi &
Bluetooth
iv
TABLE OF CONTENT
Acknowledgement i
Abstract v
List of figures v
List of tables v
Table of content v
Company Profile
CHAPTER:1 Introduction 1-2
1.1 Project Objective 1
1.2 Overview 1
1.3 Aim Of Project 2
1.4 Literature Survey 2
CHAPTER :2 Greenhouse And Greenhouse effect 3-8
2.1 What Is Greenhouse? 3
2.2 Greenhouse Environment 4
2.2.1 Temperature 4
2.2.2 Moisture 4
2.2.3 Pest Control 5
2.2.4 Nutrition 5
2.3 Greenhouse Effect 5
2.3.1 What Is Greenhouse Effect? 6
2.3.2 Causes Of Greenhouse Effect 7
2.3.3 Problem Of Greenhouse Effect 7
v
2.3.4 Role Of Carbon Dioxide In Greenhouse Effect 8
CHAPTER:3 Design Element 9-45
3.1 Basic Model Of The System 9
3.2 Parts Of The System 10
3.3 Sensors 10
3.3.1 Temperature Sensor 11
3.3.1.1 Features 12
3.3.2 Humidity Sensor 12
3.3.2.1 Features 13
3.3.2.2 Specifications 14
3.3.3 Light Sensor 14
3.3.3.1 Features 15
3.3.3.2 Functional Description 15
3.3.4 Soil Moisture Sensor 16
3.3.4.1 Features 16
3.3.4.2 Functional Description 16
3.4 Analog To Digital Converter (ADC 0808/0809) 17
3.4.1 Description 17
3.4.2 Features 18
3.4.3 Pin Diagram Of ADC(0808/0809) 19
3.4.4 Selecting An Analog Channel 20
3.5 Microcontroller (AT89S52) 21
3.5.1 Criteria For Choosing A Microcontroller 21
3.5.2 Description 22
3.5.3 Features 23
3.5.4 Pin Diagram 24
3.5.5 Block Diagram 24
3.5.6 Pin Description 25
vi
3.5.6.1 Power-On Reset Circuit 26
3.5.6.2 Oscillator Clock Circuit 27
3.5.7 Special Function Registers 28
3.5.8 Timers And Counters 29
3.5.9 Interrupts 30
3.5.10 Microcontroller Configuration Used In Set-Up 30
3.6 Liquid Crystal Display 31
3.6.1 Signal To The LCD 31
3.6.1.1 Logic Status On Control Lines 32
3.6.1.2 Writing And Reading The Data From LCD 32
3.6.2 Pin Description 32
3.7 Actuators-Relays 33
3.8 Power Supply Connection 34
3.9 Zigbee Protocol 36
3.9.1 Introduction 36
3.9.2 Why It Is Called Zigbee? 37
3.9.3 Network Characteristics Of Zigbee Devices 37
3.9.4 Device Types 37
3.9.5 Network Topology 38
3.9.5.1 Star Topology 38
3.9.5.2 Peer To Peer Topology 39
3.9.5.3 Cluster Tree Topology 39
3.9.6 Architecture 40
3.9.6.1 Network & Application layer 40
3.9.6.2 Physical (PHY) Layer 41
3.9.6.3 Media Access Control (MAC) Layer 41
3.9.7 Difference Between Zigbee,Wi-Fi & Bluetooth 42
3.9.8 Why We Use Zigbee? 43
vii
3.10 Device Controlled 43
3.10.1 Temperature Controller In Greenhouse 43
3.10.1.1 Cooling Equipment 44
3.10.1.2 Heating Equipment 44
3.10.2 Humidity Control In Greenhouse 44
3.10.3 Artificial Light For Controlling Light 45
Conclusion 46
References 47
viii
COMPANY PROFILE:
Fig. Sahajanand Laser Technology Pvt. Ltd
Sahajanand Technologies (P) Ltd. was incorporated in 1993, is a name to reckon with as a
trendsetter in development of abreast diamond processing equipment’s, deploying
revolutionary Laser light. ‘Sahajanand’ name uniquely represents leadership in
technology transfer and innovation for quality product development. Established in the
year 1993 by Mr.Dhirajlal Kotadia, the company has emerged as a pioneer in the diamond
industry for its hi-end engineering products.
Company is driven by the motto of continuous innovation to develop products that deliver
cutting edge performance with value for money for our customers. We are committed to
develop technology solutions for client performance excellence. We have articulated a
distinct market sensing mechanism to analyze market trends, customer needs and industry
requirements. This brought a unique set of capabilities for us to develop customer centric
technology solutions. We are a leading manufacturer and exporter of Laser technology
centered capital equipment’s for diamond manufacturing industry. We present ‘Total
technology solutions for diamond industry under one roof.’ Our product portfolio broadly
includes Diamond Planner Systems, Laser driven Diamond Processing equipment’s, Auto
blocking & Polishing Machines etc. used at different stages of diamond manufacturing
process.
ix
Everyday we live the Sahajanand tradition of engineering excellence and core values of
quality, safety, integrity, understanding and responsibility. We are also committed to
bring these technologies within the reach of every Indian engaged in these industries. By
promoting indigenously manufactured technology products, we save valuable foreign
exchange and generate employment. We contribute immensely in the growth of the
society by actively doing the philanthropic activities in field of health, education and
community development.
Being in the industry for more than 15 years, we earned vast experience of dynamics of
Diamond Industry. We started from scratch & created a right platform in Indian market.
By virtue of this prolonged attachment with the industry & confidence in our capabilities
we believed that it is not impossible to develop such technology in India. We followed
our, instincts & developed a range of hi-tech-yet cost effective products. We have trained
our work force to harmonize with Diamond Industry trends & successfully educated
thousands of workers to use our machines
x
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
CHAPTER-1
INTRODUCTION
1.1. PROJECT OBJECTIVE
In this chapter introduction of the GREENHOUSE EFFECT MONITORING AND
CONTROLLING USING ZIGBEE TECHNOLOGY are discussed. It gives overall
view of the project design and the related literature and the environment to be considered.
At first we discuss the main processing done using 8051 microcontroller is and then what
is the process that can be automated which is within the scope of the work. Then we
discuss the implementation aspects.
1.2 OVERVIEW
We are using a Zigbee based network for Greenhouse effect monitoring and controlling.
This way of communication is actually done with Zigbee network topology. Each sensors
will senses the condition of Temperature, Humidity, soil moisture as well as light is
monitored and if there is any change in the condition of Temperature, Humidity, soil
moisture as well as light then it immediately sends that changed data through Zigbee to
the local system where the main module is connected to the computer to maintain the
status of the Greenhouse.
There are many sensors are used in greenhouse monitoring and controlling using Zigbee,
Likewise Temperature, Humidity, soil moisture, and Light sensors. These sensors sense
the Temperature, Humidity, soil moisture, And Light respectively. After it applied to the
Analog to Digital Converter (ADC), And it converts the Analog signal to Digital code.
And it applied to the Transmitter module of Zigbee. This Zigbee module sends to another
Receiver module of Zigbee through wireless communication. After receiving, this code is
applied to the Liquid Crystal Display (LCD) through Microcontroller. In LCD the
condition of Temperature, Humidity, Soil moisture, and light is displayed in terms of
digital code. If there is a change in Temperature, Humidity, soil moisture, and light then
for maintain a proper value we use the water pump, cooler, artificial light are used.
GTU-SPCE-7TH SEM-EC Page 1
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
1.3 AIM OF THE PROJECT
The main processes involved in this type of control system are to monitor the Greenhouse
effect status. Zigbee is a wireless connection network that is used to connect different
devices at a frequency of 2.4GHz. The Zigbee can communicate with the devices of
about 10-100m.
1.4 LITERATURE SURVEY
The technical brilliance and development in different fields has led to a drastic in our
lives, one among them is embedded systems. The application of these devices is to
monitor and control the Greenhouse effect status. Zigbee is a wireless connection network
that is used to connect different devices at a frequency of 2.4GHz. The Zigbee can
communicate with the devices of about 10-100m.
GTU-SPCE-7TH SEM-EC Page 2
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
CHAPTER-2
GREENHOUSE AND GREENHOUSE EFFECT
2.1 WHAT IS GREENHOUSE?
A greenhouse is a structural building with different types of covering materials, such as
a glass or plastic roof and frequently glass or plastic walls; it heats up because incoming
visible solar radiation (for which the glass is transparent) from the sun is absorbed by
plants, soil, and other things inside the building. Air warmed by the heat from hot interior
surfaces is retained in the building by the roof and wall.
In addition, the warmed structures and plants inside the greenhouse re-radiate some of
their thermal energy in the infrared spectrum, to which glass is partly opaque, so some of
this energy is also trapped inside the glasshouse. However, this latter process is a minor
player compared with the former (convective) process. Thus, the primary heating
mechanism of a greenhouse is convection. This can be demonstrated by opening a small
window near the roof of a greenhouse: the temperature drops considerably.
This principle is the basis of the auto vent automatic cooling system. Thus, the glass used
for a greenhouse works as a barrier to air flow, and its effect is to trap energy within the
greenhouse. The air that is warmed near the ground is prevented from rising indefinitely
and flowing away.
Although heat loss due to thermal conduction through the glass and other building
materials occurs, net energy (and therefore temperature) increases inside the greenhouse.
What is the purpose/function of a greenhouse?
The basic function is to provide a protective environment for
crop(plant) production.
GTU-SPCE-7TH SEM-EC Page 3
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
A structure, primarily of glass, in which temperature and humidity can be controlled
for the cultivation or protection of plants
2.2 GREENHOUSE ENVIRONMENT
What things make up the greenhouse environment?
Temperature
Moisture
Pest Control
Nutrition
2.2.1 TEMPERATURE
Different plants have different temperature “preferences” for optimum growth.
Some plants prefer cool or even cold temps
Some plants prefer warm or hot temps
The trick is to provide a temperature range that is conducive to plant growth.
Grow plants together that prefer the same temperature range.
Temperature ranges must be conducive to crop production
The cost of heat is the second highest expense of greenhouse plant production.
(labor is the greatest expense)
Greenhouses lose heat through the plastic, glass, etc. and additional heat has to
be provided especially in winter.
2.2.2 MOISTURE
Moisture must also be conducive to plant production
Some plants need dry environments, while others need very wet
environments.
How are moisture levels controlled?
Watering
GTU-SPCE-7TH SEM-EC Page 4
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Humidity
Level of water vapor in the air.
2.2.3 PEST CONTROL
Pest Control refers to the regulation or management of a species defined as a
pest, usually because it is perceived to detrimental to a person’s health, the
ecology or the economy.
One of the biggest problems growers face is pest control.
What types of pests? And Greenhouses must be kept free of:
Insects (aphids, whiteflies, etc)
Diseases (fungus, bacteria, viral)
Weeds (oxalis, henbit, etc)
Rodents (mice, rats)
2.2.4 NUTRITION
Nutrition is the provision, to cells and organisms, of the materials
necessary (in the form of food) to support life.
Plants, like animals, need nutrients to survive.
Growers provide plants with the nutrients they need by supplementing either
the water or soil with added nutrients.
Growers also have to ensure adequate ventilation.
Carbon dioxide
Nutrition must be monitored in:
Soil
Water
Air (ventilation is necessary to supply carbon dioxide)
2.3 GREENHOUSE EFFECT
GTU-SPCE-7TH SEM-EC Page 5
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Green House Effect is heating up of earth's atmosphere due to the trapping of intra-red
ray. (Reflected from the earth's surface) by the carbon dioxide layer in the atmosphere
is called green-house effect.
The green-house effect in the atmosphere occurs due to the presence of a blanket of
carbon-dioxide gas in the atmosphere. This blanket of carbon dioxide gas in the
atmosphere allows the sunlight to come in freely but does not allow the intra-red radiation
reflected by the earth's surface to go out. It is just because the sun light can come in freely
but the intra-red rays cannot go out freely that the temperature of earth's atmosphere is
raised.
The rise in temperature produce gas in the by green-house effect on earth's atmosphere
depends on the amount of carbon dioxide gas in the atmosphere. In other words, the
proportion of carbon dioxide in atmosphere affects the temperature of atmosphere. So, if
the proportion of carbon dioxide gas in the atmosphere increases, than the temperature of
earth's atmosphere will also rise further.
2.3.1 WHAT IS GREENHOUSE EFFECT?
“The greenhouse effect is a process by which thermal radiation from a planetary surface
is absorbed by atmospheric greenhouse gases, and is re-radiated in all directions. Since
part of this re-radiation is back towards the surface and the lower atmosphere, it results in
an
GTU-SPCE-7TH SEM-EC Page 6
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
elevation of the average surface temperature above what it would be in the absence of the
gases.”
Fig.2.1-The Greenhouse Effect
The sun emits the radiation to the Earth, radiating energy at very short wavelengths,
predominately in visible or near-visible (e.g. ultraviolet) part of spectrum.
Approximately one-third of the solar energy that reaches the top of Earth atmosphere is
reflected directly back to space. The remaining two-third is absorbed by the surface and,
to a lesser area, by the atmosphere.
To balance the absorbed incoming energy, the Earth must, on average radiate the same
amount of energy back to space. Because the Earth is much colder than the sun, it
radiates at much longer wavelengths, primarily in the infrared part of the spectrum (see
fig).Much of this thermal radiation emitted by the land and ocean is absorb by the
atmosphere, including clouds, and reradiated back to Earth. This is called the
Greenhouse effect.
The glass walls in a greenhouse reduce airflow and increase the temperature of the air
inside. But through a different physical process, the Earth’s greenhouse effect warms
the surface of the planet. Without the natural greenhouse effect, the average temperature
GTU-SPCE-7TH SEM-EC Page 7
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
at Earth’s surface would be below the freezing point of water. Thus, Earth’s natural
greenhouse effect makes life as we know it possible.
However, human activities, primarily the burning of fossil fuels and clearing of forests,
have greatly intensified the natural greenhouse effect, causing global warming.
2.3.2 CAUSES OF GREENHOUSE EFFECT
The principal cause of Green-House effect is the increase in the quantity of greenhouse
gases like CO2 in the atmosphere. The naturally occurring "Green House gases",
including carbon dioxide, methane, nitrous oxide and water vapor, keep ground
temperature at a global average of 150 Celsius.. The greenhouse gases keep the surface
warm because as incoming solar radiation strikes earths, the surface gives off infrared
radiation or heat that the gases temporarily trap and keep near ground level.
2.3.3 PROBLEM FROM GREENHOUSE EFFECT
The problem is that human activity may be making the greenhouse gas cover "thicker"
For example, burning tonsil fuel throws huge amounts of CO2 into the air, the destruction
of forests allows carbon stored in the trees to escape into the atmosphere and other
activities such as raising cattle and planting rice emit methane, nitrous oxide, and other
greenhouse gases. Until mankind began burning fossil fuels, green house gases that occur
naturally remained in relative balance. But the beginning of the Industrial Revolution in
Britain ushered in rapid industrialization that greatly increased man's assault on the
ecology.
2.3.4 ROLE OF CARBON DIOXIDE IN GREEN HOUSE EFFECT
The carbon dioxide in the atmosphere also performs another major role. The earth
receives light of different wavelengths from the sun. The Ozone in the upper atmosphere
absorbs most of the harmful ultraviolet radiation and lets the other wavelengths pass
through. However, some of the light incident on earth is reflected back in the form of
intra-red light that is light whose wavelength is greater than that of red light. Carbon
dioxide molecules have the ability to absorb the intra-red radiation reflected from the
earth. A layer of CO2 can, therefore, trap intra-red light in the atmosphere causing the
GTU-SPCE-7TH SEM-EC Page 8
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
atmosphere to heat up-This heating due to trapped radiation is called the Green House
effect.
Infect the name green house is derived from a glass structure used to cultivate putted
plants in some countries water vapors and ozone also have the ability to trap intra-red
radiation and also sometimes referred to as greenhouse gases. However, water vapors is
only found near the surface of the earth and ozone only in the upper reaches of the
atmosphere carbon dioxide which is much more evenly distributed in the atmosphere and
contributes to the greenhouse effect to a larger extent.
The proportion of carbon dioxide can therefore, effect the temperature of the atmosphere.
If this proportion increases, the temperature is liable to rise.
Green plants absorb most of the excess CO2 from the atmosphere and give back healthy
oxygen in return. By destroying green plants and trees we destroy those very agents that
clean our atmosphere. A forestation, that is, the replanting of destroyed trees and forests
is one solution for preserving a healthy proportion of CO2 in the atmosphere. If the green
house effect is understood correctly, this would have increased the average temperature of
the earth by it.
GTU-SPCE-7TH SEM-EC Page 9
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
CHAPTER-3
DESIGN ELEMENT
3.1 BASIC MODEL OF SYSTEM
Fig.3.1-Basic Model of system
GTU-SPCE-7TH SEM-EC Page 10
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
We are using a Zigbee based network for Greenhouse effect monitoring and controlling.
This way of communication is actually done with Zigbee network topology. Each sensors
will senses the condition of Temperature, Humidity, soil moisture as well as light is
monitored and if there is any change in the condition of Temperature, Humidity, soil
moisture as well as light then it immediately sends that changed data through Zigbee to
the local system where the main module is connected to the computer to maintain the
status of the Greenhouse.
There are many sensors are used in greenhouse monitoring and controlling using Zigbee,
Likewise Temperature, Humidity, soil moisture, and Light sensors. This sensors senses
the Temperature, Humidity, soil moisture, And Light respectively. After it applied to the
Analog to Digital Converter (ADC) and it converts the Analog signal to Digital code.
And it applied to the Transmitter module of Zigbee. This Zigbee module sends to another
Receiver module of Zigbee through wireless communication. After receiving, this code is
applied to the Liquid Crystal Display (LCD) through Microcontroller. In LCD the
condition of Temperature, Humidity, Soil moisture, and light is displayed in terms of
digital code. If there is a change in Temperature, Humidity, soil moisture, and light then
for maintain a proper value we use the water pump, cooler, artificial light are used.
3.2 PARTS OF THE STSTEM
Sensors (Data acquisition system)
Temperature sensor (LM35)
Humidity sensor
Light sensor (LDR)
Soil Moisture sensor
Analog to Digital Converter ( ADC0808/0809)
Microcontroller (AT89S52)
Liquid Crystal Display (Hitachi'sHD44780)
Actuators – Relays
Devices controlled
Water Pump (simulated as a bulb)
Sprayer (simulated as a bulb)
Cooler (simulated as a fan)
GTU-SPCE-7TH SEM-EC Page 11
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Artificial Lights (simulated as a bulb)
Zigbee
3.3 SENSORS
There are four sensors are used in the block diagram. There are
1. Temperature sensor
2. Humidity sensor
3. Light sensor
4. Soil moisture sensor
3.3.1 TEMPERATURE SENSOR
Fig 3.2-Temperature Sensor
Several temperature sensing techniques are currently in widespread usage. The most
common of these are RTDs, thermocouples, thermistors, and sensor ICs. The right one for
your application depends on the required temperature range, linearity, accuracy, cost,
features, and ease of designing the necessary support circuitry. In this section we discuss
the characteristics of the most common temperature sensing techniques. But the cost of
real time temperature sensor is not affordable. Hence in this project we used a
GTU-SPCE-7TH SEM-EC Page 12
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
potentiometer to display body temperature. By using this we are showing a prototype how
it can works when we use an LM35 sensor.
These sensors use a solid-state technique to determine the temperature. That is to say,
they don't use mercury (like old thermometers), bimetallic strips (like in some home
thermometers or stoves), nor do they use thermistors (temperature sensitive resistors).
Instead, they use the fact as temperature increases, the voltage across a diode increases at
a known rate. (Technically, this is actually the voltage drop between the base and emitter
- the Vbe - of a transistor. By precisely amplifying the voltage change, it is easy to
generate an analog signal that is directly proportional to temperature. There have been
some improvements on the technique but, essentially that is how temperature is measured.
Because these sensors have no moving parts, they are precise, never wear out, don't need
calibration, work under many environmental conditions, and are consistent between
sensors and readings. Moreover they are very inexpensive and quite easy to use.
3.3.1.1 FEATURES
i. Calibrated directly in °Celsius (Centigrade)ii. Linear + 10.0 mV/°C scale factor
iii. 0.5°C accuracy guaranteed (at +25°C)iv. Rated for full−55° to +150°C rangev. Suitable for remote applications
vi. Low cost due to wafer-level trimmingvii. Operates from 4 to 30 volts
viii. Less than 60µA current drainix. Low self-heating, 0.08°C in still airx. Nonlinearity only ±1⁄ 4°C typical
3.3.2 HUMIDITY SENSOR
GTU-SPCE-7TH SEM-EC Page 13
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Fig 3.3 Humidity Sensor
According to the measurement units, humidity sensors are divided into two types:
Relative humidity (RH) sensors and absolute humidity (moisture) sensors. Most humidity
sensors are relative humidity sensors.
As there no real physical standard for relative humidity calibration, humidity instruments
are not specified properly. And it makes it really difficult for a user to compare the
sensors from different manufacturers. This makes it mandatory for a user to go deeper
into the specifications and attempt to verify the claims of the instrument manufacturer.
Humidity is the presence of water in air. The amount of water vapor in air can affect
human comfort as well as many manufacturing processes in industries. The presence of
water vapor also influences various physical, chemical, and biological processes.
Humidity measurement in industries is critical because it may affect the business cost of
the product and the health and safety of the personnel. Hence, humidity sensing is very
important, especially in the control systems for industrial processes and human comfort.
Controlling or monitoring humidity is of principal importance in many industrial &
domestic applications. In semiconductor industry, humidity or moisture levels needs to be
properly controlled & monitored during wafer processing. In medical applications,
humidity control is required for respiratory equipments, sterilizers, incubators,
pharmaceutical processing, and biological products.
Humidity control is also necessary in chemical gas purification, dryers, ovens, film
desiccation, paper and textile production, and food processing. In agriculture,
measurement of humidity is important for plantation protection (dew prevention), soil
moisture monitoring, etc. For domestic applications, humidity control is required for
living environment in buildings, cooking control for microwave ovens, etc. In all such
applications and many others, humidity sensors are employed to provide an indication of
the moisture levels in the environment.
The humidity sensor HH10D is used for sensing humidity. Relative humidity is a
measure, in percentage of the vapour in the air compared to the total amount of vapour
GTU-SPCE-7TH SEM-EC Page 14
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
that could be held in the air at a given temperature.HH10D gives the output in terms
of frequency at a range of 5 kHz to 10 kHz from frequency out pin.
3.3.2.1 FEATURES
i. Relative humidity sensor.
ii.Two point calibrated with capacitor type sensor, excellent performance.
iii. Frequency output type can be easily integrated with user application system.
iv. Very low power consumption.
v. No extra components needed.
3.3.2.2 SPECIFICATION:-
Range: 0% to 95%
Power: 0.0002 A @5Vdc
Response Time (time for 90% change in reading):
In still air: 60 minutes (typical)
With vigorous air movement: 40 seconds (typical)
Resolution: 0.04% RH
Stored calibration:
Slop: 30.43% per Volt
Intercept: -25.81%
Total accuracy (With saturated salt calibration): ±2% RH
Total accuracy (With standard calibration): ±10% RH
Operating Temperature Range: 0 to 85°C
Temperature Effect on 0%RH voltage: ±0.007% RH/°C(negligible)
Temperature Effect on 50%RH voltage: –0.11% RH/°C
Temperature Effect on 95%RH voltage: –0.22% RH/°C
GTU-SPCE-7TH SEM-EC Page 15
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
3.3.3 LIGHT SENSOR(LIGHT DEPENDENT RESISTOR)
Fig 3.4-Light sensor
Light Dependent Resistor (LDR) also known as photoconductor or photocell,
is a device which has a resistance which varies according to the amount of
light falling on its surface. Since LDR is extremely sensitive in visible light
range, it is well suited for the proposed Application.
3.3.3.1 FEATURES:
The Light Dependent Resistor (LDR) is made using the semiconductor Cadmium
Sulphide (CdS).The light falling on the brown zigzag lines on the sensor causes the
resistance of the device to fall. This is known as a negative co-efficient. There are some
LDRs that work in the opposite way i.e. their resistance increases with light (called
positive co- efficient).The resistance of the LDR decreases as the intensity of the light
falling on it increases. Incident photons drive electrons from the valence band into the
conduction band. Fig. Structure of a Light Dependent Resistor, showing Cadmium
Sulphide track and an atom to illustrate electrons in the valence and conduction bands.
3.3.3.2 FUNCTIONAL DISCRIPTION
An LDR and a normal resistor are wired in series across a voltage, as shown in
the circuit below. Depending on which is tied to the 5V and which to 0V, the voltage
at the point between them, call it the sensor node, will either rise or f all with
increasing light. If the LDR is the component tied directly to the 5V, the sensor node
will increase in voltage with increasing light .The LDR’s resistance can reach 10 k
ohms in dark conditions and about 100ohms in full brightness. The circuit used for
GTU-SPCE-7TH SEM-EC Page 16
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
sensing light in our system uses a 10 k Ω fixed resistor which is attached to +5V.
Hence the voltage value in this case decreases with increase in light intensity.
Fig 3.5- Circuit Diagram
The sensor node voltage is compared with the threshold voltages for different Levels
of light intensity corresponding to the four conditions- Optimum, dim, dark and night.
The relationship between the resistance RL and light intensity Lux for a typical LDR is:
RL= 500 / Lux kΩ…(3.1)
With the LDR connected to 5V through a 10KΩ resistor, the output voltage of the LDR
is:
Vo = 5*RL / (RL+10)… (3.2)
In order to increase the sensitivity of the sensor we must reduce the value of the
fixed resistor in series with the sensor. This may be done by putting other resistors in
parallel with it.
3.3.4 SOIL MOISTURE SENSOR
3.3.4.1 FEATURES
1. The circuit designed uses a 5V supply, fixed resistance of 100Ω, variable resistance of
10ΚΩ, two copper leads as the sensor probes, 2N222N transistor.
2. It gives a voltage output corresponding to the conductivity of the soil.
3. The conductivity of soil depends upon the amount of moisture present in it. It increases
with increase in the water content of the soil.
GTU-SPCE-7TH SEM-EC Page 17
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
4. The voltage output is taken at the transmitter which is connected to a variable
resistance. This variable resistance is used to adjust the sensitivity of the sensor.
Fig 3.6-Soil moisture sensor
3.3.4.2 FUNCTIONAL DISCRIPTION:
The two copper leads act as the sensor probes. They are absorbed into the variety soil
whose moisture content is under test. The soil is examined under three conditions:
Condition 1: Dry condition- The probes are placed in the soil under dry conditions and
are inserted up to a fair depth of the soil. As there is no conduction path between the two
copper leads the sensor circuit remains open. The voltage output of the emitter in this case
ranges from 0 to 0.5V.
Condition 1: Optimum condition- When water is added to the soil, it percolates through
the successive layers of it and spreads across the layers of soil due to tube force. This
water increases the moisture content of the soil. This leads to an increase in its
conductivity which forms a conductive path between the two sensor probes leading to a
close path for the current flowing from the supply to the transistor through the sensor
probes. The voltage output of the circuit taken at the emitter of the transistor in the
optimum case ranges from 1.9 to 3.4V approximately.
Condition 3: Overload water condition- With the increase in water content beyond the
optimum level, the conductivity of the soil increases significantly and a steady conduction
path is established between the two sensor leads and the voltage output from the sensor
increases no further beyond a certain limit. The maximum possible value for it is not
more than 4.2V.
GTU-SPCE-7TH SEM-EC Page 18
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
3.4 ANALOG TO DIGITAL CONVERTER (ADC 0808/0809)
In physical world parameters such as temperature, pressure, humidity, and velocity are
analog signals. A physical quantity is converted into electrical signals. We need an analog
to digital converter (ADC), which is an electronic circuit that converts continuous signals
into discrete form so that the microcontroller can read the data. Analog to digital
converters are the most widely used devices for data acquisition.
Fig 3.7-Getting data from the analog world
3.4.1 DESCRIPTION
The ADC0808 data acquisition component is a monolithic CMOS device with an 8- bit
analog-to-digital converter, 8-channel multiplexer and microprocessor compatible control
logic. The 8-bit A/D converter uses successive approximation as the conversion
technique.
The converter features a high impedance chopper stabilized comparator, a 256R voltage
divider with analog switch tree and a successive approximation register. The 8-channel
multiplexer can directly access any of 8-single-ended analog signals.
The design of the ADC0808 has been optimized by incorporating the most desirable
aspects of several A/D conversion techniques. The device offers high speed, high
accuracy, minimal temperature dependence, excellent long-term accuracy and
repeatability, and consumes minimal power. These features make it ideally suited for
applications from process and machine control to consumer and automotive
applications.
3.4.2 FEATURES
i. Easy interface to all microcontrollers.
ii. Operates ratio metrically or with 5 Vdc or analog span adjusted voltage reference.
iii. No zero or full-scale adjust required.
iv. 8-channel multiplexer with address logic.
GTU-SPCE-7TH SEM-EC Page 19
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
v. 0V to 5V input range with single 5V power supply.
vi. Outputs meet TTL voltage level specifications.
vii. 28-pin molded chip carrier package.
Block diagram of ADC 0808/0809
GTU-SPCE-7TH SEM-EC Page 20
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Fig.3.8 Block Diagram of ADC 0808/0809
3.4.3 PIN DIAGRAM OF ADC 0808/0809
Fig.3.9 Pin diagram of ADC 0808/0809
We use A, B, C addresses to select IN0-IN7 and activate Address latch enable (ALE) to
latch in the address. SC is for Start Conversion. EOC is for End of Conversion and OE is
for Output Enable. The output pins D0-D7 provides the digital output from the chip.Vref
(-) and Vref (+) are the reference voltages.
GTU-SPCE-7TH SEM-EC Page 21
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
3.4.4 SELECTING AN ANALOG CHANNEL
How to select the channel using three address pins A, B, C is shown in Table
below:
Select Analog Channel C B A
IN0 0 0 0
IN1 0 0 1
IN2 0 1 0
IN3 0 1 1
IN4 1 0 0
IN5 1 0 1
IN6 1 1 0
IN7 1 1 1
Table 3.1 Selection of the input channels
The ADC 0804 is most widely used chip, but since it has only one analog input, ADC
0808 is chosen as this chip allows the monitoring of up to 8 different transducers using
only a single chip. The 8 analog input channels are multiplexed and selected according to
the requirement. But for the proposed application only the last 4 channels i.e., IN4, IN5,
IN6 and IN7 are used to monitor the four parameters- temperature, humidity, soil
moisture and light intensity. Hence the address line ADD_C is given to Vcc (+ 5V)as it is
always high in this case. Vref (+) and Vref (-) set the reference voltages. If Vref (-) = Gnd
and Vref (+) =5V, the step size is 5V/256=19.53.
Since there is no self-clocking in this chip, the clock must be provided from an external
source to the Clock (CLK) pin. The 8-bit output from the ADC is given to Port 0 of the
microcontroller and the control signals ADD_A,ADD_B,ADD_C,ALE,START,OE,EOC
are given to Port 1 as shown in figure below.
GTU-SPCE-7TH SEM-EC Page 22
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Fig.3.10 ADC 0808 Pin Detail Used For this Application
At a certain point of time, even though there is no conversion in progress the ADC0809 is
still internally cycling through 8 clock periods. A start pulse can occur any time during
this cycle but the conversion will not actually begin until the converter internally cycles to
the beginning of the next 8 clock period sequence. As long as the start pin is held high no
conversion begins, but when the start pin is taken low the conversion will start within 8
clock periods. The EOC output is triggered on the rising edge of the start pulse. It, too, is
controlled by the 8 clock period cycle, so it will go low within 8 clock periods of the
rising edge of the start pulse. One can see that it is entirely possible for EOC to go low
before the conversion starts internally, but this is not important, since the positive
transition of EOC, which occurs at the end of a conversion, is what the control logic is
looking for. Once EOC does go high this signals the interface logic that the data resulting
from the conversion is ready to be read. The output enable (OE) is then raised high.
GTU-SPCE-7TH SEM-EC Page 23
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
3.5. MICROCONTROLLER (AT89S52)
3.5.1 CRITERIA FOR CHOOSING A MICROCONTROLLER
The basic criteria for choosing a microcontroller suitable for the application are:
1) The first and primary criterion is that it must meet the task at hand efficiently and
cost effectively. In analyzing the needs of a microcontroller-based project, it is seen
whether an 8-bit, 16-bit or 32-bit microcontroller can best handle the computing
needs of the task most effectively. Among the other considerations in this category
are:
ii. Speed: The highest speed that the microcontroller supports.
iii. Packaging: It may be a 40-pin DIP (dual inline package) or a QFP (Quad Flat
Package), or some other packaging format. This is important in terms of space,
assembling, and prototyping the end product.
iv. Power consumption: This is especially critical for battery-powered products.
iv. The number of I/O pins and the timer on the chip.
v. How easy it is to upgrade to higher –performance or lower consumption versions.
vi. Cost per unit: This is important in terms of the final cost of the product in which a
microcontroller is used.
2) The second criterion in choosing a microcontroller is how easy it is to develop
products around it. Key considerations include the availability of an assembler,
debugger, compiler, technical support.
3) The third criterion in choosing a microcontroller is its ready availability in needed
quantities both now and in the future. Currently of the leading 8-bitmicrocontrollers,
the 8051 family has the largest number of diversified suppliers. By supplier is meant a
producer besides the originator of the microcontroller. In the case of the 8051, this has
originated by Intel several companies also currently producing the 8051. Thus the
microcontroller AT89S52, satisfying the criterion necessary for the proposed
application is chosen for the task.
GTU-SPCE-7TH SEM-EC Page 24
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
3.5.2 DESCRIPTION:
The 8051 family of microcontrollers is based on an architecture which is highly
optimized for embedded control systems. It is used in a wide variety of applications from
military equipment to automobiles to the keyboard. Second only to the Motorola68HC11
in eight bit processors sales, the 8051 family of microcontrollers is available in a wide
array of variations from manufactures such as Intel, Philips, and Siemens. These
manufacturers have added numerous features and peripherals to the 8051 such as
I2Cinterfaces, analog to digital converters, watchdog timers, and pulse width modulated
outputs. Variations of the 8051 with clock speeds up to 40MHz and voltage requirements
down to 1.5 volts are available. This wide range of parts based on one core makes the
8051 family an excellent choice as the base architecture for a company’s entire line of
products since it can perform many functions and developers will only have to learn this
one platform.
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K
bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the
industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the
program memory to be reprogrammed in-system or by a conventional nonvolatile
memory programmer. By combining a versatile 8-bit CPU with in-system programmable
Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which
provides a highly-flexible and cost-effective solution to many embedded
control applications. 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 oscillator, disabling all other chip functions until the next interrupt or
hardware reset.
3.5.3 FEATURES:
GTU-SPCE-7TH SEM-EC Page 25
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
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.
3.5.4 PIN DIAGRAM:-
Fig.3.11 Pin Diagram of AT89S52
GTU-SPCE-7TH SEM-EC Page 26
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
3.5.5 BLOCK DIAGRAM
Fig.3.12 Block diagram of Microcontroller (AT89S52)
3.5.6 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
GTU-SPCE-7TH SEM-EC Page 27
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
address/data bus during accesses to external program and data memory. Port 0 also
receives the code bytes during Flash Programming, and outputs the code bytes 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.
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 2pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3pins that
are externally being pulled low will source current (IIL) because of the pull-ups. Port 3
receives some control signals for Flash programming and verification. A high on this
input pin for two machine cycle, while the oscillator running resets the device. Port 3also
serves the functions of various special features of the AT89S52, as shown in the
following table.
P3 Bit Function Pin
P3.0 R×D (serial input port) 10
P3.1 T×D (serial output port) 11
P3.2 (external interrupt) 12
P3.3 (external interrupt) 13
P3.4 T0 (Timer/Counter 0 external i/p) 14
P3.5 T1(Timer/Counter 1 external i/p) 15
P3.6 (external data memory write strobe) 16
P3.7 (external data memory read strobe) 17
GTU-SPCE-7TH SEM-EC Page 28
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Table 3.2- Alternate functions of Port 3
RST: A high on this pin for two machine cycles while the oscillator is running resets. the
device. This pin drives high for 98 oscillator periods after the watchdog times out.
3.5.6.1 POWER –ON RESET CIRCUIT
Fig. 3.13 Power-on reset circuit
In order for the RESET input to be effective, it must have a minimum duration of two
machine cycles.
ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also the program pulse input
(PROG) during Flash programming. In normal operation, ALE is emitted at a constant
rate of 1/6 the oscillator frequency and may be used for external timing or clocking
purposes. Note, however, that one ALE pulse is skipped during each access to external
data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
GTU-SPCE-7TH SEM-EC Page 29
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
PSEN: Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
EA/VPP: External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1: Input to the inverting oscillator amplifier and input to the internal
clock operating circuit.
XTAL2: Output from the inverting oscillator amplifier. A crystal may be connected
between XTAL2 and XTAL1.
3.5.6.2 OSCILLATOR CLOCK CIRCUIT
Fig 3.14 The Oscillator Clock Circuit
It uses a quartz crystal oscillator.
• We can observe the frequency on the XTAL2 pin.
• The crystal frequency is the basic internal frequency of the microcontroller.
• The internal counters must divide the basic clock rate to yield standard
communication bit per second (baud) rates.
GTU-SPCE-7TH SEM-EC Page 30
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
• An 11.0592 megahertz crystal, although seemingly an odd value, yields a crystal
frequency of 921.6 kilohertz, which can be divided evenly by the standard
communication baud rates of 19200, 9600, 4800, 2400, 1200, and 300 hertz.
3.5.7 SPECIAL FUNCTION REGISTERS
The Special Function Registers (SFRs) contain memory locations that are used for special
tasks. Each SFR occupies internal RAM from 0x80 to 0xFF.They are 8-bits wide. The
SFR memory consists of important registers like accumulator, B register, interrupt control
register, PSW, timer/counter, power control, four I/O ports, and serial control. Some of
these registers are bit addressable while remaining are byte addressable.
• The A (accumulator) register or accumulator is used for most ALU operations and
Boolean Bit manipulations.
• Register B is used for multiplication & division and can also be used for general
purpose storage.
• PSW (Program Status Word) is a bit addressable register.
• PC or program counter is a special 16-bit register. It is not part of SFR. Program
instruction bytes are fetched from locations in memory that are addressed by the PC. It
is used to hold the address of a instruction in the memory.
• Stack Pointer (SP) register is eight bits wide. It is incremented before data is stored
during PUSH and CALL executions. While the stack may reside anywhere in on-chip
RAM, the Stack Pointer is initialized to 07H after a reset. This causes the stack to begin
at location 08H.
• DPTR or data pointer is a special 16-bit register that is accessible as two independent 8-
bit registers: DPL and DPH, which are used to furnish memory addresses for internal
and external code access and external data access.
• Control Registers: Special Function Registers IP, IE, TMOD, TCON, SCON, and
PCON contain control and status bits for the interrupt system, the Timer/Counters, and
the serial port.
• Timer Registers: Register pairs (TH0, TL0) and (TH1, TL1) are the 16-bit Counter
registers for Timer/Counters 0 and 1, respectively.
3.5.8 TIMERS AND COUNTERS
GTU-SPCE-7TH SEM-EC Page 31
GREENHOUSE MONITORING AND CONTROLLING USING ZIGBEE
Many microcontroller applications require the counting of external events such
as the frequency of a pulse train, or the generation of precise internal time delays
between computer actions. Both of these tasks can be accomplished using
software techniques, but software loops for counting or timing keep the
processor occupied so that, other perhaps
More important, functions are not done. Hence the better option is to use
interrupts & the two 16- bit count- up timers. The microcontroller can
programmed for either of the following:
1. Count internal - acting as timer
2. Count external - acting as counter
All counter action is controlled by the TMOD (Timer Mode) and the TCON
(Timer/Counter Control) registers. TCON Timer control SFR contains timer 1&