cloud-based wireless sensor network system for smart ... · nadimi et al. [8] propose a system...

12
Cloud-based Wireless Sensor Network System for Smart Livestock Monitorization Jo˜ ao Carlos Duarte Monteiro Ambr´ osio [email protected] Instituto Superior T´ ecnico, Lisboa, Portugal January 2015 Abstract New applications have been emerging worldwide based on Wireless Sensor Networks. The amount of data that is generated by such networks require high storage and processing power, for which Cloud Computing can give an eective contribution. In this report, a cloud-based WSN system is proposed in order to be applied to the Livestock sector, more specifically for the monitorization of dairy sheep. The monitorization was centered on the collection and processing of each animal’s location, in order to extract valuable information to the farmer (e.g, alterations in the normal bustle of each animal, the propagation of possible diseases in the flock of sheep or thefts) and even combining it with other sources of information (e.g., milking systems, etc.). Such solution gives the farmer a broader vision of the business. In this context, it was implemented a functional system prototype experimentally evalu- ated in real deployment scenarios. Keywords: Internet of Things, Machine-to- Machine Communications, Wireless Sensor Net- works, Cloud Computing, Livestock, Localization. 1. Introduction Livestock represents a vital sector for the econ- omy of several countries. In recent decades Live- stock production has experienced a tremendous growth stimulated by the population growth and changes in dietary preferences [1]. Nowadays Live- stock industry has associated with it several re- quirements, a lot due to the demands of our modern society [2]. In order to give an ecient response to the presented demanding requirements, it is nec- essary to monitor a large number of variables re- lated to this sector. However, together with the increasing scale of the farms and the high number of animals that compose it, it is infeasible to con- tinuously monitor the animals through visual ob- servation during twenty four hours a day [2]. In the past, Livestock management was based on farmer’s observation, judgement and experience. Indeed, the only way to locate the animals was to have people watching them, which is a time consuming and ex- pensive approach. In this context, a new concept of management named Precision Livestock Farming (PLF) arises. Technology is a key part of the PLF vision. Nowadays, the technology is evolving at a very fast pace and spreading to many sectors of our society. Indeed, the Livestock sector is no exception, with the lower costs and miniaturization of the sensor boards, using WSNs’ technology the Livestock mon- itorization can be made more eectively than using human observation alone. It allows to continuously and remotely monitor and capture measurements related with the condition of individual animals in a very detailed level as well as reporting these data to the farm manager [3]. The adoption of technologies for tracking Live- stock animals is an example with plenty of poten- tial that illustrates very well the benefits of allying WSNs with the Livestock sector [4]. In this field, if there were for instance animal’s collars that al- low to capture the location of each animal, it would be possible to track real-time free-grazing animals’ movements in large dimension pastures area, with- out the need of observations on the ground. This location information can be employed by dif- ferent applications. For instance, it could be pos- sible to deduce automatically the grazing habits of free ranging animals, which can be very useful to the farmer for making better decisions on the e- cient usage of land. Additionally, it could also be possible to know the path of the animals in a certain time, and so determine exactly the utilized grazing area. This could be very useful, when the farmer pays for the grazing land that was used, avoiding this way costs for unused resources. Collecting the location of each animal can be also very interesting when it is detected an infectious disease in an an- imal, isolating only those animals that had direct or indirect contact with it, avoiding slaughtering 1

Upload: others

Post on 04-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

Cloud-based Wireless Sensor Network System for Smart

Livestock Monitorization

Joao Carlos Duarte Monteiro Ambrosio

[email protected]

Instituto Superior Tecnico, Lisboa, Portugal

January 2015

Abstract

New applications have been emerging worldwidebased on Wireless Sensor Networks. The amountof data that is generated by such networks requirehigh storage and processing power, for which CloudComputing can give an e↵ective contribution. Inthis report, a cloud-based WSN system is proposedin order to be applied to the Livestock sector, morespecifically for the monitorization of dairy sheep.The monitorization was centered on the collectionand processing of each animal’s location, in orderto extract valuable information to the farmer (e.g,alterations in the normal bustle of each animal, thepropagation of possible diseases in the flock of sheepor thefts) and even combining it with other sourcesof information (e.g., milking systems, etc.). Suchsolution gives the farmer a broader vision of thebusiness. In this context, it was implemented afunctional system prototype experimentally evalu-ated in real deployment scenarios.

Keywords: Internet of Things, Machine-to-Machine Communications, Wireless Sensor Net-works, Cloud Computing, Livestock, Localization.

1. Introduction

Livestock represents a vital sector for the econ-omy of several countries. In recent decades Live-stock production has experienced a tremendousgrowth stimulated by the population growth andchanges in dietary preferences [1]. Nowadays Live-stock industry has associated with it several re-quirements, a lot due to the demands of our modernsociety [2]. In order to give an e�cient response tothe presented demanding requirements, it is nec-essary to monitor a large number of variables re-lated to this sector. However, together with theincreasing scale of the farms and the high numberof animals that compose it, it is infeasible to con-tinuously monitor the animals through visual ob-servation during twenty four hours a day [2]. In thepast, Livestock management was based on farmer’s

observation, judgement and experience. Indeed, theonly way to locate the animals was to have peoplewatching them, which is a time consuming and ex-pensive approach. In this context, a new conceptof management named Precision Livestock Farming(PLF) arises.

