Design of a Remote Weather Factors Monitoring System

Misoon Siddig Ali Omer

B.Sc. (Honors) in Computer Engineering

University of Gezira (2012)

A Dissertation

Submitted to the University of Gezira in Partial Fulfillment of the Requirements for

the Award of the Degree of Master of Science

in

Computer Engineering and Networking

Department of Computer Engineering

Faculty of Engineering and Technology

May 2016

1

A Design of a Remote Weather Factors Monitoring System

Misoon Siddig Ali Omer

Supervision Committee:

Name Position Signature

Dr. Abdalla Akoud Osman Main ……..………... Supervisor

Dr. Sally Dafaalla Co-supervisor …………….… Awadalkarim

May/2016

2

A Design of a Remote Weather Factors Monitoring System

Misoon Siddig Ali Omer

Examination committee:

Name Position Signature

Dr. Abdalla Akoud Chairperson ……………... Osman

Dr.Mohamed Hussein External ……………..…. Mohamed Examiner

Dr. Maha Ebied Internal ……………..…. Mohammed Ziada Examiner

Date of Examination: 15/5/2016

3

Acknowledgments

All praise to Allah almighty, who is the one and only creator of this whole universe and who helps everyone to complete the work he/she starts. This project was carried out at the Department of Computer Engineering, Faculty of Engineering & Technology, University of Gezira, Sudan under the supervision of D.Abdalla Akoud Osman.

I would like to express am sincere gratitude to am thesis supervisors D.Abdalla Akoud Osman. This thesis would not have been possible without his advice and encouragement. I am extremely thankful to him for taking us under his supervision when every teacher was busy.

I would also like to give our sincere regards to D.Sally Dffaalla for support and help. Finally, I would like to thank my family members, friends and all the teachers’ staff who taught us all these years.

4

Design of a Remote Weather Factors Monitoring System

Misoon Siddig Ali Omer

Abstract

Wireless sensor network become the most important part in any technology that need to control the environment, because it is enabling interaction between persons or computers and the surrounding environment. One of the new trends that needs the wireless sensor network is military applications. Some of the previous studies were designed wireless based on wireless sensor network to measure the weather factors such as temperature, humidity, and atmospheric pressure, then sends this measured factors to personal computer in central station using bluetooth module but this module has limited range (10 m at 1 mill watt transmit power). The main objective of this research is to overcome this problem and design a reliable, inexpensive, small, and easy movement remote weather factors monitoring system for Sudan's military that helping them in routing the military equipment to oriented and hit the predetermined target accurately

5 without human and material losses. The methodology based on wireless sensor network technology to design of a remote weather factors monitoring system consists of three nodes located in different places to measure all of the surrounding weather factors by using four sensors (temperature and humidity sensor, wind direction sensor, wind speed sensor, and atmosphere pressure sensor), which connected with Arduino then sends this measured factors to a graphical user interface (GUI) in a central computer via xbee wireless communication module that operate within 2.4 GHz frequency band. The results of this research shows the averages of the measured weather factors received from the nodes after being calculated by the central station has stored in a database and displayed on monitoring screen. In conclusion, this project is more accurate, simple, it is important to notice that this research considered as the first one to solve this problem. It is recommended that to implement this research in the future, and to use another wireless communication module with wide rage such as very high frequency device (VHF).

6

تصوين ًظام لوراقبة العواهل الجويه عي بعد

هيسوى صديق علي عور

هلخص الدراسه

في العالن الحالي ، االجصاالت الالسلكيَ جسححذم تشكل أساسي في األهجِشٍ الحي جححاج جزاسل تياًات ألهاكي تعيذٍ.احذ االججاُات الجذيذٍ الحي جححاج اسحخذام الشثكات الالسكليَ ُْ الجيش.تعط الذراسات الساتقَ إسحخذهث الشثكَ الالسلكيَ هع هجِاس جحذيذ الوْاقع لحساعذ هجٌْد الوظالت في جحذيذ هْقعِن تعذ ّصْلِن لالرض ّأثٌاء جحزكِن.أيعا عٌذها يصل الجٌْد هٌطقَ الحزب يكًْْا هحفزقيي ّاليسحطيعْى إيجاد تععِن الثعط تسزعَ ،أحياًا تعط الجٌْد اليجذّى هعذاجِن الحي جن القاءُا هي الطائزٍ لالرض. كل هاسثق ُي هشاكل جحذخ لجٌْد الوظالت.الِذف االساسي هي ُذٍ الذراسَ ُي الحخلص هي كل ُذٍ الوشاكل. في ُذٍ الذراسَ كل هجٌذي هي هجٌْد الوظالت يجة أى يحول هجِاس هحٌقل الطزيقَ الوسحخذهَ ٌُا جحعوي عذٍ خطْات أّال قزاءٍ هْقع الجٌذي هي هجِاس الحعقة ّعزض ُذا الوْقع في شاشَ العزض ، ثاًيا ارسالِا للجٌذي الزئيسي عي طزيق إكسثي السلكيا ،ثالثا الجٌذي الزئيسي يزسل كل ُذٍ الثياًات للحاسْب الوزكشي الذي هْقعَ في هكاى تعيذ هي كل الجٌْد ،الحاسْب الوزكشي يححْي علي ّاهجة هسحخذم رسْهيَ في شكل خزيطَ جعزض هْقعِن تإسحوزار اثٌاء جحزكِن.في الواظي كاى الشهي الالسم لحجويع هعلْهات عي هجٌْد الوظالت كثيز هجذا ، لكي ًحيجة ُذا الحصوين ساعذ في جقليل سهي هجوع الوعلْهات.في الخاجوَ ّهجذ اى الجِاس الجذيذ اصثح أقل حجوا ،اكثز سزيَ ّيسحِلك سهي تيسط لجوع الوعلْهات. جْصي ُذٍ الذراسَ تأى يصون ُذا الجِاس تذّائز هحٌاُيَ الصغز ليكْى كل الجِاس في حجن ساعَ يذ أّ أقل.

7

TABLE OF CONTENTS

Subject page

Dedication ………………………………………………….………………..……….. iv

Acknowledgments …..…………………………………………………….………….. v

Abstract…………….………………………………….……………….…..….….……. vi

Abstract (in Arabic)..………………………………………………………………… vii

Table of contents …….……………………………………………………………….. viii

List of Figures ……….……………………………………………………………….. xii

List of Tables ……………..……………………………………………………….. xiv

List of Abbreviations ...…………….……………………………………………… xv

CHAPTER 1: INTRODUCTION

1.1 Introduction ...... 1

1.2 Problem identification ...... 2

1.3 Motivation ...... ….2

1.4 Objectives ...... ………………2

1.5 Research Methodology ……………..…………………………...... 2

1.6 Research layout. ……………………………………………..…...... 3 ix

CHAPTER 2: BACKGROUND AND LITERATURE REVIEW

2.1 Background ………………..………………………………………...... ………… 4

8

2.1.1 Wireless Sensor Network ………………..……………….…………………4

2.1.1.1 How Wireless Sensor Network Work……………………….………..5

2.1.1.2 Components of WSN………………………. ….…………..…………6

2.1.2 Current Wireless Systems: (Bluetooth and ZigBee)…………..……………..8

2.1.3 Weather Station ……………………………………………………………..11

2.1.3.1 Measuring Temperature ……..………..…….….……….……...... 11

2.1.3.2 Measuring Air Pressure…………………..…………………….…… .12

2.1.3.3 Wind Speed.……………………………………..….…….….………..12

2.1.3.4 Wind Direction………………….……..…….….….…….….……..….13

2.1.3.5 Humidity……………………………...….….……...….…………...... 13

2.1.4 Computer Interfaces ………………………………………………………….. .17

2.1.5 Arduino …………………………………………………………………………18

2.1.5.1 Hardware ………………………………………………………………....18

2.1.5.2Software………………………………………………………………...... 19

2.1.5.3 Example of Arduino Boards ……………………………………………20

2.2 Literature Review …………………….…………………………………………….21

2.2.1 Related Studies …………..………………………………………………...... 21

2.2.2. Summary ………………………...………………………………………. …23 x

CHAPTER 3: METHODOLOGY

3.1 System Design Steps ………………..……………………….………….………...26

3.2 Flow Chart………..………………….……………………….……...……….…... 27

9

3.3 The System Implementation……………………………………………………….28

3.3.1 Simulation System Components…………..……………………………….28

3.3.2 The Hardware Requirements ……………………………………………....30

3.3.2.1 Arduino mega 2560 ………………………………………………30

3.3.2.2 DHT11…………………………………………………………….30

3.3.2.3 MPX4115 …………………………...……………………………31

