12
Cloud-based Wireless Sensor and Actuator System for Smart Irrigation Nelson Filipe Dias Sales [email protected] Instituto Superior T´ ecnico, Lisboa, Portugal January 2015 Abstract The number of devices connected to the Inter- net is experiencing an explosive growth. This development leads to a world with endless pos- sibilities oered by M2M (Machine-to-Machine) communication, including the deployment of a smarter and greener planet through the use of information acquired around us. The intercon- nection of smart objects embedded with sensors enables this interaction with the environment ac- cording to the concept of Internet of Things (IoT). These sensors communicate wirelessly forming a Wireless Sensor Network (WSN), which performs acquisition, collection and analysis of data such as temperature and soil moisture. The almost infinite capabilities of storage and processing, the rapid elasticity and pay-per-use characteristics makes Cloud Computing an attractive solution to the large amount of data generated by the WSN. This dissertation proposes and evaluates a cloud-based Wireless Sensor and Actuator Network (WSAN) communication system to monitor and control a set of sensors and actuators to assess the plants water needs. Keywords: Wireless Sensor and Actuator Net- work, Internet of Things, Machine-to-Machine, Cloud computing, Irrigation and Optimization. 1. Introduction The World is experiencing a continuous technologi- cal development. Recent developments are enabling the deployment of miniaturized and low-cost elec- tronics in a variety of sectors. Agriculture is surely one of them. Playing an important role in the econ- omy of every nation, agricultural production has been experiencing the continuous improvement of its processes and techniques, which is the focus of the precision agriculture (PA) concept. The objec- tive of precision agriculture is, by collecting real- time data from the environment, to improve prod- ucts quality as well as maintaining a sustainable agriculture. To accomplish this, there is the need for optimizing the resources used in the agricultural processes, mainly in the irrigation system. Water plays a crucial role in plants lifecycle, in- cluding germination, photosynthesis and nutrition processes [1]. Most of the times, the water provided by natural precipitation is not enough in order to provide the amount of water the plants need to grow in a healthy way. Currently, agriculture consumes about 70% of the fresh water [2]. This percent- age can be decreased performing an ecient water management when it comes to irrigation. Perform- ing Precision Irrigation, the water is applied in an ecient and optimized way, in the right place, at the right time and in the right amount. It brings wide benefits, such as water savings, money savings as well as the improvement of crop quality. The progress of the precision agriculture passes by collecting and interpreting huge amounts of data from the field so as to understand the causes of vari- ability and propose strategies for field management. The most important agricultural process which can be controlled and adapted to better suit the plants growth is related to irrigation. First and foremost there is the need to identify the tools used to ac- quire the generated data in order to be analyzed and compared. The amount of data is enormous. If this data is not organized and processed, it will become meaningless. So some of the diculties in the adoption of precision agriculture are related to data handling and data processing [3] as well as the significant investment cost in hardware solutions to save this huge amount of data[4]. It is also very important to provide a system that is economically viable for a single farmer as well as to a big farming company. 2. Related Work Several projects have been developed in the area of environmental monitorization. In this section some relevant architectures of projects will be described. 1

Cloud-based Wireless Sensor and Actuator System for … · Cloud-based Wireless Sensor and Actuator System for Smart Irrigation ... evaluates a cloud-based Wireless Sensor and Actuator

Embed Size (px)

Citation preview

Cloud-based Wireless Sensor and Actuator System for Smart

Irrigation

Nelson Filipe Dias Sales

[email protected]

Instituto Superior Tecnico, Lisboa, Portugal

January 2015

Abstract

The number of devices connected to the Inter-net is experiencing an explosive growth. Thisdevelopment leads to a world with endless pos-sibilities o↵ered by M2M (Machine-to-Machine)communication, including the deployment of asmarter and greener planet through the use ofinformation acquired around us. The intercon-nection of smart objects embedded with sensorsenables this interaction with the environment ac-cording to the concept of Internet of Things (IoT).These sensors communicate wirelessly forming aWireless Sensor Network (WSN), which performsacquisition, collection and analysis of data such astemperature and soil moisture. The almost infinitecapabilities of storage and processing, the rapidelasticity and pay-per-use characteristics makesCloud Computing an attractive solution to thelarge amount of data generated by the WSN. Thisdissertation proposes and evaluates a cloud-basedWireless Sensor and Actuator Network (WSAN)communication system to monitor and control aset of sensors and actuators to assess the plantswater needs.Keywords: Wireless Sensor and Actuator Net-work, Internet of Things, Machine-to-Machine,Cloud computing, Irrigation and Optimization.

1. Introduction

The World is experiencing a continuous technologi-cal development. Recent developments are enablingthe deployment of miniaturized and low-cost elec-tronics in a variety of sectors. Agriculture is surelyone of them. Playing an important role in the econ-omy of every nation, agricultural production hasbeen experiencing the continuous improvement ofits processes and techniques, which is the focus ofthe precision agriculture (PA) concept. The objec-tive of precision agriculture is, by collecting real-time data from the environment, to improve prod-ucts quality as well as maintaining a sustainable

agriculture. To accomplish this, there is the needfor optimizing the resources used in the agriculturalprocesses, mainly in the irrigation system.

Water plays a crucial role in plants lifecycle, in-cluding germination, photosynthesis and nutritionprocesses [1]. Most of the times, the water providedby natural precipitation is not enough in order toprovide the amount of water the plants need to growin a healthy way. Currently, agriculture consumesabout 70% of the fresh water [2]. This percent-age can be decreased performing an e�cient watermanagement when it comes to irrigation. Perform-ing Precision Irrigation, the water is applied in ane�cient and optimized way, in the right place, atthe right time and in the right amount. It bringswide benefits, such as water savings, money savingsas well as the improvement of crop quality.