Technology is a key part of the PLF vision.Nowadays, the technology is evolving at a very fastpace and spreading to many sectors of our society.Indeed, the Livestock sector is no exception, withthe lower costs and miniaturization of the sensorboards, using WSNs’ technology the Livestock mon-itorization can be made more e↵ectively than usinghuman observation alone. It allows to continuouslyand remotely monitor and capture measurementsrelated with the condition of individual animals ina very detailed level as well as reporting these datato the farm manager [3].

The adoption of technologies for tracking Live-stock animals is an example with plenty of poten-tial that illustrates very well the benefits of allyingWSNs with the Livestock sector [4]. In this field,if there were for instance animal’s collars that al-low to capture the location of each animal, it wouldbe possible to track real-time free-grazing animals’movements in large dimension pastures area, with-out the need of observations on the ground.

This location information can be employed by dif-ferent applications. For instance, it could be pos-sible to deduce automatically the grazing habits offree ranging animals, which can be very useful tothe farmer for making better decisions on the e�-cient usage of land. Additionally, it could also bepossible to know the path of the animals in a certaintime, and so determine exactly the utilized grazingarea. This could be very useful, when the farmerpays for the grazing land that was used, avoidingthis way costs for unused resources. Collecting thelocation of each animal can be also very interestingwhen it is detected an infectious disease in an an-imal, isolating only those animals that had director indirect contact with it, avoiding slaughtering

1

Page 2: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

healthy animals. On the other hand, knowing inreal-time the location of each animal may be veryuseful when the farmer wants to fetch free-grazinganimals at the end of a season, avoiding searchingfor them in a certain region. In certain countries, in-surance companies pay in case of death of an animalif the body is found. Therefore knowing the locationof the dead animal body could mean recover somemoney. Besides these facts, the cost of buildingand maintaining fences is expensive, and it is oneof the most expensive costs associated with Live-stock grazing [5]. Therefore, two interesting con-cepts can be used in order to minimize these costs:geo-fencing and virtual-fencing. In both of them,there are no physical fence, which makes them veryadvantageous solutions in terms of cost savings.This new monitoring paradigm of networked

Livestock leads to an enormous quantity of infor-mation that must be e�ciently addressed. Forinstance, applying this paradigm to the cattlemonitorization, each cow will generate on averageabout 200MB of information per year [6]. Makingthe calculation for the entire cattle, it becomesclear that there is more information than a localserver can manage. Based on this fact, how todeal with this quantity of data? Cloud Computingo↵ers an attractive solution for this issue, makingit the solution data back-end. All its well knownadvantages have an end result, which is a sub-stantial reduction of costs, making this kind oftechnological solution attractive for big Livestockproducers as well as to medium and small scaleproducers.

2. Related ArchitecturesThere are several works done in the environmen-

tal monitorization area using WSNs systems. Al-though none of them satisfies completely the re-quirements of this project, it was possible to extractsome interesting approaches from each one of them.ZebraNet project [7] implemented a system that

captures wild animals data and brings it back tobiologists, so that the research process can be donemore e�ciently. In this specific case, the projectgoal is monitoring zebras that are located over alarge wild area, at the Mpala Research Centre inKenya. Since there is no cellular service coveringthe region, this project is based on an ad hoc topol-ogy in order to route data across the mobile nodes(i.e., zebras) to the base station, which in this case isthe final receiver. Unlike the usual, the base stationis also mobile and corresponds to a researcher thatperiodically drives or flies through the area in orderto collect the data stored on the nodes. This way,the base station corresponds to a data MULE (Mo-bile Ubiquitous LAN Extension). All zebras have acollar that is responsible to periodically store infor-

mation about the location of the node in question,having for that a GPS receiver.

Nadimi et al. [8] propose a system capableof monitoring behavioural parameters of individ-ual animals and transforming them into the corre-sponding behavioural mode, using for that an Ar-tificial Neural Network (ANN). Farm animal’s be-haviour and physiological responses can provide im-portant information about their health status andwelfare. For instance, the length of the grazing pe-riod is an extremely relevant factor that can indi-cate to a farmer the su�ciency of food, which di-rectly a↵ects both animal welfare and production.The purpose of this work was to monitor the be-haviour of a herd in Denmark. For that, the sys-tem design consists on a ZigBee-based mobile adhoc WSN that is responsible to measure and mon-itor behaviour parameters (i.e., head movementsthrough an accelerometer) of each individual sheep.Using an ANN, the data collected from the WSNnodes is processed and the behaviour mode of eachanimal is constructed. This behaviour mode variesinto five types: grazing, lying down, standing, walk-ing and other modes. This classification can be veryuseful to the farmer and potentially improves farmmanagement.

Sikka et al. [9] have deployed a large WSANon a farm in order to understand the animals be-haviour and, at the same time, to improve the farmsmanagement as well as to maximize the farm pro-duction. These studies were made by two researchteams on a cattle breeding station at Belmont, inAustralia. Two type of nodes have been deployed:static and mobile. The static nodes consist of twelvegeographically distributed soil-moisture nodes andthe mobile nodes correspond to collars installed incows, in order to track their movements. These col-lars have equipped several sensors, such as a GPSreceiver, accelerometers, temperature sensor, etc.Besides the tracking of animals, the authors alsofocused on actuation, i.e., providing animals withhaptic or audio feedback. This way, based on theanimal position, the system applies various stimuli(such as sound, vibration as well as low-level con-trollable electric shock) to the animal in order tochange its behaviour. The animal actuators havethe potential of influencing the environment, andthis fact combined with virtual fences brings extrabenefits for farm management. The long-term vi-sion of this work is to implement an autonomousfarm management system. For that, from the datacollected by the moisture sensors, the system willautomatically determine the areas more suitablefor grazing and, according to this, it will build thevirtual fences, which will contain the animals thatare automatically guided to these locations throughstimuli. This approach has tremendous potential