3.3.2.4Wind Direction Sensor ………………………………………...…31

3.3.2.5 Xbee ………………………………………………………………32

3.3.3 The Software Requirements ……………………………………….…………33

3.3.3.1 Visual Studio 2010 Software …………………………………………33

3.3.3.2 SQL Server 2008 R2 ……………………………………...………….35

CHAPTER 4: SIMULATION AND RESULTS

4.1 Introduction...... 36

4.2 Results …………………………………………………………………………….36

4.2.1 Execute system steps …………………………………………………….....36

4.3 Discussion…………………………………………………………………………50

CHAPTER 5: CONCLUSIONS AND RECOMMENDATIONS

5.1 Conclusion……………………………………………………………………….... 51

5.2 Recommendations………………………..……………….……….……………… 51 xi

REFERENCES……………………………………………………....…...52

10 xii

LIST OF FIGURES

Figure name page

Figure 2.1: Wireless Sensor Network …………………………………………………...4

Figure 2.2: Architecture of Sensor Node…………………………………………………6

Figure 2.3: ZigBee Topology...... 10

Figure 2.4: The ……………………………………………………….16

Figure 2.5: Examples of Arduino ………………………………………………………20

Figure 3.1: The Components of each Sensor Node……………………………………..25

Figure 3.2: Block Diagram……………………………………………………………..25

Figure 3.3: The Frame Format from Central Station to the Specific Sensor Node…….26

Figure 3.4: The Frame Format from the Arduino Board to the Central Station……….26

Figure 3.5: The Operational Flow Chart of the System………………………………...27

Figure 3.6: The System Circuit…………………………………………………………28

Figure 3.7: Arduino Mega 2560………………………………………………………..30

Figure 3.8: Real DHT11 ………………………………………………………………31

Figure 3.9: Simulate Wind Direction Sensor………………………………………….32

Figure 3.10: MainForm Which Represent the Nodes………………………………….33

Figure 3.11: The Monitoring Screen on the PC………………………………………..34

Figure 4.1: Setting the baud rate and the com…………………………………………37

Figure 4.2: Open the Connection……………………………………………………….38

11

Figure 4.3: Select info from MAP………………………………………………………38 xiii

Figure 4.4: Press Right Click on the Specific's Node…………………………………39

Figure 4.5: Frame Received by All Nodes From the central Station…………………..39

Figure 4.6: The Measured Weather Factors by Node1…………………………………40

Figure 4.7: Frames Sends from Node1 to the Central Computer……………………….41

Figure 4.8: Stores the Measured Weather Factors in the Database…………………….41

Figure 4.9: Display the Averages of the Measured Weather Factors on the Monitoring

Screen…………………………………………………………………………………...42

Figure 4.10: Frame Received by all Nodes from the Central Station…………………..42

Figure 4.11: The Measured Weather Factors by Node2……………………………….43

Figure 4.12: Frames Sends from Node2 to the Central Computer…………………….44

Figure 4.13: Stores the Measured Weather Factors in the Database……………………44

Figure 4.14: Display the Averages of the Measured Weather Factors on the Monitoring

Screen…………………………………………………………………………………..45

Figure 4.15: Frame Received by all Nodes from the Central Station…………………..45

Figure 4.16: The Measured weather Factors by Node3…………..…………………….46

Figure 4.17: Frames Sends from Node3 to the Central Computer……………………..46

Figure 4.18: Stores the Measured weather Factors in the Database……………………47

Figure 4.19: Averages of the Measured Weather Factors on the Monitoring

Screen……………………………………………………………………………...……47

12

Figure 4.20: Select Add Point from MAP……………………………………………..48

Figure 4.21: Add New Point……………………………………………………………48

Figure 4.22: Zoom In the Map………………………………………………………….49

Figure 4.23: Zoom Out the Map……………………………………………………….49 xiv

LIST OF TABLES

Table name page

Table2.1 Comparison between ZigBee and ZigBee-PRO …………………………….. 9

Table 3.1: Demonstrates the components used to implement this system ……………..29

Table 3.2: The main components of MainForm……………………………………….34

Table 3.3: The description of the main components of monitoring screen…………….35

Table 3.4: WeatherDB table to store the average of the weather factors………………35 xv

LIST OF ABBREEVIATIONS

FFD ………………………….Full function devices

GPS …………………………. global positioning system

GUI ………………………….graphic user interface mb …………………………..mill bars

Pa …………………………pascal

PC ……………………. personal computer

RF…………………………… radio frequency

13

RFD ………………………reduced function devices

RTC ……………………. real time clock

Sn ………………………. sensors nodes

USB…………………………. universal serial bus

VHF………………………very high frequency device

WSN ……………………. wireless sen

14

CHAPTER ONE

INTRODUCTION

1.1 Introduction

A wireless sensor network (WSN) is a wireless network consisting of spatially distributed autonomous devices using sensors to cooperatively monitor physical or environmental conditions, such as temperature, sound, vibration, pressure, humidity, wind speed, motion or pollutants, and wind direction, at different locations. The development of WSN was originally motivated by military applications such as battlefield surveillance, monitoring or tracking the enemies and force protection. However, WSN are now used in many civilian application areas, including environment and habitat monitoring, healthcare applications, home automation, and traffic control. In addition to one or more sensors, each node in a sensor network is typically equipped with a radio transceiver or other wireless communications device, a small microcontroller, and an energy source, usually a battery. The cost of sensor nodes is similarly variable, ranging from hundreds of dollars to a few cents, depending on the size of the sensor network and the complexity required of individual sensor nodes. Size and cost constraints on sensor nodes result in corresponding constraints on resources such as energy, memory, computational speed and bandwidth (Zanjireh and Larijani, 2015).

In computer science and telecommunications, WSN are an active research area with numerous workshops and conferences arranged each year. WSN are consists of large number of sensor nodes and one or more base stations. The nodes in the network are connected via wireless communication channels. Each node has capability to sense data, process the data and send it to rest of the nodes or to base station. These networks are limited by the node battery lifetime (Dargie and Poellabauer, 2010).

15

1.2 Problem Identification

There is a delay when sending the weather factors (temperature, humidity, wind speed, atmosphere pressure, and wind direction) from a meteorological station to a military region due to factors manual calculations which leads to miss the missile target. Missing the missile target means loss in human and expensive material.

1.3 Motivation

WSN technology has broad applications in many areas because of its advantages such as low-cost equipment, safe and reliable data transfer, simple and flexible network and easy deployment (Patil and L. Desai, 2013). Now a days in Sudan a military regions does not have special meteorological station which causes human and expensive material losses. The proposed system make use of the WSN to solve these problems. This application domain is very important and will steadily increase in the future.

1.4 Objectives

The main aim of this research is to design a reliable, inexpensive, small, and easy movement remote weather factors monitoring system for Sudanese military that helping them in routing the military equipment to oriented and hit the predetermined target accurately.

1.5 Research Methodology

The methodology based on WSN technology to measuring the weather factors and has four main steps; the central station sends command to the specific location's sensor node via xbee, the specific location's sensor node start measuring the weather factors after receiving the command and then send this factors to the central station, the central station calculates the averages of the measured weather factors and stores it in a database, and finally display the readings on the monitoring screen.

16

1.6 Research layout

This thesis is organized as follows: Chapter 1 includes the introduction, Chapter 2 about background and literature review, Chapter 3 demonstrates Methodology, Chapter 4 presents the results and discussion, Chapter 5 is about conclusion and recommendation the.

17

CHAPTER TWO

BACKGROUND AND LITERATURE REVIEW

2.1 Background

This section will introduce basic information about WSN, current wireless systems, weather station, automatic weather station, computer interfaces and Arduino.

2.1.1 Wireless Sensor Network

WSN consisting of spatially dispersed and dedicated autonomous devices that use sensors to monitor physical or environmental conditions. A usual WSN system is formed by combining these autonomous devices, or nodes with routers and a gateway. The dispersed measurement nodes communicate wirelessly to a central gateway, which provides a connection to the wired world where the user can collect, process, analyses, and present measurement data. And can use routers to gain an additional communication link between end nodes and the gateway for extend distance and reliability in a wireless sensor network. The wireless sensor is networked and scalable, require very little power. It is also smart and software programmable, and also capable of fast data acquisition, reliable and accurate over the long term, but costs little to purchase and install, and requires nearly zero maintenance. Figure 2.1 shown the WSN (Akyildiz and Kasimoglu, 2004)

Figure 2.1: Wireless Sensor Network (Akyildiz and Kasimoglu, 2004)

18

2.1.1.1 How Wireless Sensor Network Work

