Greenhouse Monitoring Using Wireless Sensor Network.

GREENHOUSE MONITORING USING WIRELESS SENSOR
NETWORK

MOHD KHAIRY BIN ISMAIL

This report is submitted in partial fulfillment of requirements for the Bachelor Degree of
Electronic Engineering (Wireless Communication)

Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer
Universiti Teknikal Malaysia Melaka

June 2013

ii

iii

iv

v


Dedicated to my parents, my siblings and also my colleagues and friend who had
been supporting me through thick and thin.

vi

ACKNOWLEDGEMENT

First of all I would like to thank to Allah for giving me all the courage and
patient towards completing this project. I would also like to send my appreciation to
my project advisor Mr. Azahari Bin Salleh for giving me all the guidance throughout
this 14 Weeks. Without his support and interest, this final report would not been the
same as presented here.
Nevertheless, my great appreciation dedicated to the people’s around me such
as family and friend that always stay beside me whenever I need them and always
show me their support.

vii

ABSTRACT


A greenhouse is a building where plants are grown. Greenhouses are often
used for growing flowers, vegetables, fruits, and tobacco plant. Most greenhouse
system still uses the manual system in monitoring the temperature and humidity in
the greenhouse, a lot of problem can occurred not for worker but also affected
production rate because the temperature and humidity of greenhouse must be
constantly monitored to ensure optimal conditions. The wireless sensor network can
be used to gather the data from point to point to trace down the local climate
parameters in different parts of the big greenhouse to make the greenhouse
automation system work properly. The aim project is developing a greenhouse
monitoring system to monitor a greenhouse temperature and humidity parameters by
applying the Zigbee a wireless device as the wireless sensor network system. In this
project, Zigbee will be used as a wireless device and the temperature and humidity
sensor will be used to collect data of temperature and humidity in the greenhouse.
This project is combination of hardware such as PIC Microcontroller, LCD Display
and Zigbee as the main hardware components and C Compiler and MP Lab IDE for
the main of software elements that could support up to 100 meters. The data from the
greenhouse will be measured by the sensor and the data that are collected will be
sending to the receiver. The data that has been read will be displayed on the LCD
screen. By using this system, the process of monitoring is easier and it is also cheaper
for installation and maintenance process.


viii

ABSTRAK

Rumah hijau adalah bangunan di mana tumbuhan ditanam. Rumah hijau
sering digunakan untuk menanam bunga, sayur-sayuran, buah-buahan dan tumbuhan
tembakau. Kebanyakan sistem rumah hijau masih menggunakan sistem manual
untuk memantau suhu dan kelembapan dalam rumah hijau di mana banyak masalah
boleh berlaku bukan sahaja untuk pekerja tetapi juga kadar pengeluaran terjejas
kerana suhu dan kelembapan rumah hijau mesti sentiasa dipantau untuk memastikan
keadaan yang optimum. Rangkaian pengesan tanpa wayar boleh digunakan untuk
mengumpul data dari titik ke titik untuk mengesan di bawah parameter iklim
tempatan di bahagian yang berlainan rumah hijau yang besar untuk membuat sistem
automasi rumah hijau berfungsi dengan baik. Tujuan projek adalah pembangunan
sistem pemantauan rumah hijau untuk memantau suhu dan kelembapan rumah hijau
dengan menggunakan ZigBee peranti wayarles sebagai pengesan tanpa wayar.
Dalam projek ini, ZigBee akan digunakan sebagai peranti wayarles manakala
pengesan suhu dan kelembapan akan digunakan untuk mengumpul data suhu dan
kelembapan di dalam rumah hijau itu. Projek ini adalah gabungan perkakasan seperti

PIC Microcontroller, LCD Paparan dan ZigBee sebagai komponen utama dan C
Compiler dan MP Lab IDE untuk elemen perisian yang boleh menyokong jarak
sehingga 100 meter. Data dari rumah hijau itu akan diukur oleh pengesan dan data
yang dikumpul akan menghantar kepada penerima. Data-data yang telah dibaca akan
dipaparkan pada skrin LCD. Dengan menggunakan sistem ini, proses pemantauan
adalah lebih mudah dan ia juga lebih murah untuk pemasangan dan penyelenggaraan
proses.

ix

TABLE OF CONTENT

CHAPTER

I

TITLE

PAGE


Project Title

i

Confirmation of Status Report Form

ii

Declaration

iii

Approval

iv

Dedication

v


Acknowledgement

vi

Abstract

vii

Abstrak

viii

Table of Content

viii

List of Tables

xiii


List of Figures