2

Page 3: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

and has the ability of making all the system moreoptimized and smarter.Martinez et al. [10] have developed and deployed

a glacier monitorization system at Briksdalsbreen,Norway. The nodes that will be situated in/underthe glacier are called probes, and are equipped witha variety of sensors (e.g., temperature, pressure, ori-entation, external conductivity, etc.). Beyond thesenodes, there is also a base station on the ice, a refer-ence station that acts like a gateway, measures thesupra-glacial movement using a GPS and it can alsobe used for controlling remotely the entire system,as well as a Sensor Network Server (SNS) locatedat Southampton, UK.

3. ArchitectureThe generic architecture that will be later pre-

sented is intended to be applied in the monitoriza-tion of Livestock animals (e.g., horses, cows, sheep,etc.), specially when they are freely grazing. In thisarchitecture the monitorization will be centered inthe collection of the animal’s geographical informa-tion and through the exploitation of this informa-tion, it is intended to make important deductionsabout the actual status of each animal. In a verysimplified approach, the information is collected byeach WSN’s node and, after going through severallayers of intelligence in order to perform data pro-cessing, it can be finally delivered to the end-user.This architecture can be divided into three rel-

evant components; the WSN infrastructure, theCloud Computing platform responsible for the dataprocessing, as well as the Web application that willallow the farmer to visualize the status of the sys-tem as well as to interact with it. This way, only thefunctions that are critically needed for data collec-tion will be carried out by the WSN, leaving theheavy processing for the Cloud Computing plat-form. An architecture design scheme is presented infigure 1 that illustrates the three main componentspreviously mentioned as well as its subcomponents.

WSN Infrastructure

Ad hoc subnetwork

Ad hoc subnetwork

Data Processing Data Storage Event Detection Alarm Reporting

Cloud Platform

Web Application

Sink

Sink

Figure 1: Generic system’s arquitecture designscheme

3.1. WSN Infrastructure

Each node of the WSN infrastructure will cor-respond to an animal that will be equipped with adevice that provides sensing, computation as well ascommunication capabilities. Therefore, in this sys-tem, each animal will correspond to a mobile nodethat communicates wiressly with the other systemnodes. Additionally, it will sense its current ge-ographic location, through GPS or other localiza-tion method, following a time-driven data reportingmodel. All this sensed information is aggregated ina sink node and then uploaded to a back-end infras-tructure to be later processed. In order to accom-plish these functionalities, each animal will have touse a technological device that must not interferewith its normal activity and at the same time mustbe robust to the surrounding environmental condi-tions. The technological device installation dependson the specific use-case as well as on the animal thatis intended to be monitored. For instance, in cowmonitorization it can be used a collar, which wasextensively tested in several other past projects, oreven a device inserted in a bolus that is ingestedand remains in the animal’s rumen.

The monitorized animals will form a Mobile AdHoc Network (MANET), providing high scalabil-ity and robustness to the network. For instance inthe cows’ monitorization field, some authors [9, 11]support this model by showing evidence that theanimals of a cattle remain close to each other (typ-ically herd together), so that an overall connectiv-ity between them was maintained using a multi-hopapproach. Due to the fact that the presented net-work will not have any kind of actuation and thedata will be only uploaded from the ad hoc net-work to the back-end infrastructure, it was chosena convergent protocol in order to route the data tothe back-end infrastructure using a multi-hop ap-proach. All the nodes of the system will use theshort-range radio with low power consumption, inorder to communicate with the other animals in-side the WSN and only the sink node will uploadthe data collected from the WSN’s nodes to theCloud platform, through a gateway, using for thata long-range communication interface.

Due to the natural mobility constraints of thissystem, even using a multi-hop communication ap-proach, some nodes eventually may become discon-nected from each other, therefore forming indepen-dent and isolated ad hoc networks. Despite the lowvulnerability to disconnections presented in simi-lar deployments [12], it is necessary to attenuatethe consequences of this situation. Therefore giventhese conditions, if the sink node corresponds toa node from the ad hoc network and some nodesmay become isolated in separated ad hoc networks,it is not possible to assure connectivity with the

3

Page 4: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

back-end continuously in time. Depending on theapplication use-case scenario, this situation can betolerated or not. Therefore, two approaches wereidentified for the system’s architecture:

Sparse Cloud Connectivity In this approachthe system does not require that all the WSNs nodesmaintain connectivity with the data back-end con-tinuously in time. In this case, the network willhave a certain number of sink nodes, being the re-maining mesh nodes, setting this way a given ratiobetween sink and mesh nodes. This number of sinknodes in the network depends on the real scenariocase, in particularly depends on the total numberof nodes. In order to add some redundancy to thesystem, at least two of them will correspond to sinknodes. Since the disconnected nodes cannot prop-agate the collected information to the cattle’s sinknodes, each network node is equipped with a bu↵erthat can be used in order to store temporarily thecollected information until the network connectiv-ity is resumed. For instance, if the sink nodes usea GPRS module in order to upload the informationto the data back-end infrastructure, it is only neces-sary for the farmer to pay the costs associated withthe data plans of the sink nodes and not for thewhole network.