The progress of the precision agriculture passesby collecting and interpreting huge amounts of datafrom the field so as to understand the causes of vari-ability and propose strategies for field management.The most important agricultural process which canbe controlled and adapted to better suit the plantsgrowth is related to irrigation. First and foremostthere is the need to identify the tools used to ac-quire the generated data in order to be analyzedand compared. The amount of data is enormous.If this data is not organized and processed, it willbecome meaningless. So some of the di�culties inthe adoption of precision agriculture are related todata handling and data processing [3] as well as thesignificant investment cost in hardware solutions tosave this huge amount of data[4]. It is also veryimportant to provide a system that is economicallyviable for a single farmer as well as to a big farmingcompany.

2. Related Work

Several projects have been developed in the area ofenvironmental monitorization. In this section somerelevant architectures of projects will be described.

1

2.1. SensorScopeSensorScope project [5] consists of a WSN-basedsystem for environmental monitoring. The devel-opment of such system pretends to substitute thetraditionally very expensive sensing stations, by areliable, low-cost WSN-based system. The overallarchitecture of this project can be seen in Figure 1.The stations transmit the data gathered in a reg-ular basis to a sink node. The sink node forwardsthe data received to SensorScope Data Base, whichin turn makes it available to other servers.

SensorScopeDB ServerGPRS

Link

SensorScopeDB Server

SensorScopeWeb Server

Clients

Clients

Sink

Stations

WirelessLinks

Figure 1: SensorScope Architecture, adapted from[5].

The sensor nodes used in this project are Shock-fish TinyNodes. Each sensor node is placed in asensor box, which also contains primary and sec-ondary batteries. A sensing station is composed bya sensor node, a solar panel and environmental sen-sors. Each station contains up to seven sensors, ca-pable of measuring up to nine environmental quan-tities: air humidity, air temperature, precipitation,soil moisture, solar radiation, surface temperature,water content, wind direction and wind speed.In order to test the viability of this project,

indoor and outdoor experimental tests were con-ducted. The most relevant test was the Genepi de-ployment. The chosen site was a rock glacier lo-cated at 2500m on the Genepi, Switzerland, beingthe source of dangerous mud streams during rain-fall, which caused accidents by flooding the adjacentroad.A total of 16 stations were deployed in this field,

with special attention in their placement, in or-der to acquire meaningful data. The data col-lected comprises rain, wind and temperature mea-surements. This deployment allowed to test the sta-tions autonomy in real and rough conditions. Theacquired information provided important data em-ployed to identify the microclimate of the region,which helped predicting the evolution of the frozensoils.

2.2. A Holistic Framework for Water sustainabilityand Education in Municipal Green Spaces

Fazackerley et al. [6] describe the adoption of anirrigation control system deployed in a municipalgreen space in the city of Kelowna, Canada. Thisspace consists on a turf landscape, which is divided

in zones. A zone is a turf grass area that is wateredsimultaneously, controlled by valves. This systemaims to determine when, and how much water, toapply at each zone. To minimize water waste, thesystem uses an improved adaptive irrigation algo-rithm that calculates the amount of water to applyin a certain zone depending on the maximum wa-ter volume that the soil can store. The end-to-endsystem is presented in Figure 2.

Adaptative Irrigation Controller

Comercial Controller

Internet

3G

Zone 1 Zone 2

Wireless Sensor Node

Soil Moisture Sensor

Valve from Civic Water Supply

Cellular Network Access Point

User

Figure 2: End-to-end System.

A wireless sensor node was deployed in each zone.Each node has two Decagon EC-5 dielectric soilmoisture sensors coupled to it, as well as a wirelessradio. One of the soil moisture sensors was placedin the rooting zone. The other one was placed be-low the rooting zone and its readings were not usedin the adaptive algorithm.

The readings acquired by the soil moisture sen-sors are transmitted to the adaptive irrigation con-troller. This controller is coupled with a commercialcontroller, which receives remote updates used toestimate irrigation scheduling based on ET (Evap-otranspiration). The commercial controller is themain controller in scheduling the watering events.However, the adaptive irrigation controller is ableto override the scheduled events whenever it calcu-lates distinct watering events.

The adaptive irrigation controller send the mes-sages over a 3G network using TCP/IP to a centralserver. These messages contain soil moisture read-ings from each zone as well as information regardingirrigation events. Messages are stored in a database,used to provide the information to be displayed inthe website. Users can consult the website in orderto observe information regarding watering events,historical water content levels of each zone, as wellas the total water savings experienced.

2

For an evaluation of water savings, the systemstores both the actual watering events as well asthe irrigation events only determined by the com-mercial controller. The total amount of water de-livered based on soil moisture sensors was signifi-cantly lower than the amount of water estimatedby ET based in the commercial controller. The wa-ter savings of the tested system o↵ered 47% savingscompared to the commercial controller. This workdemonstrates the potential of soil moisture basedirrigation over ET based irrigation.

2.3. GolfSenseRocha et al. proposed Golfsense [7], an environ-mental monitoring application used to assist the ir-rigation management in a golf course, by constantlymeasuring the soil moisture state of the grass. Toidentify the requirements of this project, the au-thors utilized as a use case the Oeiras Golf & Res-idence golf course. This study provided informa-tion such as the behavior of a regular golf courseirrigation system, as well as the mechanisms usedto control the applied water. Three measuring pa-rameters were identified: soil moisture at distinctdepths, temperature at the ground level and thevoltage of the batteries used to power the sensornodes. The system’s architecture is represented inFigure 3.