Mechanism is quite simple and applicable to a variety of fields. It is based on smaller nodes, controller, radio transceiver, and battery. The key to stimulate the sensor networking is the algorithm sponsor multi-router phenomenon. The system is totally dependent on the nodes and the harmony established between them through proper frequency. These nodes are of different sizes according to the function they perform. All the system remains in working condition with the help of energy supply which is in the form of battery. The WSN perform function concurrently where nodes are autonomous bodies incorporated in the field spatially for the accurate results. The information transmits through proper channel taking the information collecting it in the form of data and send to the base (Akyildiz and Kasimoglu, 2004).

The general structure of WSN consists of a base station or "gateway" which can communicate with a number of wireless sensors via a radio link. Data is captured at the wireless sensor node, then compressed, and transmitted to the gateway directly or, if required, uses other wireless sensor nodes to forward data to the gateway. The transmitted data is then passed to the system through the gateway connection. Sensor nodes are likely as small computers, extremely basic in terms of their interfaces and their components. They usually consist of a processing unit with limited computational power and limited memory, sensors, a communication device, and a power source usually in the form of a battery. The base stations act as a gateway between sensor nodes and the end user and they normally forward data from the WSN on to a server. Other special components are routers, designed to compute, calculate and distribute the routing tables. On the basis of functionality of sensor nodes and other element.

WSN consists of spatially distributed sensor nodes and each sensor node can perform some processing and sensing tasks independently. In addition, sensor nodes communicate with each other in order to forward their sensed information to a central processing unit or conduct some local coordination such as data fusion. The sensor node consists of several hardware components that include an embedded processor, a radio transceiver, internal and external memories, one or more sensors, a Geopositioning system, and a power source as shown in Figure 2.2 (Akyildiz and Kasimoglu, 2004).

19

Figure 2.2: Architecture of Sensor Node (Akyildiz and Kasimoglu, 2004)

2.1.1.2 Components of WSN

The sensor node consists of several hardware components are listed below

1. Embedded Processor

The functionality of an embedded processor in a sensor node is to schedule tasks, process data and control the functionality of other hardware components. There are several types of embedded processors available that can be used in a sensor node include microcontroller, digital signal processor, field programmable gate array, and application specific integrated circuit been the most used embedded processor for sensor nodes is the microcontroller because of its flexibility to connect to other devices and its cheap price (Akyildiz and Kasimoglu, 2004).

2. Transceiver

The responsibility of a transceiver is for the wireless communication of a sensor node. There are different types of wireless transmission media, which includes radio frequency (RF), laser and infrared. The most used transmission media to fits to most of WSN applications is the RF based communication. The different operational states of a transceiver are transmit, receive, idle and sleep. Mica2 mote uses two kinds of

20

RF radios one is RFM TR1000 and other one is Chipc on CC1000.The Mica2 Mote's outdoor transmission range of is about 150 meters (Akyildiz and Kasimoglu, 2004).

3. Memory

Memories in the sensor nodes includes both program memory (instructions are executed by the processor), and data memory (for storing raw and processed sensor measurements and other local information). The quantities of memory and storage on board a WSN device are often limited. It include in-chip flash memory and RAM of a microcontroller and external flash memory. For example, the AT Mega l28L microcontroller running on Mica2 Mote has 128-Kbyte flash program memory and 4Kbyte static RAM. Further, a 4 Mbit Atmel AT4SDBO41B serial flash chip can provide external memories for Mica and Mica2Motes (Akyildiz and Kasimoglu, 2004).

4. Sensors

Due to limited bandwidth and power, WSN devices primarily support only lowdata-rate sensing. There are various applications call for multi-modal sensing, as a result each device may have several sensors on board. The specific sensors are used according to the requirement of the application. For example, they may include temperature sensors, light sensors, humidity sensors, pressure sensors, accelerometers, magnetometers, chemical sensors, acoustic sensors, or even low- resolution imagers (Akyildiz and Kasimoglu, 2004).

5. Geo-Positioning System (GPS)

It is important for all sensor measurements to be location stamped in numerous WSN applications. To obtain positioning the user need to pre-configure sensor locations at deployment, but this may only be possible in limited deployments. Mainly for outdoor operations, when the network is deployed in an ad hoc manner, such information is most easily obtained via satellite based the global positioning system (GPS). The GPS is a space-based global navigation satellite system which provides location and time information in all weather, anywhere on or near the earth, where there is a clear line of sight to four or more GPS satellites (Akyildiz and Kasimoglu, 2004).

21

6. Power Source

In deployment of the WSN device is likely to be battery powered. Power is consumed by sensing, communication and data processing by a sensor node. Batteries are the main source of power supply for sensor nodes. For example, Mica2 Mote runs on 2 AA batteries. While some of the nodes may be wired to a continuous power source in some applications, and energy harvesting techniques may provide a degree of energy renewal in some cases, the finite battery energy is probable to be the most critical resource bottleneck in most applications (Akyildiz and Kasimoglu, 2004).

2.1.2 Current Wireless Systems: (Bluetooth and ZigBee):

As radios decrease their cost and power consumption, it becomes feasible to embed them in more types of electronic devices, which can be used to create smart homes, sensor networks, and other compelling applications, three radios have emerged to support this trend: Bluetooth, Wi-Fi and ZigBee.

Bluetooth radios provide short range connections between wireless devices along with rudimentary networking capabilities, the bluetooth standard is based on a tiny microchip incorporating a radio transceiver that is built into digital devices. The transceiver takes the place of a connecting cable for devices such as cell phones, laptop and palmtop computers, portable printers and projectors, and network access points. Bluetooth is mainly for short range communications, e.g., from a laptop to a nearby printer or from a cell phone to a wireless headset, its normal range of operation is 10 m (at 1 mW transmit power), and this range can be increased to 100 m by increasing the transmit power to 100 mW. The system operates in the unlicensed 2.4 GHZ frequency band; hence it can be used worldwide without any licensing issues. The ZigBee radio specification is designed for lower cost and power consumption than Bluetooth. The specification is based on the IEEE 802.l5.4 standard. The radio operates in the same as Bluetooth, and is capable of connecting 255 devices per network. The specification supports data rates of up to 250 Kbps at a range of up to 30 m. These data rates are slower than Bluetooth, but in exchange the radio consumes significantly less power with a larger transmission range. The goal of

22

ZigBee is to provide radio operation for months or years without recharging, thereby targeting applications such as sensor networks and inventory tags.

Another type of ZigBee is a “ZigBee pro”, ZigBee pro also known as ZigBee 2007, the enhanced ZigBee pro Specification, was posted on 31 October 2007, and was finalized that same year ZigBee pro is fully backward-compatible with ZigBee 2006 devices. A ZigBee 2007 device may join and operate on a ZigBee 2006 network and vice versa. Due to differences in routing options, ZigBee pro devices must become non-routing ZigBee end-devices on a ZigBee 2006 network, and ZigBee 2006 devices must become ZEDs on a ZigBee pro network. The applications running on those devices work the same, regardless of the stack profile beneath them. The first ZigBee application profile, home automation. Table 2.1 illustrate the comparison between ZigBee and ZigBee- pro (Goldsmith, 2005).

Table2.1 Comparison between ZigBee and ZigBee-PRO

Specification ZigBee ZigBee-pro Indoor\urban range Up to 100 ft. (30m) Up to 300 ft. (90m) up to 200 ft. (60m) international variant

Outdoor RF range Up to 300 ft. (90m) Up to 1 mile (1600m)up to 2500 ft.(750m) international variant transmit power 1mw 100mw international outdoor (software Variant selectable) RF data rate 250,000 bps 250,000bps Serial interface data 1200 bps – 250 kbps 1200 bps-250 kbps rate (software (non-standard baud (nonstandard baud rates also rates also supported ) selectable) supported ) Receiver sensitivity -92 dB m (1% packet -100 dB m (1% packet error error rate) rate ) Supply voltage 18-3.4v 18-3.4v

23

Some of the characteristics of ZigBee include:

• Global operation in the 2.4GHz frequency band according to IEEE 802.15.4. • Regional operation in the 915 MHz (Americas) and 868 MHz (Europe). • Frequency agile solution operating over 16 channels in the 2.4GHz frequency. • Incorporates power saving mechanisms for all device classes. • Discovery mechanism with full application confirmation. • Pairing mechanism with full application confirmation. • Multiple star topology and inter-personal area network (PAN) communication. Various transmission options including broadcast. • Security key generation mechanism (Goldsmith ,2005). Figure 2.3: illustrate the ZigBee topology.

Figure 2.3: ZigBee Topology (Somani & Patel 2012)