Full Cloud Connectivity In this case it is nec-essary that all the WSNs nodes maintain connec-tivity with the data back-end continuously in time.In this case, it is necessary each network node to beequipped with the long-range communication radio(besides the short-range radio for the ad hoc com-munications). The distinction between sink nodeand mesh node continues to be applied in this ar-chitecture, as for each sub ad hoc network only acertain number of nodes will act as sinks and turnon that long-range radio. So it is necessary that allthe system’s nodes could adapt themselves depend-ing on the network’s current situation and so mayalternate between sink nodes and mesh nodes in or-der to maintain network communication with thedata back-end infrastructure. For instance, there isan ad hoc network that is composed by only onesink node, the animals had moved around in thegrazing field and the network was divided into twoindependent networks. In this situation, the nodesfrom the ad hoc network that becomes without thesink node detect the absence of the sink node andelects one of its nodes to become the new networksink so that the collected data Hence, the systembecomes robustness to node failures, tolerating thefailure of any kind of nodes by automatically adjust-ing to each existing scenario and maintaining thisway connectivity with the back-end infrastructure.Depending on the specific real deployment sce-

nario, there are two main approaches communicatewith the Internet (for uploading the collected datato the back-end infrastructure, through a gateway).In the ideal case, there exists a cellular servicecovering the system deployment area, so that thelong-range communication radio could use, for in-stance, the GPRS technology, and so the node thatturns on this communication interface becomesalso the system gateway. This solution could beinteresting in the case of extensive grazing areas.Otherwise, if there is no cellular service coveringthe area, the sink nodes, using a long-range radiolink, could deliver the sensed data to an Internetgateway, which in this situation corresponds toa node outside the ad hoc network (for instancelocated in a farm o�ce). This could be done usingintermediate relaying nodes, depending on thespecific real scenario. For instance, if the distancesbetween the gateway and the pasture fields aretoo large, it may be necessary the usage of staticintermediate nodes on the field.

3.2. Cloud Computing Platform

The back-end infrastructure that supports theWSN corresponds to a Cloud Computing platform.This back-end platform is in charge of four relevantfunctions: data processing, data storage, eventdetection as well as alarm reporting. As thissolution is Cloud-based, the Cloud Computingresources can be easily and automatically adjustedaccording to new application’s demands, or asthe application’s requirements grow, without thefarmer having to invest more money in back-endinfrastructure. The Cloud Computing platformwill also be in charge of sending to the end-userdigests (e.g., via email) containing a summary ofthe monitorization done during a period of a day,week, month, etc.

3.3. Web Application

The end-user application will correspond to aWeb application. In order to get access to the sys-tem information, the application will connect to theCloud platform and will make requests to it. Usingthis application, the farmer can visualize the lastreported state of the system and of its nodes, con-sult historical information that have been saved, seethe events that have been detected by the platformas well as interact with the system.

4. Implementation

As mentioned above in chapter 3, the system’s ar-chitecture is intended to be generic, although its im-plementation decisions depend directly on the realapplication scenario where the system will be de-ployed. In this context, this project has the collab-

4

Page 5: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

oration of the enterprise Sensefinity R�1, which is astartup company that provides M2M solutions as aservice to other companies or partners in the mostvaried areas, allying the development of hardwareand software. This collaboration allowed to sup-port the development of this project. The enterpriseYDreams Robotics2 has also supported this projectand allowed to test and validate the first prototypein a real application scenario, using the network ofFundao’s Fab Lab Aldeias do Xisto. In this con-text, the company Queijaria Ribeira de Alpreade,located in the Portuguese village named Zebras nearFundao, has immediately demonstrated interest inthis project in order to innovate the monitorizationdone on its assets.

A requirement analysis was made in the Quei-jaria Ribeira de Alpreade’s o�ces involving variousexperts in this field that work directly with the an-imals or who are directly involved in the manage-ment activities of the business. Through the inter-views it was identified that the monitorization willbe made in dairy sheep that are usually freely graz-ing in a large dimension pasture (tens of hectares)with cellular service covering the region. Theyspend most of their time alternating between graz-ing and resting/ruminating, presenting slow move-ments (except during short stress periods). Sheepgraze in cohesive groups and isolation is a source ofstress to them. They are social animals and formstrong social hierarchies between them. Generally,in the top of the hierarchy there are some leadingsheep that influence the other animals, particularlytheir grazing movements, therefore the other sheeptend to follow all their decisions. Usually, the farm-ers tag these leading sheep with a bell on their col-lars to easily locate them.

Hence, it was identified the main functionalitiesthat needed to be supported, according to priorityrequirements defined by the sta↵ for the firstsystem prototype, which are illustrated in figure2. Although these functionalities are specific tothis pilot company’s interests, some of them aretransversal to the branch of the farm animalsmonitorization and even common to other sectorsof our society:

1. Determine the current position of an animalbased in the last reported position;

2. Build the route taken by a sheep as well as bythe whole flock of sheep, to clearly identify thepastures used as well as the ones with better quality;

1http://www.sensefinity.com (accessed last time on

19th December 2014)

2http://www.ydreamsrobotics.com (accessed last time

on 19th December 2014)

3. As the sheep are freely grazing sometimes theysurpass the farm limits, therefore it is intendedto have a geo-fencing functionality that sends analarm to the farmer sta↵ indicating this occurrence;

4. Inform the farmer when the system detects acut in the collar, indicating a possible theft;

5. Alterations in the normal bustle of an animalmay indicate to the farmer valuable informations,therefore the farmers want to be informed whenan animal presents movement values that aresignificantly above or below the mean for eachindividual animal, taking into account the historyof that specific animal;