Cell 1 Cell 18

Data BaseGUI

Final Processing Node

(...)

Weather Station

Sensor nodeSink nodeSoil Moisture sensor

User

Fairway FairwayGreenGreen

Wired linkWireless link

Figure 3: GolfSense system architecture, adaptedfrom [7].

The Wireless Sensor Network is divided into cells.Each cell comprises a sink node and four sensornodes. Three of these sensor nodes are placed inthe green zone, and the remaining sensor is placedat the fairway zone. Each sensor node has 3 com-ponents: a MicaZ mote, a sensor board and EC-5soil moisture sensors. The communication betweensensor nodes is performed through IEEE 802.15.4.The sink node has the responsibility to transmitthe sensor nodes readings to a final processing node(FPN).Within a pre-defined sampling frequency, each

sensor node of the network sends the measurementsreadings to the FPN. Readings acquired by the sen-sor node (soil moisture, temperature and batteriesvoltage) are used to estimate average values of eachparameter, which will be sent to the final process-ing node, after the calculations. Every time a sensornodes sends a message to the FPN, it waits until itgets a response message from the FPN.

These messages information regarding the nextsensor nodes’ state. Whenever the FPN receives amessage from the sensor node, it checks if there isa pending irrigation order. If there is no pendingorder for that sensor node, the final processing nodesends only the WSN configuration parameters. If apending order for that sensor node exists, the finalprocessing node sends, along with the WSN config-uration parameters, the start and stop time of theirrigation to the sensor node.

Distinct tests have been performed in order toevaluate the accuracy of the soil moisture measure-ments as well as the system’s ability to detect rainevents. The obtained results demonstrated the use-fulness of such a system in a golf course scenario.

2.4. Vineyard Computing

Vineyard Computing project [8] studied the vine-yard workers’ needs and priorities in order toprovide a Wireless Sensor Network which couldhelp the workers doing a better job. To do so,the authors studied workers and their practicesthrough interviews, site tours and observationalwork. Through their study they concluded that thegreatest variability of the parameters in the vine-yard occurred during daytime, and so there shouldbe a highest number of readings during the day andless frequently during the night. They also learnedthat during the winter the vineyard could be at riskbecause there is the possibility of frost formation.

Due to this problem, there should be frequentreadings during the night and an alert system thatcould alert the manager whenever the temperatureswere below a certain level. They observed that theworkers required actionable data, or in other words,data that helps the workers to suggest the next step.For instance, a map that could evidence the areasof the vineyard at risk of powdery mildew (a fungaldisease) calculated from temperature data readingsof the vineyard over a period of time. This way, thevineyard manager could apply spray pesticides onthe a↵ected area.

The proposed architecture uses the concept ofData Mules. An overview of this system on avineyard setting can be seen in Figure 4. Data isacquired by the sensor nodes in the vineyard ev-ery 60 seconds. These mules collect and transportdata from the sensor nodes to the central database.The authors learned, from the interviews, that the

3

workers move up and down the rows of the vine-yard several times. This way, the workers couldserve as “mules” by transporting a small device,which would wirelessly collect the data from thedistributed nodes. Whenever the gathering devicewas physically close to a node, data would be trans-mitted, whenever new data were available.Data mules give to the network the capability

to emulate distributed nodes through the vineyard,since they do not need to communicate with itsneighbours. The disadvantage of the data mulesis the energy consumption, since the nodes mustbe awake all the time in order to detect and com-municate with the data mule. Furthermore, thisapproach cannot be used in applications with real-time requirements (which was not the case, sincevineyard managers do not need to calculate heatunits immediately). The use of data mules allowsthe reduction of equipment costs.

CentralData Base

Sensor Node

Mobile Node

Worker path

Cabin

Figure 4: Data mule architecture system in thevineyard.

All the abovementioned systems are very sim-ilar regarding the wireless sensor network theycomprise, except the Vineyard Computing projectwhich uses the concept of data mules. The commu-nication between the nodes are mainly performedusing 802.15.4 or similar, whereas the communica-tion between the sink nodes to the servers are per-formed through GPRS or 3G. The main di↵erencebetween these systems rely on the network topol-ogy, mainly star and mesh topologies.All the previous described systems use one or

more servers to store the data they collect fromthe sensor nodes. The use of servers to storethe required data has serious disadvantages whichstarts with the initial capital cost investment andthe servers maintenance. Moreover as more sensornodes are added to the network, more data is gener-ated by them, which may cause the servers to haveno space to store the information. Also, the authorsof the SensorScope project highlighted the impor-tance of saving all the raw data collected from thesensor nodes. This information can be used in thefuture to help the investigation of a variety of topics

such as the continuous study for an optimized irri-gation system or the improvement of the discoveryprocess of plants diseases.

3. System Architecture

This work aims to be applied in a variety of distinctscenarios. Scenarios such as agriculture, green-houses, golf courses and landscapes are a few exam-ples in which the system described in this sectioncan be deployed. The proposed general architec-ture must be modified in order to be adapted toeach scenario and each situation requirements.

The architecture proposed for this project can bedivided in three main components: a wireless sensorand actuator network component, a cloud platformcomponent, and a user application component. TheWSAN contains three di↵erent types of nodes: asink node, a sensor node, and an actuator node.The cloud platform used in this project was theSensefinity cloud platform, Machinates. In order toallow the user interaction with the system, a webapplication was developed. A representation of theproposed architecture can be seen in Figure 5.