xiv

List of Appendixes

xvi

List of Abbreviations

xvii

INTRODUCTION

1

1.1 Project Background

1


1.1.1 Wireless Sensor Network Concept

2

1.1.2 Factors of the Greenhouse Network

3

1.2 Problem Statement

5

1.3 Objective of Project

6

1.4 Scope of Project

6


1.5 Thesis Outline

8

x

II

LITERATURE RIVIEW

9

2.1 Greenhouse Monitoring

9

2.1.1 Bluetooth

III


10

2.2 Prototype Greenhouse Environment Monitoring System

11

2.3 Greenhouse Monitoring

11

2.4

Plant Development Factor

13

2.5

Wireless Sensor Network


14

2.5.1 Zigbee

15

2.5.2 Wi-Fi

16

2.6

Humidity and Temperature Sensor (SHT1x / SHT7x)

16

2.7

Universal Asynchronous Receiver/Transmitter (UART)

18

2.8

RS 232 Serial Communication

19

2.9

MAX 232

20

2.10 Comparison Between Zigbee, Wi-Fi and Bluetooth

21

METHODOLOGY

23

3.1 Preliminary Investigation

24

3.2 Analysis

25

3.2.1 Hardware Implementation

28

3.2.1.1 Zigbee

28

3.2.1.2 LCD Display

29

3.2.1.3 Temperature Sensor

30

3.2.1.4 Humidity Sensor

31

3.2.1.5 Microcontroller

33

3.2.1.6 LED

34

3.2.2 Software and Database Element

35

3.2.2.1 Proteus Design Suite 7

35

3.2.2.2 MPLAB IDE 8.50

36

3.2.2.3 C Compiler

36

xi

3.3 Design
3.3.1 Hardware Development Process

38

3.3.2 Software Development Process

39

3.3.2.1 Programming in MPLAB

IV

37

40

3.4 Implementation

42

3.5 Maintenance and Testing

42

RESULTS AND DISCUSSIONS

43

4.1 Test Zigbee’s Connection

44

4.1.1 Procedure

44

4.1.2 Result & Analysis

44

4.2 Test Zigbee’s Range

45

4.2.1 Procedure

45

4.2.2 Result and Analysis

46

4.3 Interfacing LCD Modules with PIC Microcontrollers

48

4.3.1 Hardware Connection

48

4.3.2 Software Connection

49

4.3.3 Result & Analysis

49

4.4 Interfacing Sensors with PIC Microcontrollers

50

4.4.1 Hardware Connection

50

4.4.2 Software Connection

50

4.4.3 Result & Analysis

50

4.5 Using Analog to Digital Converter (ADC)

51

4.5.1 ADC Calculation

51

4.5.2 Result & Analysis

52

4.6 Record Data for Temperature & Humidity

52

4.6.1 Greenhouse Monitoring System Procedure

53

4.6.2 Temperature & Humidity Data

54

4.6.3 Result & Analysis

56

4.7 Discussion

57

xii

V

CONCLUSION AND RECOMMENDATION

58

5.1 Conclusion

58

5.2 Recommendation

59

5.2.1 System

59

5.2.2 Hardware

60

5.2.3 Software

60

REFERENCES

61

APPENDIX A

64

APPENDIX B

65

xiii

LIST OF TABLES

NO

TITLE

PAGE

2.1

SHT1x Pin Description

17

2.2

SHT7x Pin Description

17

2.3

RS 232 Pin Assignments (DB9 PC Signal Set)

20

2.4

RS 232 Line Type and Logic Level

21

2.5

Comparison of Zigbee, Wi-fi and Bluetooth

22

4.1

Analysis of collected data

46

4.2

Temperature & Humidity Reading

54

xiv

LIST OF FIGURES

NO

TITLE

PAGE

2.1

Bluetooth Connections to Other Devices

10

2.2

Greenhouse

12

2.3

Typical Multi-Hop Wireless Sensor Network

15

Architecture
2.4

SHT1x/SHT7x

17

2.5

Transmission of a Byte

18

2.6

PC Serial Connector

19

2.7

MAX 232 Connections

21

3.1

Design Phase

23

3.2

Block Diagram and Project Development

26

3.3

Illustration of Data Communication

27

3.4

Zigbee

29

3.5

LCD Display

29

3.6

Temperature Sensor

31

3.7

MPS 2222A

32

3.8

NPN Transistor

32

3.9

Microcontroller PIC16F8776A

33

3.10

LED Light

34

3.11

Hardware Development Process Flow

38

3.12

Transmitter & Receiver Circuit Printing Layout