6. As when an animal picks a particular infectiousdisease it is necessary to slaughter the whole flockof sheep, therefore it is very interesting to infer thedirect/indirect interactions between the variousanimals, based on the historical distance betweenthem, in order to isolate only the potentially in-fected sheep, thereby avoiding slaughtering healthyones that were not in danger of contagious.

Flock of sheep

Virtual fenceOut of the fence!

Possible disease!

Possiblyinfected!

Sheep path

Cut in the collar!Possible theft!

Figure 2: The use-case illustrated.

These leader sheep will correspond to the sinknodes of the WSN as they tend to have more sheepclose to them. The other sheep will correspond tomesh nodes that will send its data through multi-hop to the sink nodes, using for that a short-rangeradio. As the region is covered by a cellular service,it was chosen the GPRS technology to send the col-lected network information to the data back-end.Therefore, using the GPRS module, the sink nodesof the network will also play the role of gatewaynodes.

Due to the natural mobility of the animals, theflock of sheep may become partitioned in varioussub ad hoc networks, which may not have connec-tivity with the sink nodes. In order to overcome thisfact and as all the sheep will be equipped with theultimate version of the first prototype that includesa GPRS module, the mesh nodes could turn tem-porarily into sink nodes when they detect that itssub network has no connectivity with any sink node.

5

Page 6: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

This way the information collected by the networkmay continue to reach the data back-end infrastruc-ture through the recently elected sink node.

The Cloud Computing Platform used wasthe Machinates R� designed and maintained bythe Sensefinity R� enterprise. The Machinates R�

platform only understands the messages that areformatted following the Columbus R� model. There-fore the WSN nodes have to send the informationin Columbus R� messages. The information collectedby the WSN and stored in the Machinates R� can beconsulted by the farmer through a GUI providedby the Machinates R� platform.

4.1. Network Protocol

The implemented gradient-based routing proto-col was designed for convergent tra�c in mobilelarge scale networks where the data packets flowto sink nodes, which aggregate all the informationcollected by the network. This protocol has twonetwork phases; the first one corresponds to thenetwork configuration phase responsible for in-forming to each network node the current one-hopneighbours connected to the sink nodes and theirheights on the network in relation to the sinknodes. Such information will allow in the future(i.e., in the data exchange phase) to deliver datapackets to the sinks through a multi-hop approach.As this protocol is intended to be applied in amobile network, the network configuration phasewill be periodically repeated in order to alloweach node to refresh its vision of the currentnetwork state, having origin in the sink nodesthat broadcasts a network configuration packet.It was chosen a single-path routing approach inorder to forward the data packets to the sinknodes, sending them through the most adequateneighbour (the one-hop neighbour that is closer inhops to a sink node, i.e. the neighbour with lowerheight). It was also used a point-to-point messagedelivery confirmation. Each network node willcommunicate in the data exchange phase adjustingits radio communication signal strength accordingwith the targeted neighbour for communication,allowing to saving energy and reducing the networkinterference.

4.2. Hardware

It were used the eZ430-RF2500 module fromTexas Instruments combined with the second gen-eration node solution from Sensefinity R�, calledButterfinger R�. The Butterfinger R� combines theMSP430F5419A MCU solution from Texas Instru-ments with a SIM908 module from SIMCom Wire-less Solutions. Using the SIM908 it is possible toupload the collected WSN information to the databack-end infrastructure through its GPRS module

and, at the same time allow to sense the current ge-ographic information of the node through its GPSunit as well as the its current battery information.As the Butterfinger R� has not a short-range radiofor communications inside the WSN, it was neces-sary to combine it with an eZ430-RF2500 module,which provides the CC2500 transceiver. The ulti-mate WSN node’s solution is illustrated in figure 3,which will be attached on the animals’ collars.

eZ430-RF2500 module

Butterfinger®

a) b)

Figure 3: The ultimate solution; a) protective case;b) the hardware disposition

5. EvaluationThe implemented system was tested in real

application scenarios. These field evaluationexperiments allowed to validate the developedsystem in a real scenario context as well as tocollect real environmental data. It also allowedto collect enriching opinions and other feedbackgiven by the professionals working on this specificbranch that could be very useful in future system’simprovements.

5.1. Queijaria Ribeira de Alpreade’s Experi-ments

The first system deployment inserted in a con-crete field testing case was made with the collabora-tion of the company Queijaria Ribeira de Alpreade,under the scope of the Fundao’s Fab Lab Aldeiasdo Xisto. This company’s business is based on theproduction of regional typical cheese. The innova-tion in the monitorization of their Livestock assetsis seen as a challenging and important aspect.

The system prototype was applied for the mon-itorization of dairy sheep. A reduced number ofnodes was available for these first experimental testson the field (4 nodes), therefore it was decided tovalidate this prototype in a small flock of sheep thatare freely grazing. Typically, between the sunsetand the sunrise the flock of sheep are resting in theopen barn signalled on the map, being freely grazingin the field in the remaining of the daytime insidethe delimited grazing area. Usually the sheep aregrouped in the barn at the beginning and end of theday in order to be milked (i.e., before being set freeand after being put back in the barn, respectively).

The monitorized sheep were equipped with theultimate node solution illustrated in figure 3. Eachnode was programmed to collect its GPS informa-tion each 15 minutes (TGPS) and to collect its bat-

6

Page 7: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

tery information hourly (Tbattery). The equipmentwas installed in the sheep’s collars as illustrated infigures 4 and 5.

Figure 4: Devices in di↵erent regional sheep collars

Figure 5: Sheep wearing a monitorization collar

