Automatic E-mail Notification System For Remote Agriculture Monitoring.
AUTOMATIC E-MAIL NOTIFICATION SYSTEM FOR REMOTE AGRICULTURE MONITORING
NG KWEK KOON
This report is submitted in partial fulfillment of the requirement for the award of Bachelor of Electronic Engineering (Computer Engineering) With Honours
Faculty of Electronic and Computer Engineering Universiti Teknikal Malaysia Melaka
(2)
UNIVERSTI TEKNIKAL MALAYSIA MELAKA
FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER
BORANG PENGESAHAN STATUS LAPORAN
PROJEK SARJANA MUDA II
Tajuk Projek : REMOTE AGRICULTURE MONITORING AUTOMATIC E-MAIL NOTIFICATION SYSTEM FOR Sesi
Pengajian : 2008/2009
Saya NG KWEK KOON mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat kegunaan seperti berikut:
1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.
2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.
3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi.
4. Sila tandakan ( √ ) :
SULIT* (Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSIA RASMI 1972)
TERHAD* (Mengandungi maklumat terhad yang telah ditentukan oleh organisasi/badan di mana penyelidikan dijalankan)
TIDAK TERHAD
Disahkan oleh:
__________________________ ___________________________________
(TANDATANGAN PENULIS) (COP DAN TANDATANGAN PENYELIA)
Alamat Tetap: 28, JALAN INDAH 1/26, TAMAN UNIVERSITI INDAH 43300 SERI KEMBANGAN SELANGOR DARUL EHSAN
(3)
iii
“I hereby declare that this report is the result of my own work except for quotes as cited in the references”
Signature : ………
Author : NG KWEK KOON
(4)
iv
“I hereby declare that I have read this report and in my opinion this report is sufficient in terms of the scope and quality for the award of Bachelor of Electronic
Engineering (Computer Engineering) With Honours.”
Signature : ………
Supervisor’s Name : Puan Siti Khadijah Binti Idris @ Othman Date : 30th April 2009
(5)
v
(6)
vi
ACKNOWLEDGEMENT
I would like to express my deepest gratitude for all who helped and contributed in completing my SM project. Million thanks to my supervisor Pn. Siti Khadijah Binti Idris @ Othman for her patient, guidance and encouragement throughout my academic program. I would also want to give special thanks to all Lecturers and Professors in FKEKK for their teaching and prepare me for journey of life in the near future. Besides that my sincere appreciation extended to my beloved family and friends for their full support and inspiration in completing my project. Lastly thank to that directly or indirectly involved in finishing the project.
(7)
vii
ABSTRACT
Temperature and humidity monitoring are a crucial part in controlling the quality and growth of crops in agriculture. Conventional method uses a digital sensor that detects environment temperature and humidity and these data will be sends to a local PC to be decoded and analyzed through cabling. Thus requires user to be constantly in front of the PC result in space limitation. The aim of this project is to design a mobile surveillance device where user can monitor the temperature and humidity through Personal Digital Assistant, PDA or cellular phone. The data will constantly uploaded to e-mail server and the user can retrieve the data and display on cellular phone or PDA through GPRS, EDGE, 3G or WIFI. A graphical user interface is design using Visual Studio 2008 to decode and analyze the data received. This project is able to overcome conventional monitoring which consume more cost and space due to intensive labor and wiring. The result is a wireless monitoring system that can help user monitor status in agriculture without long distance limitation.
(8)
viii
ABSTRAK
Pengawalan Suhu dan kelembapan adalah salah satu unsur penting dalam memastikan mutu dan pertumbuhan tanaman dalam bidang pertanian. Kebiasaannya pengesan elektronik digunakan untuk mengesan tahap suhu dan kelembapan kawasan berkenaan dan data-data ini akan dihantar kepada komputer berdekatan melalui kabel seperti USB supaya kod-kod ini ditafsir and dianalisa. Kaedah ini memerlukan pengguna sentiasa berada bersama komputer untuk memantau suhu dan kelembapan. Objektif projek ini adalah mereka bentuk satu Peranti Pengawasan Bergerak di mana pengguna dapat memantau suhu dan kelembapan kawasan tanaman melalui PDA atau telefon bimbit. Data-data yang dikumpulkan daripada pengesan akan dihantarkan kepada satu server yang sentiasa dikemaskini. Telefon bimbit menerima data-data ini dan memaparkan dalam paparan telefon melalui GPRS, EDGE, 3G atau WIFI. Satu GUI direka dengan Visual Studio 2008 bagi mentafsir dan menganalisa data-data yang diperolehi. Projek ini akan menggantikan keadah permantauan biasa yang menggunakan banyak ruang dan memerlukan kos yang tinggi. Hasilnya ialah sistem pemantauan wayarles yang boleh membantu pengguna memantau keadaan kawasan pertanian tanpa batasan jarak.
(9)
ix
TABLE OF CONTENTS
CHAPTER ITEM PAGE
PROJECT TITLE i
VERIFYING FORM ii
DECLARATION iii
SUPERVISOR APPROVAL iv DEDICATION v
ACKNOWLEDGEMENT vi
ABSTRACT vii
ABSTRAK viii
TABLE OF CONTENTS ix
LIST OF TABLES xiii
LIST OF FIGURES xiv
LIST OF ABBREVIATION xvi
LIST OF APPENDIXES xviii
I INTRODUCTION 1
1.1 Project Objective 1 1.2 Problem Statement 2 1.3 Scope of Work 2
1.4 Methodology 3
(10)
x
II LITERATURE REVIEW 5
2.1 Background Study 5
2.2 Surveillance 7
2.3 General Packet Radio Services (GPRS) 7
2.3.1 Services of GPRS 8
2.3.2 Comparison Between GPRS and GSM 10 2.4 Enhanced Data Rates for GSM Evolution (EDGE) 11 2.5 High Speed Circuit Switched Data (HSCSD) 11 2.5.1 Comparison Between GPRS and HSCSD 12
2.6 Graphical User Interface (GUI) 13
2.7 Visual Basic .NET 13
2.7.1 Features of Visual Basic .NET 14 2.7.2 Comparison Between Visual Basic .NET 14
and Visual Basic
2.8 Visual Studio 15
2.8.1 Features of Visual Studio 15
2.8.2 Capabilities of Visual Studio 16
2.9 Temperature and Humidity Meter 17
2.9.1 Wireless Indoor/Outdoor Thermometer 17 2.9.2 Radio Temperature and Relative 18
Humidity Logger
2.10 Humidity-Temperature Sensor Module with Serial 19 Interface
2.10.1 Technical Data 20
2.10.2 Connection Schematic and Plug Connection 21 Layout
2.10.3 Calibration 22
2.11 Serial Port 23
2.11.1 Serial Port Setting 23
(11)
xi
2.12 USB to RS232 Adapter 26
2.13 Electronic Mail 27
2.13.1 Format 28
2.13.2 Server and Client Applications 28
2.14 Personal Digital Assistant 31
2.15 Synchronization 31
2.16 PDA Operating Systems 32
2.16.1 Windows CE 32
2.16.2 Palm OS 33
2.16.3 Symbian OS 33
2.17 Windows Mobile 34
2.17.1 Features of Windows Mobile 34 2.17.2 Versions of Windows Mobile 34
2.17.2.1 Pocket PC 2000 35
2.17.2.2 Pocket PC 2002 35
2.17.2.3 Windows Mobile 2003 36
2.17.2.4 Windows Mobile 5.0 37
2.17.2.5 Windows Mobile 6.0 37
III METHODOLOGY 39
3.1 Introduction 39
3.2 Project Methodology 39
3.3 Project Flow 40
3.4 Monitoring Program Flow Chart 41
3.5 Steps In Developing Monitoring System 43 Using Visual Basic 2008
3.6 HYGROSENS Humidity-Temperature Sensor 46 Module with Serial Interface
(12)
xii
IV RESULT AND DISCUSSION 48
4.1 Introduction 48
4.2 Automatic E-Mail Notification System for Remote 48 Agriculture Monitoring
4.2.1 PC Interface 49
4.2.2 PDA Interface 54
4.3 ASCII Code Decoding 55
4.4 Data Analysis 57
4.5 Discussion 59
V CONCLUSION AND RECOMMENDATION 63
5.1 Conclusion 63
5.2 Future Recommendation 64
REFERENCES 65
(13)
xiii
LIST OF TABLES
NO TITLE PAGE
2.1 Classes of GPRS 8
2.2 GPRS Services 9
2.3 GPRS versus GSM 10
2.4 Features of GPRS and HSCSD 12
2.5 Visual Basic .NET versus Visual Basic 14
2.6 Features of Visual Studio 15
2.7 Capabilities of Visual Studio 16
2.8 Sensor module technical data 20
2.9 RS 232 pins function 26
(14)
xiv
LIST OF FIGURES
NO TITLE PAGE
1.1 Project functional block diagram 3
2.1 Oregon Scientific RMR683HGA Wireless 17
Indoor/Outdoor Thermometer
2.2 Tinytag radio temperature and relative humidity logger 18 2.3 HYGROSENS humidity-temperature sensor module with 19
serial interface
2.4 Module plug connector layout 21
2.5 Module connection cable circuit diagram 22
2.6 HYGROSENS humidity reference cells 22
2.7 D-subminiature 9 pins connector (a) male (b) female 25
2.8 D-subminiature 9 pins connector layout 25
2.9 USB to RS 232 Adapter 26
2.10 USB to RS 232 circuit schematic 27
2.11 Sending e-mail to server 29
2.12 Retrieving e-mail from server 29
2.13 HP iPAQ Pocket PC 5555 31
2.14 Data synchronization using Exchange Server 2003 32
2.15 Pocket PC 2000 Today Screen 35
2.16 Pocket PC 2002 Today Screen 35
2.17 Windows Mobile 2003 Today Screen 36
2.18 Windows Mobile 5.0 Today Screen 37
(15)
xv
3.1 Project flow chart 40
3.2 Monitoring program flow chart 42
3.3 Creating Windows forms application 43
3.4 Location of Toolbox and Properties table 44
3.5 Creating connection with database 44
3.6 Source code for link to database 45
3.7 HYGROSENS Humidity-Temperature Sensor Module 46 3.8 Location of (a) temperature sensor (b) humidity sensor 46
3.9 Serial connection cable 47
4.1 Temperature and Humidity Monitoring System’s Main Menu 49
4.2 E-mail notification settings 50
4.3 Measurement Data recorded in MS Access database 51
4.4 About Page 51
4.5 Port Settings Dialog 52
4.6 Device manager 52
4.7 Storing measured data into database 53
4.8 Source code for sending e-mail 54
4.9 Gmail interface on testing PDA 55
4.10 Data block 56
4.11 Testing area’s (a) temperature and (b) relative humidity 57 in morning
4.12 Testing area’s (a) temperature and (b) relative humidity 58 in afternoon
4.13 Testing area’s (a) temperature and (b) relative humidity 59 at night
(16)
xvi
LIST OF ABBREVIATION
ASCII - American Standard Code for Information Interchange API - Application Programming Interface
ATL - Active Template Library
C# - C Sharp
C++ - Enhanced C programming language or “C with Classes” CCTV - Closed Circuit Television
CD - Carrier Detect
COM - Component Object Model CTS - Clear To Send
DCE - Data Circuit-terminating Equipment DNS - Domain Name Server
DSR - Data Set Ready
DTE - Data Terminal Equipment DTR - Data terminal ready
EDGE - Enhanced Data Rates for GSM Evolution FHSS - Frequency Hopping Spread Spectrum FMP - Field Monitoring Platform
GPRS - General Packet Radio Service GPS - Global Positioning System
GSM - Global System for Mobile communication GUI - Graphical User Interface
HSCSD - High Speed Circuit Switched Data IETF - Internet Engineering Task Force IMAP - Internet Mail Access Protocol
(17)
xvii
J# - J Sharp
MIDI - Musical Instrument Digital Interface MIME - Multipurpose Internet Mail Extensions NTC - Negative Temperature Coefficient OPL - Open Programming Language
PC - Personal Computer
PDA - Personal Digital Assistant POP - Post Office Protocol
QVGA - Quarter Video Graphics Array
RI - Ring Indicator
RFC - Request For Comments
RTS - Ready To Send
SDK - Software Development Kit SMS - Short Message Service
SMTP - Simple Mail Transfer Protocol TTL - Transistor–transistor logic UID - User identifier or User ID
USART - Universal Synchronous/Asynchronous Receiver/Transmitter USB - Universal Serial Bus
VBA - Visual Basic for Applications VGA - Video Graphics Array
VoIP - Voice over Internet Protocol WAP - Wireless Application Protocol WXGA - Wide Extended Graphics Array
(18)
xviii
LIST OF APPENDIXES
NO. TITLE PAGE
A Automatic E-mail Notification System for Remote Agriculture 67 Monitoring
B HYGROSENS Humidity-Temperature Sensor Module with 88 Serial Interface Datasheet
(19)
CHAPTER 1
INTRODUCTION
Cellular phones of pocket PC are the application that is being developed to help monitoring status in agriculture. By incorporating Google email function into a Windows based program that decodes the ASCII data blocks from temperature and humidity module, a simple remote monitoring system for agriculture is formed. User could monitor the temperature and humidity via PDA through GPRS, EDGE, 3G or WIFI by checking their email.
1.1 Project Objectives
These are the objectives of the project
To monitor real time temperature and humidity via PDA.
To decode and display temperature and humidity data captured from Hygrosen module on personal computer.
To develop a user friendly Graphical User Interface (GUI) on personal computer.
To incorporate a fully automatic email notification system to alert remote user.
(20)
2
1.2 Problem Statement
The cultivation of the soil for the growing of crops depends on the temperature and humidity of the surrounding. The quality and growth of the crops affect the farmers‟ income. Traditional method of collecting and managing farm field data through human labours are time consuming and labour intensive due to the increase scale of the farming areas. Conventional Hygrosen module used requires a lot of wires and has space limitation. It still requires user stay with the PC monitoring device to acquire data. Due to this limitation a remote monitoring device is essential in order to constantly monitor the temperature and humidity always alert the user wirelessly if the status is over the optimum level.
1.3 Scope of Work
The project is basically to develop a system that receive and decode data blocks from a temperature and humidity module received through serial port. It is fully automatic after initialized and alert user when testing area‟s temperature is over the preset limit via email. The project focused more on the software development rather than hardware since the project does not involve designing hardware module. Microsoft Visual Studio 2008 was used to interface between Hygrosen module and personal computer. The layout for the Graphical User Interface (GUI) was designed using Windows form application.
The functions of PDA, serial port and temperature and humidity module would be familiarized before applying it using Visual Studio 2008. The project was tested, debugged and simulated rigorously to ensure the functionality of the system. Analysis and discussion were also done on the data measured by the module.
(21)
3
1.4 Methodology
Figure 1.1 Project functional block diagram
The module would be used to monitor the temperature and humidity of a green house. Data captured were sent to PC every 5 seconds through RS232 serial cable. Results from the decoded data by the designed program were displayed on GUI. When the testing area‟s temperature was constantly over the preset limit for few second, the automatic notification system would send an alert email message to user‟s inbox. User can retrieve the data through GPRS, EDGE, 3G or even WIFI via PDA. These data was also recorded into the database for future reference and analysis.
(22)
4
1.5 Thesis Outlines
This report consists of five chapters: Introduction, Literature Review, Methodology, Result and Discussion and Conclusion and Recommendation.
In chapter 1 the Introduction of the project is discussed. It includes project objectives, problem statement, scope of work, a brief explanation on methodology and overview of the remaining chapters.
In chapter 2 the Literature Review explained the research and analysis done. It contains background studies and reviews on related research project, journal, articles, reference books and other sources that were used in the project.
Chapter 3 Methodology discusses the methods and approaches used to process the project. It shows steps on how to create the monitoring system and module used in testing the system.
Chapter 4 is the Result and Discussion. It shows the result and data analysis obtained after testing and simulating the monitoring system in real time. It also discusses the analysis done on the measured data and the problem faced during completing this project.
Lastly chapter 5 concludes the entire project and a few recommendations were given for future development.
(23)
CHAPTER 2
LITERATURE REVIEW
2.1 Background Study
Farming area data collection was a practice applied by farmer to monitor the areas temperature and humidity level. Traditional method through the use of human labours was slow and inefficient. For this reasons methods of remote monitoring incorporating wireless technologies were proposed.
By considering short message‟s transmission characteristic and capability, Tseng proposed a GSM-SMS based communication architecture where temperature and humidity data were sent as package format of short message for monitoring system for farmers in Taiwan [4]. Its reason was most farming areas were located on rural places or mountains. These data measured were transmitted from FMP system through local mobile operator to user‟s phone in the form of SMS. GSM system was chosen for its low power consumption, wide coverage range, ability to store data in the GSM service center when server was not available and simultaneous group broadcast function.
(24)
6
In their journal, Pierce and Elliott offered the approach using wireless radio frequency, RF as the medium of developing a real time monitoring regional and on farm sensor network. The radio/logger used was a 900MHz, FHSS radio that were mainly designed for mobile, real time farm operations and management applications. The project‟s hypothesis is consistent with Pierce F. J. and Elliott T. V. [8] where
The emerging technologies of wireless sensor networks (WSN) will provide new economic opportunities for U.S. agriculture through their application to remote, real-time monitoring and control of important aspects of high quality food production and processing systems.
The radio/loggers were configured into base, remote and roamer. The system applied a star topology where all remote stations received and transferred data from the base while the roamers which were directly connected to the PC would automatically update the online server database after receiving data from base. The system operates using AgWeatherNet and AgFrostNet.
Considering both there are three major components in the design for both approaches which are a database to act as temporary storage, wireless device and wireless service. Tseng et al. (2006) used GSM modem through GSM-SMS service which is good when a large number of workers were involved. While Pierce and Elliott (2008) that used a radio/logger and internet is best when a large farming area monitoring is required.
(1)
CHAPTER 1
INTRODUCTION
Cellular phones of pocket PC are the application that is being developed to help monitoring status in agriculture. By incorporating Google email function into a Windows based program that decodes the ASCII data blocks from temperature and humidity module, a simple remote monitoring system for agriculture is formed. User could monitor the temperature and humidity via PDA through GPRS, EDGE, 3G or WIFI by checking their email.
1.1 Project Objectives
These are the objectives of the project
To monitor real time temperature and humidity via PDA.
To decode and display temperature and humidity data captured from Hygrosen module on personal computer.
To develop a user friendly Graphical User Interface (GUI) on personal computer.
To incorporate a fully automatic email notification system to alert remote user.
(2)
2
1.2 Problem Statement
The cultivation of the soil for the growing of crops depends on the temperature and humidity of the surrounding. The quality and growth of the crops affect the farmers‟ income. Traditional method of collecting and managing farm field data through human labours are time consuming and labour intensive due to the increase scale of the farming areas. Conventional Hygrosen module used requires a lot of wires and has space limitation. It still requires user stay with the PC monitoring device to acquire data. Due to this limitation a remote monitoring device is essential in order to constantly monitor the temperature and humidity always alert the user wirelessly if the status is over the optimum level.
1.3 Scope of Work
The project is basically to develop a system that receive and decode data blocks from a temperature and humidity module received through serial port. It is fully automatic after initialized and alert user when testing area‟s temperature is over the preset limit via email. The project focused more on the software development rather than hardware since the project does not involve designing hardware module. Microsoft Visual Studio 2008 was used to interface between Hygrosen module and personal computer. The layout for the Graphical User Interface (GUI) was designed using Windows form application.
The functions of PDA, serial port and temperature and humidity module would be familiarized before applying it using Visual Studio 2008. The project was tested, debugged and simulated rigorously to ensure the functionality of the system. Analysis and discussion were also done on the data measured by the module.
(3)
1.4 Methodology
Figure 1.1 Project functional block diagram
The module would be used to monitor the temperature and humidity of a green house. Data captured were sent to PC every 5 seconds through RS232 serial cable. Results from the decoded data by the designed program were displayed on GUI. When the testing area‟s temperature was constantly over the preset limit for few second, the automatic notification system would send an alert email message to user‟s inbox. User can retrieve the data through GPRS, EDGE, 3G or even WIFI via PDA. These data was also recorded into the database for future reference and analysis.
(4)
4
1.5 Thesis Outlines
This report consists of five chapters: Introduction, Literature Review, Methodology, Result and Discussion and Conclusion and Recommendation.
In chapter 1 the Introduction of the project is discussed. It includes project objectives, problem statement, scope of work, a brief explanation on methodology and overview of the remaining chapters.
In chapter 2 the Literature Review explained the research and analysis done. It contains background studies and reviews on related research project, journal, articles, reference books and other sources that were used in the project.
Chapter 3 Methodology discusses the methods and approaches used to process the project. It shows steps on how to create the monitoring system and module used in testing the system.
Chapter 4 is the Result and Discussion. It shows the result and data analysis obtained after testing and simulating the monitoring system in real time. It also discusses the analysis done on the measured data and the problem faced during completing this project.
Lastly chapter 5 concludes the entire project and a few recommendations were given for future development.
(5)
CHAPTER 2
LITERATURE REVIEW
2.1 Background Study
Farming area data collection was a practice applied by farmer to monitor the areas temperature and humidity level. Traditional method through the use of human labours was slow and inefficient. For this reasons methods of remote monitoring incorporating wireless technologies were proposed.
By considering short message‟s transmission characteristic and capability, Tseng proposed a GSM-SMS based communication architecture where temperature and humidity data were sent as package format of short message for monitoring system for farmers in Taiwan [4]. Its reason was most farming areas were located on rural places or mountains. These data measured were transmitted from FMP system through local mobile operator to user‟s phone in the form of SMS. GSM system was chosen for its low power consumption, wide coverage range, ability to store data in the GSM service center when server was not available and simultaneous group broadcast function.
(6)
6
In their journal, Pierce and Elliott offered the approach using wireless radio frequency, RF as the medium of developing a real time monitoring regional and on farm sensor network. The radio/logger used was a 900MHz, FHSS radio that were mainly designed for mobile, real time farm operations and management applications. The project‟s hypothesis is consistent with Pierce F. J. and Elliott T. V. [8] where
The emerging technologies of wireless sensor networks (WSN) will provide new economic opportunities for U.S. agriculture through their application to remote, real-time monitoring and control of important aspects of high quality food production and processing systems.
The radio/loggers were configured into base, remote and roamer. The system applied a star topology where all remote stations received and transferred data from the base while the roamers which were directly connected to the PC would automatically update the online server database after receiving data from base. The system operates using AgWeatherNet and AgFrostNet.
Considering both there are three major components in the design for both approaches which are a database to act as temporary storage, wireless device and wireless service. Tseng et al. (2006) used GSM modem through GSM-SMS service which is good when a large number of workers were involved. While Pierce and Elliott (2008) that used a radio/logger and internet is best when a large farming area monitoring is required.