38

3.13

Software Development Process

39

3.14

MPLAB Program Flow Chart

42

4.1

Result of transmitting and receiving data

45

4.2

LCD Display Interface with PIC Microcontroller

48

xv

4.3

LCD Module Interface with PIC microcontroller

49

4.4

Humidity & Temperature Reading

51

4.5

Zigbee 1 transmitting data to Zigbee 2

53

4.6

Graph of Temperature Vs Time

55

4.7

Graph of Humidity Vs Time

55

xvi

LIST OF APPENDIX

NO

TITLE

PAGE

A

Zigbee Range Testing

64

B

Software Program (XCTU & C COMIPLER)

65

xvii

List of Abbreviation

DSP

-

Digital Signal Processor

WSN

-

Wireless Sensor Network

HID

-

Human Interfacing Device

CMOS -

Complementary Metal-Oxide Semiconductor

OTP

One Time-Programmable

-

WPAN -

Wide Personal Area Network

RFID -

Radio-frequency identification

UART -

Universal Asynchronous Receiver/Transmitter

ADC -

Analog to Digital Converter

CHAPTER I

INTRODUCTION

This chapter will discuss briefly the background of the system have been
chosen to develop. The greenhouse monitoring will also discuss the problem
statement, main objective and the scope of the project.

A greenhouse is a building where plants are grown. Greenhouse protects
crops from too much heat or cold, shield plants from dust storms and blizzards, and
help to keep out pests. Light and temperature control allows greenhouse to turn in
arable land into arable land, thereby improving food production in marginal
environments. Because greenhouse allow certain crops to be grown throughout the
year, greenhouses are increasingly important in the food supply of high latitude
countries. Greenhouses are often used for growing flowers, vegetables, fruits and
tobacco plants.

1.1

Project Background

The closed environment of the greenhouses has its own unique
requirements, compared with outdoor production. Pets and diseases, and extremes of
the heat and humidity, have to be controlled, and irrigation is necessary to provide
water.

2

Significant inputs of the heat and light may be required, particularly with
the winter production of warm weather vegetables. Because the temperature and
humidity of greenhouses must be constantly monitored to ensure optimal conditions,
a wireless sensor network can be used to gather data remotely. The data is
transmitted to a control location and used to control heating, cooling, and irrigation
systems.

1.1.1

Wireless Sensor Network Concept

Wireless sensor network is a new research field. It can be used in some
special situation for signal collection, processing and transmitting. Wireless
technologies have been rapidly developed during recent years. Its advantages include
the liability, simplicity, and low cost in both installation and maintenance. Wireless
sensor network can form a useful part of the automation system architecture in
modern greenhouse. Wireless communication can be used to collect the
measurement and to communicate between the centralized control and the actuators
located to the different parts of the greenhouse.

Zigbee is a new wireless sensor network technology characteristic of less
distance and low speed. It is a new wireless sensor protocol stack of IEEE 802.15.4.
Generally modern greenhouse has hundreds of square meters and they may plant
variety of plants depending on different seasons. Based on wireless sensor network
technology for greenhouse, Zigbee offers flexibility and mobility to save cost and
energy spent on wiring.

This project is innovation from the technology that we have in now days. In
modern greenhouse, several measurement points are required to trace down the local
climate parameters in different parts of the big greenhouse to make the greenhouse
automation system work properly. Cabling would make the measurement system
expensive and vulnerable. Moreover, the cabled measurement points are difficult to
relocate once they are installed.

3

1.1.2

Factors of the Greenhouse Network

Thus, a wireless sensor network consist small size wireless sensor nodes
equipped with radio and one or several sensors in an attractive and cost efficient
option to build the required measurement system. Wireless technologies have been
rapidly developed during recent years. Starting from the military and industrial
controls, it is now being widely applied in environmental monitoring and agriculture.

There are a few type of wireless communication technologies which is
Zigbee, Wi-Fi and Bluetooth. Wi-Fi, Bluetooth and Zigbee work at similar RF
frequencies, and their application sometimes overlap. There are five main factors of
the greenhouse network to be comparing which are [1]:

i)

Cost – Zigbee chip is the lowest compare to Bluetooth and Wi-Fi.
The overall system cost can be significantly reduced by the
employment of Zigbee chip.

ii)

Data Rate – Zigbee is 250 kbps, while Wi-Fi and Bluetooth are 54
Mbps and 1-2 Mbps, respectively. Despite the lowest data rate,
Zigbee is sufficient foe a greenhouse. Low data rate helps to prolong
the battery life.

iii)