Livestock MappingAs mentioned before, one of the device’s pri-

mordial functionalities is to collect its current ge-ographic position and report it to the final databack-end infrastructure. Figure 6 shows a screen-shot of the Machinates R� GUI illustrating the over-all system’s look and feel, as well as the location ofeach animal on the grazing field.

Figure 6: Overall vision of the system illustrated onthe Machinates R� GUI.

In figure 7 it is represented a heat map (builtusing the Google Maps API) whereas it is markedeach geographic position reported by a given sheepduring a 24 hours period. Therefore it is possibleto clearly identify the areas where the animal re-mained more active as well as to correlate themwith the period of the day in which the informa-tion was collected (i.e., if it was collected duringthe daytime period or the nighttime period).

Nighttime location

Daytime location

Figure 7: Animal’s location heat map during 24hours

It is also possible to observe in figure 7 that,as expected, during the daytime period (i.e., thegeographical positions collected between 10AMand 20PM) the animal’s locations are quite spreadalong the grazing field. During the nighttimeperiod (i.e., the geographical positions collectedbetween 20PM and 10AM), the geographical areaof activity is condensed essentially over the openbarn, as it was expected for this specific period ofthe day when the sheep are resting in the barn.

Geo-fencing

The geo-fencing concept represents a valuable ap-plication that is running upon the developed sys-tem. Combining it with the component responsibleto the alarms management, it is possible to be noti-fied when an animal crosses its virtual boundaries.

It was established a small virtual fence in-side the monitorized area, which forced the en-abling/disabling of alarms related with the geo-fencing feature. It was verified that every time asheep position was received with the informationthat the animal surpassed the virtual boundary, analarm was triggered. In the opposite situation, ev-ery time an animal came back to the allowed graz-ing area, the triggered alarm was cleared. In figure8 it is possible to view a screenshot of the Machi-nates R� GUI illustrating the triggering of an alarmoriginated by a sheep that crossed the virtual fence,exiting this way the allowed grazing perimeter.

Figure 8: Geo-fencing alarm illustrated on theMachinates R� GUI

7

Page 8: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

WSN ConnectivityThe mesh nodes of the network were programmed

to report the amount of time (in seconds) thatthey had network connectivity (through single-hopor multi-hop) with at least one sink node during30 minutes. This information was periodically col-lected during the daytime and the nighttime peri-ods, being represented in figure 9. The presented in-formation is related to 5 hours of experiment duringdaytime and other 5 hours during nighttime, beingall data collected by a single mesh node.

Nighttime

Daytime

4,35%

95,65%

100% Time without connectivityTime with connectivity

Time with connectivityTime without connectivity

Figure 9: Mesh node network connectivity duringthe daytime and nighttime period

It is possible to notice as expected that duringthe nighttime period the sheep stay su�cientlytogether when resting to maintain network connec-tivity with at least one sink node during the wholetime (100%). Looking now for the daytime period,it is possible to observe that the mesh nodeshave maintained connectivity with the sink nodesduring about 287 minutes out of the 300 minutesof the testing scenario, thus in most of the time(95,65%). The maximum communication range ofthe CC2500 transceiver tends to 16 meters. Thisfact combined with the short distances that sheepusually maintain among themselves during the dayand night periods, justify the connectivity timevalues obtained from this experience. As the sheepare freely grazing/resting in an open field duringthe daytime (in opposite with the nighttime),it is possible to observe also di↵erences betweenthe network connectivity times during daytimeand nighttime, being this value lower as expectedduring the daytime. The information extractedfrom this experiment gives a good indicator for thesystem as the data collected from each networknode can flow promptly to the sink node andin consequence to the data back-end with smalldelays, allowing the system to react more quicklyin the existence of an anormal situation that mayrequire special care.

Latency TimesConsidering latency times collected during the

field tests, it is possible to distinguish between thelatency time associated with the time interval thatthe information took to travel since the time it wascollected to the instant that it reaches the Machi-

nates R� back-end, and the one associated with thetime interval that the data took to be processedsince it enters in the Machinates R�.

Figures 10 and 11 report the variation of the la-tency times associated with the data packets col-lected by each of the four nodes of the WSN. Ineach figure it was represented the latency time foreach hour, corresponding this value to the averageof the latency times of all the data packets for thatgiven hour.

Tim

e (in

seco

nds)

Time (in UTC)

Figure 10: Latency times on data uploading to theMachinates R� back-end

Tim

e (in

seco

nds)

Time (in UTC)

Figure 11: Machinates R� data processing latencytimes

The sink nodes were programmed in order to onlyupload the information to the Machinates R� back-end when they have at least 10 data packets, be-ing each WSN node responsible to collect its GPSand battery information each 15 minutes and daily,respectively. Considering these facts, the latencyvalues illustrated in figure 10 correspond to the ex-pectations. The maximum latency upload value ob-tained was 23,22 minutes at 10AM and the mini-mum corresponded to 5,40 minutes at 3AM. The

8

Page 9: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

average for the entire day is 14,09 minutes, whichcorresponds to a value that it is reasonable and tol-erated by this system.

In the figure 11 it is possible to observe thatthe latency processing times of the Machinates R�

back-end never exceeded the 5 seconds, being theaverage for the entire day 2,82 seconds, which givesgood evidence for the system reliable operation.

5.2. Cascais Municipality’s Experiments

Some complementar tests were made in order tocollect more real information, in an attempt to fur-ther improve system evaluation with more subjects(animals). In this context, the Cascais Municipal-ity provided further support, making available theirsheep for carrying out further experiments.