Data Processing

Event Processing

for Irrigation

Data Storage

Cloud

Wireless Sensor andActuator Network

Machinates Cloud PlatformWeb

Application

Sink NodeSensor/Actuator Node

Wired LinkWeb Application

Weather Station Inputs

Wireless Link

Figure 5: Proposed Architecture.

3.1. WSAN InfrastructureEvery distinct node of the network may have or notactuation capabilities. The proportion of actuatorscomprised in the network depends on the applica-tion scenario. In certain scenarios there is the needto have one actuator in each network node, whereasin other scenarios a single actuator can be respon-sible for a zone which may comprise several nodes.

Our work relies on the cluster-tree topology,given that this topology provides high scalability,good energy e�ciency as well as reliability. Com-pared to the cluster-tree topology, the star topol-ogy does not provide great scalability and the meshtopology is poor in reliability and energy e�ciency.

4

Notice that if the application scenario requires asmall scale network, the star topology should beused instead. Since the nodes in this project arestatic, there is no need for adaptive routing. Forthis reason, it should be used a tree-based rout-ing. When joining the network, the nodes estab-lish a parent-child link. Knowing these parent-child relationships, the routing between the nodesis relatively simple. Using the cluster-tree topology,the sink node will act as the network coordinator,whereas the sensor and actuator nodes can act ei-ther as a router node and/or an end node. In orderto extend the network, some nodes may be used towork only as repeaters without sensing or actuationcapabilities.

The communication between the wireless nodeshas to be performed by a low range communicationprotocol, such as ZigBee and 802.15.4. This tech-nology is suited to this project due to its energye�ciency as well as suitable data throughput. Thetransmission from the sensor network to the cloudplatform is performed by the sink node. The sinknode must have two communication interfaces: onefor the communication with the wireless nodes, andanother one to the communication with the cloudplatform.

Depending on the deployment scenario, the datatransmission between the sink node and the cloudplatform can be performed through a variety oftechnologies, either through a wired or wireless link.The choice of which technology to use, either wiredor wireless, must be chosen according to the de-ployment scenario. For instance, if the WSAN de-ployment occurs in an agricultural field, the use ofwired links is not appropriate because it may in-terfere with the workers activities. Regarding thewireless links, the technologies which are more ap-propriate for this project are either Wi-Fi 802.11or GPRS (General Packet Radio Service). The de-creasing costs of the GPRS communications, alongwith the deployment of the WSAN in remote zonesmakes this technology the better choice. In situa-tions where GPRS connectivity is poor, the 802.11technology could be used to send the data througha gateway.

3.2. Cloud Platform

The cloud component of this project is responsiblefor data storage and processing, as well as eventprocessing regarding the irrigation algorithm. Theplatform has the responsibility for receiving thedata from the WSAN, identifying the data sources,performing data validation as well as partitioningthe data.

The actuator nodes should receive a control mes-sage in order to perform the irrigation. The deci-sion of whether to irrigate, or not, is taken by the

cloud platform. The sink node of the wireless sen-sor network continuously sends new measurementsacquired by the sensor nodes. After the processing,the received value is compared to a threshold value,which must ensure the plants health and quality.Comparing these values it is decided if the plant inwhich the sensor node is located needs water.

In a regular basis, the cloud platform getsweather information from a Weather Station, ca-pable of providing weather information regardingthe region in which the wireless sensor network isdeployed in. The data retrieved from the WeatherStation should provide data specially regarding pre-cipitation. Whenever the cloud platform detectsthat the threshold mentioned above has reachedits limit, there is the need of correlation with theWeather Station data. In the case of imminent rain-ing periods, the irrigation should not be performed.Otherwise, the cloud platform should send a con-trol message to the wireless sensor network in orderto start the irrigation in the targeted area. If theplant does not need water, the platform waits forthe next measurement in order to verify once againif there is a need of irrigation.

3.3. Web ApplicationIn the scope of this project, the web application isused to give users a textual and graphical represen-tation of the information acquired by the wirelesssensor network, which is stored in the cloud plat-form. This representation includes the soil moisturereadings of each sensor as well as the irrigation pe-riods.

4. System Implementation

This section details the implementation of the sys-tem’s main three components in terms of technolo-gies, hardware components and software solutions.

4.1. WSAN InfrastructureThe choice of network protocol for the WSAN fellon the proprietary SimpliciTI Protocol[9][10] devel-oped by Texas Instruments. This protocol was cho-sen due to its simplicity, low-power and low systemcost. SimplitiTI provides a simple protocol to im-plement a WSAN in a cluster tree topology by sup-plying APIs to easily manage messaging betweendevices. This protocol does not have a formal rout-ing mechanism. However it supports the capabil-ity to create by software three logical objects: EndDevice (ED), Access Point (AP) and Range Exten-der (RE), which correspond to the End Node, SinkNode and Router Node described in the last section,respectively.

The hardware used for the implementation ofthe two devices known as End Device and

Range Extender is the AA battery powerednode of the eZ430-RF2500 Kit, which includes

5

the MSP430F2274 microcontroller and the 2.4GHzCC2500 RF Transceiver, shown in Figure 6. EachED/RE device has a soil moisture sensor connectedto it.

Figure 6: Final ED/RE device.

Both ED and RE implement the same logical pro-cedure, with the exception that the RE device alsoforwards the packets from other nodes to the Ac-cess Point. The logical procedure starts with theinitialisation of the hardware interfaces and the net-work protocol, and then it performs soil moistureand battery readings with a pre-defined samplingfrequency. Each time a measurement reading isperformed, the devices send it to the Access Point.These devices also receive control messages from theAP, related to the modification of the measurementssampling frequency.The initial hardware implementation for the Ac-