Full function devices (FFD) and reduced function devices (RFD). Full function devices can perform all available operations within the standard, including routing mechanism, coordination tasks and sensing task. The RFDs do not route packets and must be associated with an FFD (Somani & Patel 2012).

24

2.1.3 Weather Station

A weather station is a facility, either on land or sea, with instruments and equipment for measuring atmospheric conditions to provide information for weather forecasts and to study the weather and climate. The measurements taken include temperature, barometric pressure, humidity, wind speed, wind direction, and amounts. Wind measurements are taken with as few as other obstructions as possible, while temperature and humidity measurements are kept free from direct solar radiation, or insolation. Manual observations are taken at least once daily, while automated measurements are taken at least once an hour. Weather conditions out at sea are taken by ships and buoys, which measure slightly different meteorological quantities such as sea surface temperature, wave height, and wave period. Drifting weather buoys outnumber their moored versions by a significant amount (Met Office, 2016).

Meteorology has application in many diverse fields such as the military, energy production, transport, and agriculture. Meteorologists are able to predict the changes in weather patterns by using several different tools. They use these tools to measure atmospheric conditions that occurred in the past and present, and they apply this information to create educated guesses about the future weather. Meteorologists use many different tools for different purposes. Most people are familiar with , , and for measuring temperature, air pressure, and wind speed, respectively (Georgia Public Broadcasting, 2012).

2.1.3.1 Measuring Temperature

Air temperature is one of the most commonly measured weather conditions. Thermometers are used to measure the amount of heat that is in the atmosphere. Thermometers are hollowed tubes that have a glass bulb at the bottom. The bulb contains a liquid, either alcohol or mercury. When the heat in the air increases, the liquid in the bulb expands and rises up the tube. When the heat in the air decreases (cools) the liquid contracts and falls back down the tube. The tube is calibrated, which means it has a scale that can be used to measure heat accurately. The number near the top point of the liquid indicates the current temperature. Thermometers have not changed significantly over time. They are common fixtures in many homes,

25 inside and outside and help people make decisions about what they need to wear each day (wiliam, 2016).

2.1.3.2 Measuring Air Pressure

Pressure is a force, or weight, exerted on a surface per unit area, and is measured in pascal (Pa). The pressure exerted by a kilogram mass on a surface equals 9.8 Pa. The pressure exerted by the whole atmosphere on the earth's surface is approximately 100,000 Pa. Usually, atmospheric pressure is quoted in mill bars (mb). 1mb is equal to 100 Pa, so standard atmospheric pressure is about 1000mb. In fact, actual values of atmospheric pressure vary from place to place and from hour to hour. At sea level, commonly observed values range between 970 mb and 1040 mb. Because pressure decreases with altitude, pressure observed at various stations must be adjusted to the same level, usually sea level (wiliam, 2016).

Atmospheric pressure is measured by a . A mercury barometer measures the pressure by noting the length of mercury which is supported by the weight of the atmosphere. One centimeter of mercury is equal to 13.33 mb, so normal atmospheric pressure can support a column of mercury about 75 cm (or 30 inches) high. An aneroid barometer is a more compact instrument for measuring pressure. It consists of a box of partially exhausted air which expands and contracts as the pressure falls and rises. The box is connected through a system of levers to a pointer which, in conjunction with a dial, indicates the pressure (wiliam, 2016).

2.1.3.3 Wind Speed

When measuring air movements (wind) meteorologists try to determine the direction the wind is coming from and the speed at which it is travelling. There are different instruments that are used to measure wind. Anemometers are used to measure wind speeds. These instruments consist of three or four hollowed cups that spin when the wind hits them. The higher the wind speed the faster the cups will move. Today, anemometers are connected to computers so that air movements can be measured more accurately (wiliam, 2016).

26

2.1.3.4 Wind Direction

Weather vanes are common tools used for measuring the direction of the wind. Weather vanes have been used for thousands of years. They consist of a moveable arrow which spins when the wind hits it. The point of the arrow will then point in the direction that the wind is coming from (wiliam, 2016).

2.1.3.5 Humidity

Some water in the form of invisible vapor is intermixed with the air throughout the atmosphere. It is the condensation of this vapor which gives rise to most weather phenomena: clouds, , snow, dew and . There is a limit to how much water vapor the air can hold and this limit varies with temperature. When the air contains the maximum amount of vapor possible for a particular temperature, the air is said to be saturated. Warm air can hold more vapor than cold air. In general the air is not saturated, containing only a fraction of the possible water vapor (wiliam, 2016).

The instruments may be used to measure humidity is the Psychomotor. A springdriven motor, wound up by a key at the bottom, operates a fan that draws air across the bulbs of two thermometers. The bulb of one of the thermometers is covered with a muslin wick, which is moistened with distilled water. This wet-bulb is cooled by evaporation (due to the air stream passing over it, which is generated by the fan) to a value below the temperature shown by the dry-bulb thermometer. The computation of the humidity is carried out by comparing the two readings of the thermometers, since the difference between them depends on humidity and pressure (the pressure is measured independently using a barometer). In fact the assmann ventilated psychomotor was actually developed to be a portable instrument, to be flown on balloons something that the could not be used for. This assmann ventilated psychomotor is in fact an adaptation of a much older instrument called the "sling psychomotor", which works on the same principle as the assman unit. However, with the sling psychomotor the air flow which causes the evaporation from the wetbulb is not generated by a fan, but rather by whirling the unit around one's head at high speed. As with the assman unit, the humidity is read from a table which specifies the relation between the temperature difference on the wet and dry bulb thermometers, and the relative humidity. More recent humidity

27 meters use a capacitor which consists of two metal plates separated by a thin polymer film.

The film absorbs or exudes water vapor as the humidity increases or decreases, thus changing the dielectric constant of the film. This in turn changes the capacitance of the unit, which can be recorded electronically. The capacitance can then be converted to a measure of humidity using suitable conversion formulae. These instruments are very portable and can be calibrated to quite high accuracy. Other instruments that are used to measure the humidity include the electrical , the infrared hygrometer, the dew-point hygrometer and the dew cell. The electrical hygrometer passes an electrical current through a carbon-coated plate, and measures the change in resistance across the plate due to absorption or release of water vapor as the humidity changes. The infrared hygrometer measures the absorption of infrared light as it passes through air, with absorption being greater when the absolute humidity is greater. The dew-point hygrometer measures the temperature at which condensation is produced on a cold plate, and uses this information to work out the humidity (wiliam, 2016).

Meteorologists use other tools, as well. For example, weather balloons are special balloons that have a weather pack on them that measures temperature, air pressure, wind speed, humidity, and wind direction in all the layers of the troposphere. Meteorologists also use satellites to observe cloud patterns around the world, and radar is used to measure precipitation. All of this data is then plugged into super computers, which use numerical forecast equations to create forecast models of the atmosphere. These forecast models can be both correct and incorrect, so meteorologists must be careful and determine whether they agree with the model or not. If the meteorologists disagree with the model, then they must determine a different outlook for their forecast. Monitoring the data from all of these tools allows meteorologists to track changes in the weather through time (Georgia Public Broadcasting, 2012).

1. Balloon

A weather or sounding balloon is a balloon which carries instruments aloft to send back information on atmospheric pressure, temperature, humidity and wind speed by means of a small, expendable measuring device called . To

28 obtain wind data, they can be tracked by radar, radio direction finding, or navigation systems (such as the satellite-based GPS). Balloons meant to stay at a constant altitude for long periods of time are known as transosondes.

The unit that performs the actual measurements and radio transmissions hangs at the lower end of the string, and is called a radiosonde. Specialized are used for measuring particular parameters, such as determining the ozone concentration. An example of specialized measurements is found in the tethered balloon measurements in Cyprus in 2003, as part of the preliminary evaluation of air quality in Cyprus, The balloon is usually filled with hydrogen due to lower cost, though helium can also be used. The ascent rate can be controlled by the amount of gas with which the balloon is filled. Weather balloons may reach altitudes of 40 km (25 miles) or more, limited by diminishing pressures causing the balloon to expand to such a degree (typically by a 100:1 factor) that it disintegrates. In this instance the instrument package is usually lost. Above that altitude sounding rockets are used, and for even higher altitudes satellites are used. Weather balloons are launched around the world for observations used to diagnose current conditions as well as by human forecasters and computer models for weather forecasting. Some facilities will also do occasional supplementary "special" releases when meteorologists determine there is a need for additional data between the 12-hour routine launches in which time much can change in the atmosphere. Military and civilian government meteorological agencies such as the national weather service in the US typically launch balloons, and by international agreements almost all the data are shared with all nations (Georgia Public Broadcasting, 2012).