Since the primary goal of this project was to col-lect the maximum possible information about thelocation of the monitorized animals in order to char-acterize their behavior, it was decided to collectGPS samples each 3 minutes and maintain the GPSmodule of the SIM908 unit always on. The sheepare herding in the natural park of Quinta do Pisao,being the herd composed by 68 sheep. It were onlymonitorized two sheep. The sheep are set free dailyin the morning and are routed to the grazing fieldlocated approximately 2km from the barn, beingcollected again to the barn at the end of the day.The grazing field corresponds to a large dimensionspace. The experiments were done during two days.

In figure 12 it is illustrated the variation of thetotal travelled distance by each monitorized sheepduring the experiments done in two days. It ispossible to observe that for each hour in the twodays the two monitorized sheep have similar trav-elled distances, indicating they had travelled ap-proximately the same. This fact is typically presentfor animal groups that maintain cohesive interac-tions between them, typically staying together. Thecollected information matches this behaviour as thesheep generally stay together, resulting this way invery similar total travelled distances between eachindividual sheep. The registered peaks at the 10AMcorrespond to the period that the sheep were beenreleased to the grazing field and travelled approxi-mately 2km to get there. The sheep travelled dif-ferent grazing paths during distinct time periods oneach day resulting in large di↵erences in the totaltravelled distance between the two days.

a)

b)

Trav

elle

d di

stanc

e (in

met

ers)

Trav

elle

d di

stanc

e (in

met

ers)

Time (in UTC)

Time (in UTC)

Figure 12: Total travelled distance by hour; a) ex-perimental day 1; b) experimental day 2

In figure 13 it is illustrated the location variationfor the two monitorized sheep during the first ex-perimental day. From the observation of this figureit is possible to observe that the two sheep presentsimilar variations of their latitudes and longitudesalong time. It is also possible to observe that thesetwo sheep travelled similar paths along the day.

Latitude

Long

itude Sheep 1

Sheep 2

Figure 13: Latitude and longitude variation

5.3. Herdade de Gambia’s ExperimentsThis project was also evaluated in the company

Herdade de Gambia, near Setbal. The main pur-pose of these experiments was to infer the capabil-ity of the proposed system in detecting and distin-guishing between thighs and healthy sheep. Thesheep are herding in the Herdade de Gambia’s pas-

9

Page 10: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

ture area, being the herd composed by 300 sheep.It were only monitorized two sheep, correspondingto a thigh and healthy ones. The experiments weredone during two days.In each day and for each sheep, it was deter-

mined the velocity between two consecutive mea-sured points. Thereafter, several features were ex-tracted, namely average and standard deviation val-ues for the two experimental days, as well as an en-tropy measure (corresponding to the entropy valuedetermined for the maximum scale according toCosta et al. [13]). The results extracted from thetwo experimental days are presented in table 1 andillustrated in figure 14.

Day 1 Avg Std Entropy

Normal Sheep 0,21 0,15 1,56

Thigh Sheep 0,18 0,17 1,42

Day 2 Avg Std Entropy

Normal Sheep 0,22 0,16 2,44

Thigh Sheep 0,21 0,24 1,80

Table 1: Statistical information collected from thetwo experimental days

Day 1 Day 2

Figure 14: Illustration of the statistical informationcollected from the two experimental days

It can be noticed that the value of entropy issmaller for the thigh sheep during the two days ofexperiments. This may give some initial hint fora mechanism to identify healthy from non-healthysheep. Our hypothesis concerning learning animalshealth remains to be tested upon the future avail-ability of more training data (just two collars wereavailable for this experimental evaluation). It con-cerns the variation of the entropy values over severaldays, namely if for non-healthy individuals the en-tropy value over several days gets consistently lowerthan for healthy individuals (as shown in figure 14just for two experimental days). On a neural net-work, the inputs could be the entropy values of ananimal over several days, and the output a value

giving the probability of an animal being healthy,or not.

However, given the extremely small dataset avail-able, no meaningful conclusions can be extractedconcerning:

• The best features to extract from the data inorder to feed a learning mechanism;

• The capability, or not, of identifying healthyanimals from non-healthy ones using their pat-terns of motion.

Concerning the last point, Costa et al. [13] haveshown that the fractal property of organisms, suchas given by multi-scale entropy measure, gives ameasure of an organism healthy, and have shownthis strategy applied to Electrocardiography (ECG)signals, as well as motion data. However, on theirexperiments the sampling frequency is significantlyhigher than 3 minutes, and windows of analysis con-tain thousands of points (compared to nearly 100 to200 data points for 6 to 8 hours collection of sheeplocation data), and hence is arguable if such ap-proach could bring in the future some benefits, ornot, for the problem at hand.

6. ConclusionsThis work proposes a WSN system based on a

Cloud Computing platform specifically designed forthe Livestock monitorization area. This monitoriza-tion was centered on the periodical reporting of theanimals’ geographical location, and correspondentextraction of useful information to the farmer. Af-ter carrying out interviews with specialized sta↵, itwas possible to make important design decisions.

The WSN is formed by the group of animals to bemonitorized, being each device installed in each in-dividual animal. The animal’s location is collectedusing a GPS receiver. The information collected byeach animal is propagated in the mobile ad hoc net-work following a gradient routing protocol strategy.The network nodes have the capability of proac-tively adapting themselves between mesh or sinknodes, according to the current network topology.Besides collecting information, the sink nodes havethe important role of transmitting the WSN infor-mation to the Cloud Computing platform throughGPRS. The Cloud Computing platform gives sup-port to the WSN by storing and processing its data.