cess Point made use of the same board of theED/RE devices, which provided the RF radio ca-pabilities to exchange messages within the WSANnetwork. This board was connected with anotherboard (through an UART) with GPRS capabilities,designed by Sensefinity. This board includes theMSP430F5419A microcontroller and the SIM908module. The final device developed for the AccessPoint device is pictured in Figure 7. This devicealso has the capability to control up to two distinctactuators through the use of one of the availableGPIO pins of the microcontroller, for performingboth the turn ON and OFF of the actuator.

Figure 7: Final Access Point device.

Having two distinct microcontrollers, there wasthe need to implement two distinct logical proce-dures. The eZ430-RF2500 board starts its logi-

cal procedure by initialising the hardware interfacesand the network protocol, and then it is responsi-ble for receiving the measurement messages fromthe other network devices and forward them to theother board. The board with GPRS capabilitieshas the responsibility to manage the measurementsmessages, and send them to the cloud platform.These messages are stored in a queue waiting tobe sent to the cloud.

Whenever the queue reaches a certain limit,the messages are formatted to the Columbus mes-sage format (the message format that the Machi-nates cloud platform understands), then encodedto base64 and finally sent to the cloud platformthrough HTTP. Whenever the board with GPRScapabilities receives a measurement message fromthe other board, it stamps the message with thecurrent timestamp. This timestamp is provided bythe on-board RTC (Real Time Clock).

When the board is initialized, it gets the times-tamp information from the GPS module (includedin the SIM908) in order to properly initialize theRTC with the current time. Besides sending mea-surement messages to the cloud platform, this boardis also responsible for receiving the irrigation in-structions from the cloud platform and activate ordeactivate the actuator accordingly. Whenever theactuator is activated, and consequently starting thethe irrigation, a control message is sent to the othernetwork nodes in order to increase the soil moisturesampling frequency. The deactivation of the actua-tor also results in the modification of the samplingfrequency to the previous frequency. This adaptivesampling frequency modification allows to bettercontrol the irrigation system in a way to optimizeit.

4.2. Cloud PlatformBesides storing all the measurements received fromthe WSAN, the cloud platform is also responsible todetect whenever the plants need irrigation as well assending messages to the WSAN in order to activateor deactivate the irrigation system. This decisionmaking is performed through the use of two distinctpieces of information: the soil moisture measure-ments of the WSAN nodes and the weather stationforecasts, as illustrated in Figure 8.

All the sensing nodes comprised in the WSANsend soil moisture measurements frequently, whichwill help the algorithm taking decisions concern-ing the need for irrigation. When a soil moisturemessage of any node has a value below the definedthreshold, the service will check for the weatherforecast for the next 6 hours, in order to decidewhether to irrigate or not. If, in the next 6 hoursthe probability of precipitation is larger or equalto 50%, the system will not irrigate, otherwise, thecloud sends a message to the WSAN in order to

6

Send message STOP Irrigation

All measurements >= Field

Capacity Point?

Is Irrigation ON?

Single measurement

<= Threshold?

Is PoP >= 50%?

Send message START

Irrigation

YES NO

YES

NO

YES

NO

YES

NO

Figure 8: Irrigation Algorithm.

activate the irrigation.The cloud is also responsible for finding the right

moment to stop the irrigation. For that, wheneverall soil moisture sensor of the network assumes asoil moisture value larger or equal to the definedfield capacity point will specify the end of the irri-gation. When this condition is assured, the cloudsends a message to the WSAN which contains aninstruction to stop the irrigation.The weather service used for fetching weather sta-

tion data in this project is Wunderground1. Thisservice provides the access to real-time weather in-formation. It allows to define the available weatherstation closest to the location where the WSAN isdeployed. The data is fetched by a HTTP Requestand it is returned in JSON format.The only data feature used in this project is the

hourly forecast, which returns data such as high andlow temperature, wind direction, humidity, PoP(Probability of Precipitation), among others, for thenext 36 hours. For our work, it is essencial to usethe PoP parameter in order to detect irrigation pe-riods. This parameter gives the chance or likelihoodof precipitation to occur in a certain area.

4.3. Web ApplicationThe Web Application used in this work was pro-vided by Sensefinity. The provided User Interface(UI) is based on a Model-View-Controller (MVC)software architecture. The communication between

1http://www.wunderground.com/weather/api (accessed

last time on 12 April 2014)

the UI and the Machinates platform is performedunder JSON over REST.

Throught the navigation of the webapp it is pos-sible to visualise the location of the network nodes,the historical data related to soil moisture and bat-tery measurements as well as the PoP predictions.For the AP device there is a battery indicator in themain page which shows the battery level of that de-vice. This functionality is not yet implemented forthe nodes which sense the battery level in volts.

Print screens of two distinct pages of the usedWeb application can be found in Figure 9 and Fig-ure 10.

Figure 9: Print screen of the dashboard.

Figure 10: Print screen of the device specific menu.

5. Experimental Evaluation

In order to test and evaluate the developed system,it was deployed in a real case scenario, a local farmlocated near Sortelha (Guarda). For these evalu-ation tests a row of peach trees were available fortesting the system. This row comprised 9 peachtrees in which the devices were distributed. Thisfield tests involved the use of four devices: one Ac-cess Point, two End Devices and one Range Exten-der following a cluster-tree topology.