1. Specialized uses also exist, such as for aviation interests, pollution monitoring, photography or videography and research. In recent years weather balloons have also been used for scattering human ashes at high-altitude. Figure 2.4 shown the weather balloon.

29

Figure 2.4: The Weather Balloon (Georgia Public Broadcasting, 2012)

2. Satellite

There have been many advances in weather-measuring technology. One of the most dramatic contributions to meteorology came in 1960 when the world's first weather satellite was launched into space. Satellites are able to gather a lot more information about the weather on earth as they can view events from their position in space. Satellites are also able to send back measurements, images of clouds and other weather conditions (cyclones, hurricanes). Satellites are also sensitive to heat and light and can therefore obtain information about temperatures across the earth. Satellites have made weather measurements and predictions a lot more accurate. Before satellites meteorologists used weather balloons (Georgia Public Broadcasting, 2012).

3. Radar

Radar is an object-detection system that uses radio waves to determine the range, angle, or velocity of objects. It can be used to detect aircraft, ships, spacecraft, guided missiles, motor vehicles, weather formations, and terrain. A radar transmits radio waves or microwaves that reflect from any object in their path. A receive radar, which is typically the same system as the transmit radar, receives and processes these reflected waves to determine properties of the objects.

The uses of radar are highly diverse, including air and terrestrial traffic control, radar astronomy, air-defense systems, antimissile systems; marine radars to locate landmarks and other ships; aircraft anti-collision systems; ocean

30

surveillance systems, outer space surveillance and rendezvous systems; meteorological precipitation monitoring; altimetry and flight control systems; guided missile target locating systems; ground-penetrating radar for geological observations; and range-controlled radar for public health surveillance. High technology radar systems are associated with digital signal processing, machine learning and are capable of extracting useful information from very high noise levels. The information provided by radar includes the bearing and range (and therefore position) of the object from the radar scanner. It is thus used in many different fields where the need for such positioning is crucial. The first use of radar was for military purposes: to locate air, ground and sea targets. This evolved in the civilian field into applications for aircraft, ships, and roads. In aviation, aircraft are equipped with radar devices that warn of aircraft or other obstacles in or approaching their path, display weather information, and give accurate altitude readings. The first commercial device fitted to aircraft was a 1938 Bell Lab unit on some united air lines aircraft. Such aircraft can land in fog at airports equipped with radar-assisted ground-controlled approach systems in which the plane's flight is observed on radar screens while operators radio landing directions to the pilot. Marine radars are used to measure the bearing and distance of ships to prevent collision with other ships, to navigate, and to fix their position at sea when within range of shore or other fixed references such as islands, buoys, and lightships. In port or in harbor, vessel traffic service radar systems are used to monitor and regulate ship movements in busy waters.

Meteorologists use radar to monitor precipitation and wind. It has become the primary tool for short-term weather forecasting and watching for severe weather such as thunderstorms, tornadoes, winter storms, precipitation types, etc. Geologists use specialized ground-penetrating radars to map the composition of earth's crust (Wu et al., 2015).

2.1.4 Computer Interfaces:

A serial port is a computer interface that transmits data one bit at a time. In common use, the term “serial port” refers to ports that use a particular asynchronous protocol. These ports include the RS-232 ports on personal computers (PCs) and many serial ports in embedded systems. Most serial ports are bidirectional: they can both send and receive data. Transmitting one bit at a time might seem inefficient but