Finally, it was produced the first system func-tional prototype that was submitted to a rigorousevaluation process. This first prototype was testedin real scenario applications, in particular for themonitorization of free-ranging dairy sheep. The re-sults obtained from these experimental tests werequite positive, giving good indicators of its e↵ective-ness in this kind of monitorization solutions. The

10

Page 11: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

implemented system endured the demanding andunpredictable conditions that characterize these en-vironmental scenarios. During these experiments, itwas possible to extract very interesting real infor-mation as well as enriching feedback from special-ized sta↵, which will certainly be used for futuresystem improvements.In conclusion, this first system prototype that

was used as a proof of concept has demonstratedthat it can be e↵ectively employed in this kindof monitorization scenarios, giving automaticallyvaluable information to the farmer that would oth-erwise be very di�cult to extract using traditionalmonitorization mechanisms.

6.1. Future WorkAs future work and in order to improve the im-

plemented system, there are some topics that maybe improved or completed, namely:

• Optimizing the hardware solution;

• Explore the Wake-on-Radio (WOR) feature ofthe CC2500 transceiver;

• Adopt an energy harvesting solution;

• Replace the current GPS antenna with an ac-tive antenna;

• Optimize the Columbus R� messages in order toreduce the size of the messages;

• Allow to change system parameters throughthe Machinates R� GUI;

• Implement some features that were not com-pleted in this first prototype system (such asdetect and report cuts in the sheep’s collarsand allow to identify the direct and indirectinteractions between the animals);

• Particularly in the Queijaria Ribeira de Al-preade’s use-case, extend in the future themonitorization to other components of thebusiness (e.g., milking system);

• Continue the experiments done in the companyHerdade de Gambia with a higher number ofmonitorized animals in di↵erent health condi-tions for a longer period of time in order to testthe solution’s e↵ectiveness in detecting and dis-tinguishing between healthy and non-healthysheep;

• Apply machine learning strategies to collecteddata in order to detect certain abnormal behav-ioral patterns that may suggest possible animaldiseases.

References[1] E. Tullo, I. Fontana, and M. Guarino, “Preci-

sion livestock farming: An overview of imageand sound labelling,” in Precision LivestockFarming ’13, pp. 30–38, September 2013.

[2] D. Berckmans, “Automatic on-line monitor-ing of animals by precision livestock farming,”in International Society for Animal Hygiene,pp. 27–30, 2004.

[3] K. Kwong, T. Wu, H. Goh, K. Sasloglou,B. Stephen, I. Glover, C. Shen, W. Du,C. Michie, and I. Andonovic, “Practical con-siderations for wireless sensor networks in cat-tle monitoring applications,” in Computers andElectronics in Agriculture, vol. 81, pp. 33–44,February 2012.

[4] K. Kwong, T. Wu, H. Goh, K. Sasloglou,B. Stephen, I. Glover, C. Shen, W. Du,C. Michie, and I. Andonovic, “Implementa-tion of herd management system with wirelesssensor networks,” in Wireless Sensor Systems,vol. 1, issue 2, pp. 55–65, June 2011.

[5] W. Edwards, A. Chamra, R. Mayer, andT. Olsen, “Estimated costs for livestock fenc-ing,” in Iowa State University Extension andOutreach, pp. 1–4, February 2012.

[6] D. Evans, “The internet of things: How thenext evolution of the internet is changing ev-erything,” in Cisco Internet Business SolutionsGroup (IBSG), April 2011.

[7] P. Juang, H. Oki, Y. Wang, M. Martonosi,L. Peh, and D. Rubenstein, “Energy-e�cientcomputing for wildlife tracking: Design trade-o↵s and early experiences with zebranet,” in10th International Conference on ArchitecturalSupport for Programming Languages and Op-erating Systems (ASPLOS-X), pp. 96–107, Oc-tober 2002.

[8] E. Nadimi, R. Jrgensen, V. Blanes-Vidal, andS. Christensen, “Monitoring and classifying an-imal behavior using zigbee-based mobile adhoc wireless sensor networks and artificial neu-ral networks,” in Computers and Electronics inAgriculture, vol. 82, pp. 44–54, March 2012.

[9] P. Sikka, P. Corke, P. Valencia, C. Crossman,D. Swain, and G. Bishop-Hurley, “Wireless adhoc sensor and actuator networks on the farm,”in Information Processing in Sensor Networks(IPSN), pp. 492–499, April 2006.

[10] K. Martinez, R. Ong, and J. Hart, “Glacsweb:A sensor network for hostile environments,” in

11

Page 12: Cloud-based Wireless Sensor Network System for Smart ... · Nadimi et al. [8] propose a system capable of monitoring behavioural parameters of individ-ual animals and transforming

First Annual IEEE Communications SocietyConference on Sensor and Ad Hoc Commu-nications and Networks (SECON), pp. 81–87,2004.

[11] Z. Butler, P. Corke, R. Peterson, and D. Rus,“Networked cows: Virtual fences for control-ling cows,” in 2nd international conferenceon Mobile systems, applications, and services,2004.

[12] B. Wietrzyk, M. Radenkovic, and I. Kostadi-nov, “Practical manets for pervasive cattlemonitoring,” in Seventh International Confer-ence on Networking (ICN), pp. 14–23, April2008.

[13] M. Costa, A. Goldberger, and C. Peng, ““Mul-tiscale Entropy Analysis of Biological Sig-nals”,” in Physical Review E, February 2005.

12