Although there were 9 available trees, only 3 soilmoisture sensors were used in these tests. The ap-proximate distance between each peach tree is 3 me-ters. The distance between each device is picturedin Figure 11.

As for the irrigation system, before the proto-type deployment it comprised a drip irrigation sys-

7

tem which was manually scheduled. There was nofrequent irrigation scheduled as the farm owner pro-ceeded with the manual irrigation based on obser-vation of the soil, the cultures itself, as well as theobserved meteorological conditions.The farms fields comprised a large number of dif-

ferent trees cultures and all these cultures were ir-rigated through the same irrigation system. Thedrip irrigation tubing comprises a 1 meter spacingbetween each emitter. As the spacing between thetrees was approximately 3 meters, it was possibleto place the emitters right near the trees stalk andabove the roots. A set of drip emitter tubing con-nected with each other was used in the property inwhich the tubing beginning was connected to thepublic water supply. The irrigations would takeplace once the water tap was manually opened.

3 Meters

9 Meters 6 Meters 9 Meters

15 Meters

ED1 ED2REAP

24 Meters

Figure 11: Distances between each network device.

The area comprising the row of the peach treeswas isolated from other irrigation systems, as it wasdeployed an individual irrigation system for evalu-ating the system developed in the context of thisproject. This way, the irrigation system comprisedthe same drip irrigation system described above,but only applied in the peach trees row where thisevaluation tests took place.

5.1. Experimental SetupThe experimental setup included the following:

(1) One AP device;

(2) Three devices configured as ED and RE. Twoof them configured as ED and the remainingone configured as a RE;

(3) Three soil moisture sensors connected to thedevices mentioned in the previous point;

(4) One drip irrigation tubing covering the entirerow of peach trees;

(5) One Electrovalve controlled by the AP device.One entry of the Electrovalve connected to thepublic water supply, and the other one con-nected to the drip irrigation tubing mentionedabove.

5.2. Experimental MethodologyThe soil moisture sensors were paced within the treeroots about 15 to 20 cm in depth as pictured inFigure 12. It is fundamental that the readings areperformed in the roots zone. It is in the roots zonethat the plants absorb the needed water and nu-trients for their healthy growth. Furthermore, thislocation enables more accurate readings due to thefact that the soil moisture sensor is not a↵ected byexternal conditions such as the sunlight. Each de-vice was fixed to the tree trunk about 1 meter fromthe soil due to attenuation, di↵raction and reflectionconditions of the soil, which may a↵ect the signalstransmission. A picture with distinct perspectivesof the device with an attached soil moisture sensorcan be seen in Figure 13.

Figure 12: Soil Moisture Sensor placement.

Figure 13: ED/RE device with an attached soilmoisture sensor.

As mentioned before, it was deployed an indi-vidual irrigation system only a↵ecting the row ofpeaches tree. The electrovalve was directly con-trolled by the AP device, which means that thevalve is either opened or closed following the APcommands. This electrovalve controls the waterpassage to the drip irrigation tubing, which coversthe entire row of peaches tree.

The devices containing soil moisture sensors wereconfigured to perform soil moisture readings every30 minutes during non-irrigation periods and every5 minutes in irrigation periods. The battery sam-pling frequency of each device was configured to 60minutes. Regarding the parameters used for send-

8

ing the measurements to the cloud platform, theAP device sends data every time the packets bu↵erreaches 4 or more packets, or whenever the timespent since the last data transmission exceeds 60minutes. It was defined a threshold with the valueof 400 and a field capacity point with a value of700. The nearest weather station from the locationwhere the experimental tests took place was locatedin Belmonte, within a distance of nearly 10km.

5.3. Results AnalysisEvaluation tests were taken during three consecu-tive days, making possible to extract results whichtestify the proper functioning of the developed sys-tem.Figure 14 reports the soil moisture variations reg-

istered during this experimental tests for all the soilmoisture sensors comprised in the tests.

End Device 1Range ExtenderEnd Device 2

Soil

Moi

stur

e Va

lue

0

200

400

600

800

Time (in UTC)

12:00 0:00 12:00 0:00Jun 22 Jun 23

Figure 14: Soil moisture representation.

By the time the system started its proper oper-ations, the soil sensors initiated the soil moisturereadings with values comprised between 500 and600. From here on the soil moisture readings wereslowly decreasing to a point whereas there was theneed of irrigation. This point in time was reachedapproximately 15 hours after the system has startedoperating.As the soil moisture sensors were placed about 15

to 20 cm below ground, and also due to the utilizedirrigation system, the variations of the soil moisturesensors were relatively slow. The soil moisture vari-ations was slow due to the time the water neededto penetrate into the soil and reach the soil mois-ture sensors. This way, the irrigation system wasenabled during approximately 50 minutes the pointin time where all the soil moisture sensors acquiredsoil moisture readings above the defined field capac-ity point.Even though the field capacity point had the

value of 700, this value was highly exceeded by allsoil moisture sensors. This may be due to the factthat even after the irrigation system was stopped,the water took more time to infiltrate into the soil,which made the soil moisture readings rise up al-

most until the value of 800, value exceeded by EndDevice 1. This shows that the system should beconfigured with a lower field capacity point, takinginto account the time the water takes to infiltrate inthe soil. For this, it would be necessary to performa study of the soil type in order to adapt the fieldcapacity point to the soil type.

By the time the soil moisture readings of the REdevice arched values below the defined threshold,the probability of precipitation acquired from theused weather station was below 50% for the next 6hours. Which meant that there was no probabilityof precipitation for the next 6 hours and so the irri-gation system had to be activated in order to applythe needed irrigation.