Number of Nodes – The capacity of the network is determined by the
number of nodes, and Zigbee has up to 254 nodes, the largest among
the three. It meets the application demand of more and more sensors
and actuators in a greenhouse.

iv)

Current Consumption – Zigbee has the lowest current consumption,
30 mA, while Wi-Fi, 350 mA, and the Bluetooth, 60-170 mA. It also
greatly helps to prolong the battery life.

v)

Battery Life – Zigbee chip has the longest battery life, which is a few
months or even years.

4

As a whole, Zigbee technology offers long battery life, small size, high
reliability, automatic or semi-automatic installation, and particularly, a low system
cost. Therefore, it is a better choice for greenhouse monitoring and control than other
wireless protocols.

Zigbee is a new technology now being deployed for wireless sensor
networks. A sensor network is an infrastructure comprised of sensing; computing
and a communication element that allows the administrators to instrument observe
and react to event and phenomena in a specified environment. Lately, traditional
system to collect parameters for greenhouse is widely used in agriculture. The
traditional system adopts wired way wiring, which makes the system complex and
expensive.
Zigbee’s mission is to cut the traditional wires between sensors, wired
slaves devices, and the microcontrollers and microprocessors they serve. Compared
to the cabled system, the installation of wireless sensor network is fast, cheap and
easy. Moreover, it is easy to relocate the measurement points when needed by just
moving sensor nodes from one location to another within a communication range of
the coordinator device. Wireless sensor network maintenance is also relatively cheap
and easy. The only additional costs occur when the sensor nodes run out of batteries
and the batteries need to be charged or replaced, but the lifespan of the battery can be
several years if an efficient power saving algorithm is applied.

5

1.2

Problem Statement

Nowadays, most greenhouse system still uses the manual system in
monitoring the temperature and humidity in the greenhouse. By using the manual
system, a lot of problem can occurred not for worker but also affected production
system. This all has changed in the modern greenhouses because size of the
greenhouse itself is become bigger than before in order to support the need in market
and the greenhouse facilities provide several options to make local adjustments to the
lights, ventilation, heating and other greenhouse support systems.
However, more measurement data is also needed to make this kind of
automation system work properly. Increased number of measurement points should
not dramatically increase the automation system cost[2].

The first problem is if the greenhouse is far away from the maintenance
office, worker or engineer must go on the site to check manually every hour to check
if there are any problem occurs. Then, the reading of the temperature and humidity
must be checking manually to make sure the greenhouse is in a normal condition.
This project therefore mainly designs to minimize the risk for workers to avoid from
hazard in the greenhouse. Monitoring the temperature and humidity in greenhouse on
the LCD screen can reduce time and problem easier.

The second problem is many greenhouse system still use the cable to send
data from sensor level to monitoring. It is difficult to install the system if the
greenhouse is far away from maintenance office. The data cable are easy to damage
if lay in high temperature and danger condition. These projects were upgrade from
wired to wireless sensor network to send data from greenhouse to monitoring on the
LCD screen in the maintenance office.

6

1.3

Objective of Project

The purposes of greenhouse monitoring using wireless sensor network
prototype that is targeted at transmitting and receiving data within the greenhouse
infrastructure. It was used to as the target for the amount of data that useful for an
analysis of the factors that enable proper functioning greenhouse. So, at the
beginning of this project, by focusing on the production of prototype models to help
people in understanding about monitor the greenhouse by using wireless sensor
network. The main objective of this project can be summarized as follows is to
develop a greenhouse monitoring system to monitor a greenhouse temperature and
humidity parameters by applying the Zigbee a wireless device as the wireless sensor
network system.

1.4

Scope of Project

Development the Greenhouse Monitoring Using Wireless Sensor Network
is a best project have chosen after doing research from books, internet, electronic
magazine and other resources and discussion between the experience in
communication fields. Greenhouse Monitoring Using Wireless Sensor Network is an
innovation of monitoring the temperature and humidity in the greenhouse.

7

The scope of this project consists of hardware and software. The basic idea
is to monitor software and the main part of the hardware is the circuit :

i)

Implement Zigbee wireless and sensor system to transmit and receive
data wirelessly that could support by using 9V battery.

ii)

The two level sensor components consist to transmit data through
monitor system.

iii)

The main processor that controls the whole system is PIC16F877A.
Upon this project to be monitor, the data will be transmit and receive
through Zigbee to the next processor.

iv)

The data will then be process to monitor the temperature and
humidity and the reading will be displayed into the LCD screen.

v)

MPLAB is the software used to interface the software with the
hardware.