31 has advantages, including the ability to use inexpensive cables and small connectors. In PCs, applications access most serial ports as COM ports. Applications that use Microsoft’s .NET Framework class library can use the serial port class to access COM ports. Some universal serial bus (USB) devices function as virtual COM ports, which applications can access in the same way as physical serial ports. Some Ethernet and Wi-Fi devices function as serial servers that enable applications to access serial ports over a network. Microcontrollers in embedded systems can use serial ports to communicate with other embedded systems and PCs. Language compilers for microcontrollers often provide libraries with functions that simplify serial-port programming. Serial data transmission is used for digital communication between (sensors and computers( , (computers and computers) and (computers and peripheral devices) such as a printer, stylus, mouse. Etc. (Webopedia.com, 2016).

2.1.5 Arduino

Arduino is an open-source computer hardware and software company, project and user community that designs and manufactures microcontroller-based kits for building digital devices and interactive objects that can sense and control objects in the physical world. This project is based on microcontroller board designs, manufactured by several vendors, using various microcontrollers. These systems provide sets of digital and analog I/O pins that can be interfaced to various expansion boards ("shields") and other circuits. The boards feature serial communications interfaces, including USB on some models, for loading programs from personal computers. For programming the microcontrollers, the Arduino project provides an integrated development environment (IDE) based on the processing project, which includes support for the C and C++ programming languages. The first Arduino was introduced in 2005, aiming to provide an inexpensive and easy way for novices and professionals to create devices that interact with their environment using sensors and actuators. Common examples of such devices intended for beginner hobbyists include simple robots, thermostats, and motion detectors (Kainka, 2013).

2.1.5.1 Hardware:

An Arduino board historically consists of an Atmel 8-, 16- or 32-bit AVR microcontroller with complementary components that facilitate programming and incorporation into other circuits. An important aspect of the Arduino is its standard connectors, which lets users connect the CPU board to a variety of interchangeable

32 add-on modules known as shields. Some shields communicate with the Arduino board directly over various pins, but many shields are individually addressable via an I²C serial bus, so many shields can be stacked and used in parallel. Prior to 2015 official Arduinos had used the Atmel mega AVR series of chips, specifically the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560 and in 2015 units by other manufacturers were added. A handful of other processors have also been used by Arduino compatible devices. Most boards include a 5 V regulator and a 16 MHz crystal oscillator (or ceramic resonator in some variants), although some designs such as the lily pad run at 8 MHz and dispense with the onboard voltage regulator due to specific form-factor restrictions. An Arduino's microcontroller is also pre-programmed with a boot loader that simplifies uploading of programs to the onchip flash memory, compared with other devices that typically need an external programmer. This makes using an Arduino more straightforward by allowing the use of an ordinary computer as the programmer. Currently, opt boot loader is the default boot loader installed on Arduino UNO (Kainka, 2013).

2.1.5.2 Software:

Arduino programs may be written in any programming language with a compiler that produces binary machine code. Atmel provides a development environment for their microcontrollers, AVR Studio and the newer Atmel Studio. The Arduino project provides the Arduino integrated development environment (IDE), which is a crossplatform application written in Java. It originated from the IDE for the Processing programming language project and the Wiring project. It is designed to introduce programming to artists and other newcomers unfamiliar with software development. It includes a code editor with features such as syntax highlighting, brace matching, and automatic indentation, and provides simple one-click mechanism for compiling and loading programs to an Arduino board. A program written with the IDE for Arduino is called a "sketch". The Arduino IDE supports the C and C++ programming languages using special rules of code organization. The Arduino IDE supplies a software library called "Wiring" from the Wiring project, which provides many common input and output procedures (Kainka, 2013).

2.1.5.3 Example of Arduino Boards:

There are many type of Arduino boards as shown in Figure 2.6

33

(a) Arduino Yun (b) Arduino Leonardo (c)Arduino UNO

(d) Arduino MEGA 2560

Figure 2.5: Examples of Arduino (Kainka, 2013)

2.2 Literature Review

2.2.1 Related Studies

Prakashgoud Patil and B.L.Desai (2013) in their study, they presented fuzzy logic based intelligent irrigation control system by employing WSN for precision agriculture. In their proposed system the irrigation controller normalizes the desired moisture level in the agricultural soil by controlling the water flow of the irrigation pump based on the sensor readings, by switching the pump between on and off states. The system equipped with soil moisture sensors, temperature sensors, precise irrigation equipment, computer-controlled devices, and an intelligent controller using fuzzy logic approach for irrigation of agricultural fields, which simulates or emulates the human being’s intelligence. The fuzzy controller designed efficiently to monitors moisture level in soil, leaf wetness, temperature, humidity, and other essential parameters and also controls the irrigation intelligently. The results show that the application is correct and reasonable and enables user to precisely acquire the crop water requirement information (Prakashgoud Patil and B.L.Desai 2013).

Vongsagon Boonsawat et al., (2010) presents an embedded WSN prototype system for temperature monitoring in a building. This network will be used for management of air conditioning systems at SIIT. The ultimate goal is to help saving the energy cost and reducing energy consumption. The system provides a web user

34 interface for any user to access the current and past temperature readings in different rooms. The network consists of a data gateway or coordinator which wirelessly polls each WSN temperature-monitoring node located in each classroom. Each WSN node consists of a microcontroller on Arduino board and an xbee wireless communication module based on the IEEE 802.15.4/Zigbee standards. The coordinator also has an Ethernet interface and runs a simple data web server. Hence, the coordinator allows data collection over xbee and data access from web browsers (Vongsagon Boonsawat et al., 2010).

Lay Nandar Soe et al., (2014) their paper deals with the design, development and implementation of sensing unit in transmitter for wireless weather station. The main aim of their system is to design and implement a simple, inexpensive and reliable wireless weather station. The microcontroller scans the sensors, calibrates and compensates their data and communicates the resulting information to the transmitter. These resulting information's are displayed on the LCD that is temperature (ºC), humidity (%), pressure (KPa) and wind speed (MH). The transmitter is selected a radio transmitter module that operates at frequency of 433 MHz with optimal range 150m. The transmitter module takes serial input and transmits these signals using radio frequency. The system allows one way communication between two nodes, namely, transmission and reception. The system has many advantages as compared to other weather monitoring systems in term of its smaller size, on-device display, low-cost and greater portability (Lay Nandar Soe et al., 2014).

Giuliano Vox et al., (2014) Their proposed system was developed a wireless monitoring system for measuring greenhouse climatic parameters to overcome the problems related to wires cabling such as presence of a dense net of wires hampering the cultivation practices, wires subjected to high temperature and relative humidity, rodents that can damage wires. The system exploits battery-powered environmental sensors, such as air temperature and relative humidity sensors, wind speed and direction, and solar radiation sensors, integrated in the contest of an 802.15.4-based wireless sensors network. Besides, a fruit diameter measurement sensor was integrated into the system. This approach guarantees flexibility, ease of deployment and low power consumption. Data collected from the greenhouse are then sent to a remote server via a general packet radio service link. The proposed solution has been

35 implemented in a real environment. The test of the communication system showed that 0.3% of the sent data packed were lost; the climatic parameters measured with the wireless system were compared with data collected by the wired system showing a mean value of the absolute difference equal to 0.6°C for the value of the greenhouse air temperature. The wireless climate monitoring system showed a good reliability, while the sensor node batteries showed a lifetime of 530 days (Giuliano Vox et al., 2014).

Pradeep Kasale et al., (2014) their project is designed to monitor and control the indoor humidity and weather conditions affecting the plants using embedded system and Android mobile phone. The android phone is connected to a central server which then connects to microcontroller and humidity sensor via serial communication. Thus the sensor records and manages the required weather conditions proved to be appropriate for plant growth. There are four sensors act as input to the microcontroller system. The input feed provided to the microcontroller is in the form of analog data. This data is converted by the controller into digital format. The data is shown on the LCD display and also on the android phone via Bluetooth. Thus the monitoring of temperature, moisture and other parameters is done automatically. The android phone is operated by the user. The android application is used for controlling as per the user knowledge and required output (Pradeep Kasale et al., 2014).

Edgar and Juan (2015) they designed the weather system consist of an embedded system to the development of multimedia applications based on the PIC32 microcontroller, they also development the system using the SPIES methodology for the construct embedded systems. The core component of the system is SHT11sensor and pressure sensor, measures variables where Bluetooth click device establishes the communication between weather and a personal computer where this parameters are displayed and stored. The purpose of their system is monitoring four climatic variables (temperature, relative humidity, pressure and altitude) and serve as an auxiliary tool to make decisions subsystems for environmental control in different areas. The system provides a reliable and practical tool to measure temperature with a very simple device (Edgar and Juan 2015).

36

2.2.2 Summary

All previous studies mentioned above talked about measuring the weather factors. Some of them use embedded system and Android mobile phone, and an intelligent controller using fuzzy logic approach for monitoring the weather factors. One of the main shortcomings with surface and synoptic weather station stations is that their radio action is limited to only 5 km on flat terrain. Also, there is no official reference for areas or zones they do not cover. This study based on WSN to design simple, accurate, less used of complex circuit and power consumption wireless weather station used xbee wireless communication module to establish communication between sensor nodes and the central station. It operates on 2.4GH frequency band.

37

CHAPTER THREE

METHODOLOGY

Mainly the system is an embedded system designed for monitoring the weather factors based on measuring temperature, wind direction, wind velocity, humidity, and atmospheric pressure using appropriate sensors for helping in routing the military equipment to oriented and hit the predetermined target accurately without human and material losses. Here the wireless embedded system design consists of three sensors nodes (Sn1, Sn2, and Sn3) as shown in Figure 3.2, each node is an independent embedded system located in different places to collect and measure all of the surrounding weather factors. Each of the sensor node consists of real time clock (RTC), battery, temperature sensor, wind direction sensor, wind velocity sensor, humidity sensor, and atmospheric pressure sensor which are interfaced to the Arduino board. The Arduino board reads the sensor's values then sends these values via the xbee wireless communication module based on the IEEE 802.15.4/ZigBee standards connection to a personal computer (PC) in a central station. The central station monitors all sensors nodes, calculates the averages of the measured weather factors and stores it in the database, and finally display the readings on the monitoring screen. The Arduino board is programmed using Arduino Software 1.6.0. Figure 3.1 shows the components of each sensor node.

38

Temperature and Humidity

Sensor Xbe

Atmosphere Pressure Battery Microcontrolle r (Arduino ) Real Time Clock Wind Spee d Sensor

Wind Direction Sensor

Figure 3.1: The Components of each Sensor Node

Sn 1 Xbee Send and R eceive

PC in the Sn 2 Xbee Send and Receive Central S tation

Sn 3 Xbee Send and R eceive

Figure 3.2: Block Diagram

3.1 System Design Steps:

The designed system followed many steps, these steps are listed below and the flow chart is shown in Figure 3.5:

39

1. The central station sends frame to the specific location's sensor node via xbee to start measuring the weather factors. The frame format from central station to the specific sensor node shown in Figure 3.3.

Figure 3.3: The Frame Format from Central Station to the Specific Sensor Node

2. The sensors start measuring the weather factors six times after receiving the frame:

i. Temperature (in °C).

ii. Humidity (in percentage). iii. Pressure (in

hectopascals). iv. Wind speed (in knots).

v. Wind direction.

3. The sensors send the measured weather factors to the Arduino board. 4. The Arduino board reads the sensors values six times then sends the frame through the xbee connection to the PC on the central station. Figure 3.4 illustrate the sent frame from the Arduino board to the central station.

Figure 3.4: The Frame Format from the Arduino Board to the Central Station

3. The central station calculates the averages of the measured weather factors and then stores these factors in the database after receiving the frame. 4. Finally, the averages for all sensors values are displayed on the monitoring screen.

3.2 Flowchart:

40

Start

Send the frame wirelessly Setting baud rate a nd com port via the Xbee to the central station

NO Connection

established The central station calculates the averages of the measured weather factors

YES The central station sends frame to specific's sensor node via Stores these averages of the

Xbee measured weather factors in the database

The sensors start measuring the weather factors and send these factors to Arduino board T h e averages for all sensors values are displayed on the mon itoring screen

Arduino board reads the sensors values Finally, sends the averages of measured weather factors to the second organization Sensors values to firing the milit ary’s equipment to hit NO reach six time their target

YES End

Figure 3.5: The Operational Flow Chart of t he System

3.3 The System Implementation:

The system was implemented by designing circuit for each node which is controlled and accessed by the GUI in the central PC. The collected data from the nodes stored in the database tables and displayed in the monitoring screen.

41

3.3.1 Simulation System Components:

The circuit of the system designed using proteus7 software. Figure 3.6 illustrate the main components that needed in this system. The description of that components are illustrated in Table 3.1.

5

7 3

6

1 9

Figure 3.6: The System Circuit

Table 3.1: Demonstrates the components used to implement this system

NO Component Label Value Objective 1 Arduino - 2560 Receive the frame from the central station, read the Mega sensors values, and send the frame to the central station hosted by PC.

42

2 Temperature DHT11 - To measuring the temperature and the humidity and Humidity Sensor 3 Motor - - To measuring the wind speed Encoder 4 Atmosphere MPX411 - To measuring the atmosphere pressure Pressure 5 Sensor 5 Switch SW- - To measuring the wind direction RCT-S 6 Resistors R1 to 1K Use with SW-RCT-S to measuring wind direction R16 7 Potentiomete POT-HG - Use with motor encoder to measuring the wind r direction 8 Xbee Xbee s1 To send the frame between the central station and the sensors nodes

9 Real time RTC DS130 To set the date and time. clock 7 10 Virtual - - To show the send or received data to or from Arduino terminal board at run time

3.3.2 The Hardware Requirements The main components used to design this system are listed below: 3.3.2.1 Arduino mega 2560 The Arduino mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 14 can be used as pwm outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started. The reasons of using the Arduino board which comes with ATmega168 or 328 for easy interfacing with the ZigBee module and for easy programming (in C) of the microcontroller. The Arduino boards

43 come with a library for interfacing with xbee module and for dealing with analog or digital inputs and outputs as shown in Figure 3.7 (Kainka, 2013).

Figure 3.7: Arduino Mega 2560 (Kainka, 2013)

3.3.2.2 DHT11

The DHT11 humidity and temperature sensor measures relative humidity (RH) and temperature. Relative humidity is the ratio of water vapor in air vs. the saturation point of water vapor in air. The saturation point of water vapor in air changes with temperature. Cold air can hold less water vapor before it is saturated, and hot air can hold more water vapor before it is saturated (Anon, 2016).

The formula for relative humidity is as follows:

Relative Humidity = (density of water vapor / density of water vapor at saturation) x 100% (1)

DHT11 Technical Specifications:

• Humidity Range: 20-90% RH Humidity Accuracy: ±5% RH • Temperature Range: 0-50 °C • Temperature Accuracy: ±2% °C • Operating Voltage: 3V to 5.5V

Figure 3.8 illustrate the DHT11 in real.

44

Figure 3.8: Real DHT11 (Anon, 2016)

3.3.2.3 MPX4115

The MPX4115 series is designed to sense absolute air pressure in an altimeter or barometer applications. Motorola’s BAP sensor integrates on–chip, bipolar op amp circuitry and thin film resistor networks to provide a high level analog output signal and temperature compensation. The small form factor and high reliability of on–chip integration makes the Motorola BAP sensor a logical and economical choice for application designers (Alldatasheet.com, 2016).

The formula of Atmosphere Pressure:

Atmosphere Pressure = ((Vout/Vin)+0.095)/0.009 (2)

3.3.2.4 Wind Direction Sensor

There is a real sensor to measure the wind direction which is vane sensor but is not included in the Proteus software. To simulate the wind direction sensor a four switches and 16 resistors are used. The wind direction sensor is made up of a four switches, each switch connect to four resistors and the value of each one of the resistors is 1k. The movement of the switch close 1 of the 16th open circuits representing one direction of these 16 directions (N, S, E, W, NS, NE, SW, SE, WNW, ENE, ESE, WSW, NNE, SSE, SSW, NNW). Readings are taken from the 16 output circuits by a Arduino board at regular interval and the direction of the wind is determined as shown in Figure 3.9.

45

Figure 3.9: Simulate Wind Direction Sensor

3.3.2.5 Xbee

Xbee series1 modules which are based on the IEEE 802.15.4 standards. These modules allow very reliable and simple communication between microcontrollers, computers, systems, really anything with a serial port, point to point and multi-point networks are supported. For easy interfacing with xbee series1 module, Arduino board was used. The Arduino boards come with a library for interfacing with xbee series1 module and for dealing with analog or digital inputs and output. xbee received data via wired connection of rx and tx port at the Arduino board, it will transmit that data wirelessly to the GUI which is configured as a coordinator. Small size, low power, low cost, long battery life, don’t need to be configured, and used for high-throughput applications requiring low latency and predictable communication timing are the reasons of using xbee series1 module. Operate within 2.4 GHz frequency band and are pin-for-pin compatible with each other (Industries, 2016).

The features of the xbee series1:

• 3.3V @ 50mA • 250kbps Max data rate • 300ft (100m) range

3.3.3 The Software Requirements

The main software programs used to design this system are listed below:

46

3.3.3.1 Visual Studio 2010 Software

The program of the monitoring system which based on the C# programming language for creating graphical user interface (GUI) is implemented using. In the system the GUI is designed to monitor, configure, report, and send frames to the nodes in purpose of measuring the weather factors. Then calculating the averages of the measured weather factors and storing in the database, and finally display the readings on the monitoring screen. The GUI named as MainForm shown in Figure 3.10, the description of that GUI components are illustrated in Table 3.2, the monitoring screen shown in Figure 3.11, and the description of that monitoring screen is illustrated in Table 3.3.

7 6 5

8

1

2 3

Figure 3.10: MainForm Which Represent the Nodes

47

Table 3.2: The main components of MainForm

NO Name Purpose

1 Node1 Show the weather factors measured by node1

2 Node2 Show the weather factors measured by node 2 3 Node3 Show the weather factors measured by node 3 4 Open To open the connection between nodes and central station 5 Led To indicate the connection is established

6 Baud Rate To setting the baud rate

7 Port To setting the port that Xbee connect to the central station Setting 8 Menu Bare This menu help when need to add new nodes, make zoom in, and zoom out.

5 2

1

3

4 Figure 3.11: The Monitoring Screen on the PC

48

Table 3.3: The description of the main components of monitoring screen NO Purpose 1 Display the value of the Atmosphere Pressure 2 Display the value of the humidity 3 Display the value of the temperature 4 Display the value of the wind direction 5 Display the value of the wind velocity

3.3.3.2 SQL Server 2008 R2

A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content: bibliographic, full-text, numeric, and images (SearchSQLServer, 2016). In this research the database named WeatherDB was created using SQL Server 2008 R2 [24], it consists of a table named dbo.tbl_Weather contains 8 columns, first column is ID primary key, second column is NodeID stores the ID of the node, third column is Pressure stores the average of atmospheric pressure sensor, fourth column is Humidity stores the average of humidity sensor, fifth column is Temperature stores the average of temperature sensor, sixth column is WindDirection stores the average of wind direction, seventh column is stores the average of wind speed sensor, and the eighth column is WDate storing the time and date as shown in Table 3.4.

Table 3.4: WeatherDB table to store the average of the weather factors

49

CHAPTER FOUR

RESULTS AND DESCUSION

4.1 Introduction:

This chapter presents the simulation results implemented using proteus7 software, visual studio 2010 Software, and SQL Server 2008 R2.

4.2 Result

The central station sends the frame to the xbee s1 module connected to the PC in the central station as a coordinator, the coordinator sends broadcast to all the nodes wirelessly because all nodes operates in the same channel. All nodes receive the frame, and compare between ID Node in received frame and its own ID, only the node has the same ID start measuring the weather factors. This node become response by sending the frame as missioned in chapter 3 in Figure 3.4 to the xbee s1 module connect to the specific's node and then sends the frame wirelessly to the coordinator, the PC receive the frame from the coordinator, then calculates the averages of the measured weather factors and storing in the database, finally display the readings on the monitoring screen.

4.2.1 Execute System Steps:

When the designed program is executed, MainForm is displayed to perform the following:

First: setting the baud rate and the com of the xbee s1 that connect with the central computer to open the connection with the nodes as shown in Figure 4.1

50

Set baud Set rate com

Figure 4.1: Setting the Baud Rate and the COM PORT

Second: press the open button to establish the connection between the nodes and the central station as shown in Figure 4.2.

Figure 4.2: Open the Connection

51

Open the connection

Third: select info from MAP in menu bar as shown in Figure 4.3, then press right click on the specific's node, it shows icon contain Show Weather Factors as shown in Figure 4.4.

Figure 4.3: Select info from MAP

52

Figure 4.4: Press Right Click on the Specific's Node

Fourth: if the central station need the weather factors of the specific's node click on the icon.

Fifth: as example, when click on the icon of the node1, all the nodes receive the frame as shown in Figure 4.5: % 1 #

Figure 4.5: Frame Received by All Nodes from the Central Station

Sixth: only node1 start measuring the weather factors because it has the same ID in the received frame as shown in Figure 4.6:

NODE1

NODE2

NODE3

39

Figure 4.6: The Measured Weather Factors by Node1

Seventh: node1 responses by frame sends wirelessly to the central computer via xbee s1 module as shown in Figure 4.7.

Figure 4.7: Frames Sends from Node1 to the Central Computer

Eighth: the central station after received the frame calculates the averages of the measured weather factors and storing it in the database as shown in Figure 4.8.

54

Figure 4.8: Stores the Measured Weather Factors in the Database

Then display the readings on the monitoring screen as shown in Figure 4.9.

Figure 4.9: Display the Averages of the Measured Weather Factors on the Monitoring Screen

Ninth: when click on the icon of the node2, all the nodes receive the frame as shown in Figure 4.10: % 2 #

Figure 4.10: Frame Received by All Nodes from the Central Station

55

Tenth: only node2 start measuring the weather factors because it has the same ID in the received frame as shown in Figure 4.11.

Figure 4.11: The Measured Weather Factors by Node2

Eleventh: node2 responses by frame sends wirelessly to the PC in the central station via xbees1 module as shown in Figure 4.12.

Figure 4.12: Frames Sends from Node2 to the Central Computer

Twelfth: the central station after received the frame calculates the averages of the measured weather factors and storing it in the database as shown in Figure 4.13.

56

Figure 4.13: Stores the Measured Weather Factors in the Database

Then display the readings on the monitoring screen as shown in Figure 4.14.

57

Figure 4.14: Display the Averages of the Measured Weather Factors on the Monitoring Screen

Thirteenth: when click on the icon of the node3, all the nodes receive the frame as shown in Figure 4.15: % 3 #

Figure 4.15: Frame Received by all Nodes from the Central Station

Fourteenth: only node3 start measuring the weather factors because it has the same ID in the received frame as shown in Figure 4.16:

58

Figure 4.16: The Measured Weather Factors by Node3

Fifteenth: node3 responses by frame sends wirelessly to the PC in the central station via xbees1 module as shown in Figure 4.17.

59

Figure 4.17: Frames sends from Node3 to the Central Computer

Sixteenth: the central station after received the frame calculates the averages of the measured weather factors and storing it in the database as shown in Figure 4.18.

Figure 4.18: Stores the Measured Weather Factors in the Database

Finally: display the readings on the monitoring screen as shown in Figure 4.19.

Figure 4.19: Averages of the Measured Weather Factors on the Monitoring Screen Select Add Point from MAP in menu bar to add new point as show in Figure 4.20 and Figure 4.21.

60

Figure 4.20: Select Add Point from MAP

Figure 4.21: Add New Point Select Zoom In and Zoom Out from MAP in the menu bar to zoon in or zoom out the map as shown in Figure 4.22 and Figure 4.23.

61

Figure 4.22: Zoom In the Map

Figure 4.23: Zoom Out the Map

4.3 Discussion

The results of this research shows the averages of the measured weather factors received from the sensors nodes after being calculated by the central station has stored in a database, displayed on monitoring screen, and sending to another organization to firing the missiles to hits their target accurately by calculates complex equations:

At any time t, the horizontal and vertical displacement: x and y from the origin are given by:

62

x = V0 t. cos (Θ) (3) y = V0t.sin(Θ) - ½.g.t2 (4) The total flight time is given by:

t = 2. V0 sin (Θ)/g (5)

Maximum Altitude During Trajectory = V0 2sin2Θ/2g (6)

Missile Drag with Altitude and Speed: Drag Force (Newton's) = 0.5 x P x V2 x CL x A (7)

63

CHAPTER FIVE

CONCLUSIONS AND RECOMMENDATIONS

5.1 CONCLUSIONS:

In this work, a proposed method based on wireless sensor network Technology to design and implement a simple, inexpensive, and easy movement remote weather factors monitoring system consist of three sensors nodes located in different places to measure all of the surrounding weather factors via four sensors (temperature and humidity sensor, wind direction sensor, wind speed sensor, and atmospheric pressure sensor) and transmit the measured factors to a wireless receiver board (xbeeS1) connected to the RS-232 port of the PC on the central station. Simulation result shows the averages calculated by the central station, store the averages in a database, and displayed it on monitoring screen in host PC. Wind Direction sensor cannot be built, so four switches can be used as wind direction sensor. This system is more accurate, simple, less used of complex circuit, and highly flexible and open to further development

5.2 RECOMMENDATIONS: This research recommends to implement this system as hardware. Use another wireless communication module with wide rage such as very high frequency device (VHF).

64

Reference

Akyildiz, I. and Kasimoglu, I. (2004). Wireless sensor and actor networks. Ad Hoc Networks, 2(4), pp.351-367

Dargie, W. and Poellabauer, C. (2010). Fundamentals of wireless sensor networks. John Wiley and Sons. ISBN 978-0-470-99765-9. pp. 168–183

Edgar, Juan. G., et al. (2015) Design and Development of a BlueGS Gateway for Bluetooth and GSM Protocols. International Journal of Wireless Communications and Mobile Computing, ISSN 2330-1007

Goldsmith, A., (2005). Wireless communications. GLOBECOM 05 IEEE Global Telecommunications Conference 2005, 3(4), p.427

Giuliano Vox et al., (2014) A Wireless Telecommunications Network for Real-Time Monitoring of Greenhouse Microclimate

Georgia Public Broadcasting. (2012). Students Ask: How Do Meteorologists Predict the Weather. Available at: http://www.gpb.org/blogs/talking-up- astorm/2012/02/15/students-ask-how-do-meteorologists-predict-the-weather [Accessed 12 December 2015]

Georgia Public Broadcasting. (2012). Students Ask: How Do Meteorologists Predict the Weather. [Online] Available at: http://www.gpb.org/blogs/talking- up-astorm/2012/02/15/students-ask-how-do-meteorologists-predict-the-weather

[Accessed 12 December 2015]

International Journal of Science, Engineering and Technology Research (IJSETR), Volume 3, Issue 6

Industries, A. (2016). XBee Module - Series 1 - 1mW with Wire Antenna. Adafruit Industries, Unique & fun DIY electronics and kits. Adafruit.com. Available at: https://www.adafruit.com/product/128 [Accessed 1 Novomber 2015]

65

Kolapkar M. M et al., (2014) Design of Energy Efficient Smart Wireless Embedded System for Study of Greenhouse Related Parameters using Multi-nodal Sensing Approach. National Conference on Growth of Technologies in Electronics, Telecom and Computers - India's Perception, GOTETC-IP'13

Kainka, F. (2013). Das Franzis Starterpaket Arduino Mega 2560. Haar: Franzis Verlag

Lay Nandar Soe, Kyaw Soe Lwin, Hla Myo Tun, (2014) Implementation of Microcontroller Based Sensing Unit in Transmitter for Wireless Weather Station.

Met Office. (2016). WOW - A new weather website for everyone. Available at: http://www.metoffice.gov.uk/news/releases/archive/2011/wow-website-to-launch [Accessed 1 October 2015]

Patil, P. and L. Desai, B. (2013). Intelligent Irrigation Control System by Employing Wireless Sensor Networks. International Journal of Computer Applications, 79(11), pp.33-40

Pradeep Kasale et al., (2014) Android based Greenhouse Android based Greenhouse. IJCSMC, Vol. 4, Issue. 3, pg.68 – 71

Prakashgoud Patil and B.L.Desai (2013) Intelligent Irrigation Control System by Employing Wireless Sensor Networks. International Journal of Computer Applications (0975 – 8887) Volume 79 – No 11

Somani, N.A. & Patel, Y., (2012). Zigbee : a Low Power Wireless Technology for Industrial. International Journal of Control Theory and Computer Modelling, pp.27–33

SearchSQLServer. (2016). what is database Definition from WhatIs.com. Available at: http://searchsqlserver.techtarget.com/definition/database [Accessed 1 January 2016] wiliam, S. (2016). How the weather is measured - Science & Tech Skwirk Interactive Schooling Year 6, NSW online Education Home Schooling Skwirk Australia. [Online] Skwirk.com. Available at: http://www.skwirk.com/p-c_s-11_u-3_t-9_c-

66

22/how-theweather-is-measured/nsw/science-technology/what-s-the-weather- /measuring-theweather [Accessed 12 December 2015]

Anon, (2016). Available at: http://embedded-lab.com/blog/measurement- oftemperature-and-relative-humidity-using-dht11-sensor-and-pic-microcontroller/) [Accessed 2 Novomber 2015].

Alldatasheet.com. (2016). MPX4115 Datasheet (PDF) - Motorola, Inc. Available at: http://www.alldatasheet.com/datasheet pdf/pdf/5178/MOTOROLA/MPX4115.html [Accessed 2 Novomber 2015].

Wu, Q., Tao, W., Zhang, Y. and Amin, M. (2015). Radar-based fall detection based on Doppler time–frequency signatures for assisted living. IET Radar, Sonar & Navigation, 9(2), pp.164-172

Webopedia.com. (2016). What is Serial Port? Webopedia Definition. Available at: http://www.webopedia.com/TERM/S/serial_port.html [Accessed 10 December 2015]

Vongsagon Boonsawat, Jurarat Ekchamanonta, Kulwadee Bumrungkhet, and Somsak Kittipiyakul, (2010) XBee Wireless Sensor Networks for Temperature Monitoring.

Zanjireh, M. and Larijani, H. (2015). A Survey on Centralised and Distributed Clustering Routing Algorithms for WSNs. 2015 IEEE 81st Vehicular Technology Conference (VTC Spring). ISSN: 1550-2252 Pages: 1 – 6

.

67

68