These experimental tests occurred during sum-mer time. During this period, according to theobserved weather conditions, the fields comprisedin the farm were manually irrigated by the farmsowner. As stated before, our system was iso-lated from the remaining irrigation systems whichwere used to irrigate the remaining fields in thefarm. During these experimental tests, the re-maining fields were manually irrigated by the farmsowner once a day with a duration of approximatelyone hour.

If our system was not deployed, the peach treesused in our tests would be irrigated following thesame scheme as the other remaining fields. Whichmeans that the fields would be irrigated 3 times ina period of 3 days with a total of 3 hours of irriga-tion. Our system allowed to conclude that the fieldswere su↵ering from over irrigation. Using our sys-tem the field was only irrigated once within a periodof approximately 50 minutes. This demonstratesthe success of our system regarding the irrigatione�ciency and ultimately water savings.

It is possible to estimate the amount of watersavings during the experimental tests. Each drip-per comprised in the drip irrigation tubing issuesapproximately 2,3 liters per hour. The peach treesrow comprised 9 trees with a dripper right aboveeach tree. The total amount of water issued bythe 9 drippers during the irrigation of 50 minutesis approximately 17,25 liters. Without the use ofour system, with a total of 3 hours, the water usedwould be approximately 62,1 liters. Our system de-livered about 72% less water than the typical man-ual irrigation process.

Given the fact that these experimental testsoccurred in a time interval of 3 days, it was notpossible to evaluate the quality of the peach treesused in our tests. With longer experimental testsit would be possible to assess if the trees qualitywas still maintained.

As mentioned before, the Access Point device sent

9

messages to the cloud platform every time the bu↵erreaches a total of 4 or more messages. The time be-tween the measurements acquisition and the timethe measurements arrive at the cloud platform isvariable. After sending a set of messages to thecloud, the next measurement stored in bu↵er willremain there until 3 more messages arrive. Thisway, this first message will have a greater delay timerelatively to the next 3 messages. The last messagereceived at the AP device (before the sending pro-cess is started) has this way the lowest delay timesince acquisition. The processing times for all mes-sages at the cloud platform are all similar. Thisprocessing time is obtained by calculating the timeinterval since the received message passes from theCreated state to the Processed state. These statis-tics take into consideration the measurements re-ceived in each hour in a 12 hour time interval.A graphical representation of the Mean values

and the Standard Deviation of communication timefor each hour of operation is represented in Figure15.

0

200

400

600

800

1000

1200

Communication Time Mean Value

Tim

e (in

sec

onds

)

Time (in hours)9 10 11 12 13 14 15 16 17 18 19 20 21

Figure 15: Mean Values and Standard Deviation ofthe Communication time for each hour.

The mean value of the Communication Time forall the operational hours represented in the last fig-ure is 443 seconds (⇠ 7,38 minutes). In both periodsof analysis, concerning 12 and 13h, the mean valueof the communication time is lower than the remain-ing hours due to the fact that in this period of timethe irrigation system was turned on and so the soilmoisture measurements were taken each 5 minutes.This means that the Access Point device sends moreoften messages in these two periods given that thebu↵er reaches the pre-defined value faster.As expected, the standard deviation values are

very high, some of them really close to the corre-spondent mean value. This is expected since thetime between acquisition and the time the messageis received by the cloud platform is not the same

for every message, as explained above. During thistime sample, the message with the largest commu-nication delay arriving at the cloud platform tookabout 1877 seconds (⇠ 31,3 minutes). The mes-sage with the lowest time took approximately 1,25minutes. In resume, the communication delay is de-pendent on the measurements sampling frequency,since a higher frequency implies the bu↵er gets fullmore rapidly, and hence a smaller transmission de-lay.

Figure 16 depicts the graphical representation ofthe mean values of the processing time for each hourof operation.

0

1

2

3

4

5

6Processing Time Mean Value

Tim

e (in

sec

onds

)

Time (in hours)9 10 11 12 13 14 15 16 17 18 19 20 21

Figure 16: Mean Values and Standard Deviationof the Processing time for each hour of operationduring experiments.

During this time sample, the processing time waslow, never exceeding 6 seconds. Additionally, thereis no statistically significant di↵erence between theperiods when the cloud platform received more mes-sages (in irrigation periods) and the remaining pe-riods of analysis.

The soil moisture sampling frequency is higherduring irrigation periods because it is desirableto have more feedback information during theseperiods, and so the soil moisture measurementsshould arrive at the cloud platform faster than inperiods of non irrigation. Indeed, it is crucial thatthe amount of time the irrigation system is turnedon must be minimized. To further investigatethe impact of sampling rate on communicationdelays, it was selected a continuous sampling ofsoil moisture measurements both in irrigation andnon irrigation periods. In Figure 17 is representeda graph containing a comparison of 20 continuoussamplings for each case (irrigation and non irriga-tion).

As expected, the communication time for mes-sages during irrigation periods is much smaller

10

Irrigation PeriodsNon Irrigation Periods

Tim

e (in

sec

onds

)

0

200

400

600

800

1000

1200

1400

Figure 17: Comparison of communication times be-tween periods of irrigation and non irrigation.

than in non-irrigation periods.

The mean value for periods of irrigation was ap-proximately 3,08 minutes, whereas in periods of nonirrigation was about 7,61 minutes. For the exper-imental tests performed in this dissertation underthe conditions mentioned above, the sampling fre-quency of the soil moisture measurements was foundto be appropriate. This is due to the irrigationmethod used, a drip irrigation system, which takesmore time to do the irrigation at a very slow pace. Ifother irrigation system was used, the sampling fre-quency during periods of irrigation would had to beadapted, possibly with a higher sampling frequency.

6. Conclusions

Through the study and investigation of literaturerelated to the interconnected field studies of Inter-net of Things, Machine-to-Machine and WirelessSensor and Actuator Networks, it was possible toidentify that besides its continuous developments inthe last couple of years, there is still a huge prob-lem regarding the generated and collected data. Be-ing cloud computing a recent resource providing ap-proach, the main work developed within the contextof the paradigms presented above was not properlyintegrated with the possibilities that a cloud com-puting platform could o↵er.

This work aims to lead the integration of such sys-tems with the attractive features o↵ered by cloudcomputing. When developing such system for theagriculture use case, it was essential to understandthe soil and water dynamics. A comprehensivestudy of such topics was performed which allowedus to have a clearer vision of the plants water needsand how this information could be helpful in thedevelopment of our system. Besides the monitor-ization performed related to the soil and water, inorder to assess the plants water needs for its properand healthy development, it was also important toassess the possibility of natural resources’ usage op-timization. In this context it was introduced the

integration of weather forecast parameters whichcould allow a better optimisation of the used natu-ral resources.

A first prototype of our system was developed,using the hardware components and the cloud com-puting platform provided by Sensefinity. Besidesthe functional tests performed, it was possible tovalidate the correct behaviour and performance ofthe developed system. For that, the prototype wastested in a real case scenario, which validated thesuccessful collection of soil moisture measurements,the correct behaviour of the developed irrigationalgorithm as well as the remaining features devel-oped. With the development and consequent testson a real case scenario, it was possible to identifysome limitations of the developed system. The mainlimitation is related to energy consumption. It wasclear that the the current scheme is not able to lastas long as it should. In addition, there is the needto have a better comprehension of the distinct soiltypes, the distinct cultures and irrigation methodsapplied, as these factors influence the optimisationof the water savings. The collaboration with a soiland cultures expert would be highly appreciated tobetter assess the soil water needs.

The first exposure of our prototype in a real casescenario allowed to validate the correct behaviour ofthe developed system, as well as to identify possibleimprovements to be added to the current developedwork. This possible improvements will be describedin the next section.

6.1. Future Work

The development of a system such as the one pre-sented in this work presupposes the continuous up-grades, enhancements and the addition of new fea-tures. Some of the enhancements and features pre-sented in this section were envisioned during thecourse of the systems development, while otherswere discovered during the tests performed in thereal case scenario. The possible additions and en-hancements are described hereafter.

Improvement of the battery life time will al-low deployment system during long periods of time.

Improvement of the irrigation algorithm todo a better use of the natural resources as wellas maintaining the plants health and its propergrowth. A careful study of the soil and culturesallows the proper definition of the thresholds usedto know the exact moments where the irrigationshould be turned on and o↵. Also, the addition ofother parameters coming from the weather forecastreports would help the irrigation decision making.

11

Modification of the sampling frequencies in

the Web Application and let the cloud plat-form command the notifications of this modifica-tions to the WSAN.

Implementation of a safety mechanism for

the actuators used in the irrigation system. Al-though situations of communication loss betweenthe WSAN and the cloud platform should be rare,there is the need to prevent the actuators for notturning o↵ the case the network does not receivedthe instructions from the cloud platform to stop it.

References

[1] M. Kumar. “Problems, Perspectives and Chal-lenges of Agricultural Water Management”. InInTech, March 2012.

[2] A. Fry. “Facts and Trends, Water”. In WorldBusiness Council for Sustainable Development,Earthprint Ltd, 2005.

[3] S. Blackmore, S. Fountas, and S.M. Peder-sen. “ICT in precision agriculture - di↵usion oftechnology”. In Agricultural CommunicationsDocumentation Center, July 2005.

[4] B. Nath and S. Chaudhuri. “Applicationof Cloud Computing in Agricultural Sectorsfor Economic Development”. In Interplay ofEconomics, Politics and Society for InclusiveGrowth - International Conference organizedby RTC and GNHC, funded by UNDP, Octo-ber 2012.

[5] F. Ingelrest, G. Barrenetxea, G. Schae-fer, M. Vetterli, O. Couach, and M. Par-lange. “Sensor- Scope: Application-specificsensor network for environmental monitoring”.In ACM Transactions on Sensor Networks(TOSN), volume 6, Issue 2, Article No. 17,February 2010.

[6] S. Fazackerley, A. Campbell, R.R. Trenholm,and R. Lawrence. “A holistic framework forwater sustainability and eduction in municipalgreen spaces”. In 25th IEEE Canadian Con-ference on Electrical & Computer Engineering(CCECE), pages 1–6, April-May 2012.

[7] J. Vicente, R. Rocha, and R. Neves. “Golf-Sense: A golf course WSN monitoring ap-plication”. In International Conference onComputer Engineering and Systems (ICCES),pages 152–157, 2010.

[8] J. Burrell, T. Brooke, and R. Beckwith. “Vine-yard computing: sensor networks in agricul-tural production”. In IEEE Pervasive Comput-ing, volume 3, issue 1, pages 38–45, January-March 2004.

[9] L. Friedman. “SimpliciTI: Simple Modular RFNetwork Developers Notes”. In Texas Instru-ments, Inc., 2009.

[10] L. Friedman. “SimpliciTI: Simple Modular RFNetwork Specification”. In Texas Instruments,Inc., 2009.

12