0% found this document useful (0 votes)
33 views5 pages

Extending Cooja Simulator With Real Weather and Soil Data

The document discusses extending the Cooja simulator to integrate real weather and soil data based on sensor node locations. This is done by developing a plugin called the Weather & Soil Data Provider (WSDP) that retrieves real data from APIs and provides it to nodes in the simulation based on their coordinates. This allows testing wireless sensor network designs and applications for precision agriculture using actual environmental conditions.

Uploaded by

bumb950
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

Extending Cooja Simulator With Real Weather and Soil Data

The document discusses extending the Cooja simulator to integrate real weather and soil data based on sensor node locations. This is done by developing a plugin called the Weather & Soil Data Provider (WSDP) that retrieves real data from APIs and provides it to nodes in the simulation based on their coordinates. This allows testing wireless sensor network designs and applications for precision agriculture using actual environmental conditions.

Uploaded by

bumb950
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Extending Cooja simulator with real weather and

soil data
Alexandru Bumb, Bogdan Iancu, Emil Cebuc
Faculty of Automation and Computer Science, Computer Science Department
Technical University of Cluj-Napoca
Cluj-Napoca, Romania
[email protected], [email protected], [email protected]

Abstract— Modern agriculture needs tools and precisely, than if they are under or over irrigated. Soil
technologies that can improve production efficiency, product humidity provides useful guidelines to avoid water stress
quality, postharvest operations, and reduce their by projecting when to irrigate. In [2] is presented a
environmental impact. Wireless sensor networks can help theoretical approach for improving the efficiency of an
monitoring fields, vineyards and orchards, thus helping
irrigation system for potato fields. An irrigation
farmers to prevent damages to their crops and increasing crop
production. The paper presents an extension to Cooja management model is given to estimate agricultural
simulator, called Weather & soil data provider (WSDP), parameters using mathematical calculations. The system is
which offers real weather and soil data at node level, based on not implemented on a particular WSN simulator and does
nodes’ geographical coordinates. WSDP is helping specialists not use real weather and soil data.
that want to develop/deploy a WSN at a certain location, to
find more details about the environment parameters and to be Vineyard monitoring described in [1] is one of the
able to assess the feasibility of their plan. most classical examples of sensor network monitoring. The
goal is to reduce water irrigation and to predict or discover
Keywords—WSN, WSDP, weather, soil, sensor, vine sicknesses as soon as possible. This not only
simulation minimizes costs of growing the vines through less water
usage, but also enables organic growing with low usage of
I. INTRODUCTION pesticides.
Wireless sensor network (WSN) is a collective term to
specify a rather independent set of tiny computers with the Sensors used include air temperature, air humidity,
main target of sensing some physical property of their solar radiation, air pressure, soil moisture, leaf moisture,
environment such as vibration, humidity, or temperature. ultraviolet radiation, pluviometer (rain sensor), and
anemometer (wind sensor).
A WSN consists of a few to thousands of sensor nodes,
often also referred to as nodes or sensors, which are The sensors are typically spread over a large area of
connected to each other via wireless communications. the vineyard and deliver their information to an external
Typically, there is also at least one special node, called the database, in which the information is processed by special
sink or the base station, which connects the sensor network environmental models. The results are shown to the
to the outside world [1]. scientist or to the vineyard farmer and can be automatically
connected to the irrigation system.
Modern agriculture needs tools and technologies that
can improve production efficiency, product quality, The system in [1] is based software and hardware
postharvest operations, and reduce their environmental components used for vineyard monitoring in real-life
impact. Automation in agriculture brings about a deployments. Such a system is expensive, therefore a
fundamental contribution to what is now known as preliminary WSN simulation of the actual proposed
precision agriculture (or precision farming). A definition of deployment is recommended, trying to assess the feasibility
precision agriculture may be the following: the technique of the plan.
of applying the right amount of input (water, fertilizer, This paper proposes to provide a technical solution for
pesticide, etc.) at the right location and at the right time to obtaining real data, such as temperature, humidity,
enhance production and improve quality, while protecting pressure, soil information, at node level in a WSN, based
the environment [2]. on nodes’ geographical coordinates, thus helping people
Wireless sensor networks can help monitoring fields, that want to develop a WSN dedicated to precision
vineyards and orchards, thus helping farmers to prevent agriculture, at a certain location, to find more details about
damages to their crops and increasing crop production. the environment parameters and to be able to assess the
feasibility of their plan.
In [2] is presented a system for monitoring a potato
field. Potato is a water-stress-sensitive crop. Potatoes have The originality of the proposed approach consists in
a relatively shallow root system that provides very little the development of a plugin that extends Cooja simulator
margin for irrigation errors. Potato plants are more functionality with real weather and soil data gathering. To
productive and produce higher quality tubers when watered our knowledge, no module that integrates real data into
Cooja, from external APIs, exists. Using the developed

978-1-5386-5541-2/18/$31.00 ©2018 IEEE


plugin, in-depth network behavior analysis can be application prototyping. Tmote Sky leverages industry
performed using real data. Furthermore, data science standards like USB and IEEE 802.15.4 to interoperate
applications can be developed using Cooja simulator to seamlessly with other devices. By using industry standards,
better understand the feasibility of certain agricultural integrating humidity, temperature, and light sensors, and
operations. providing flexible interconnection with peripherals, Tmote
Sky enables a wide range of mesh network applications [4].
This paper is organized as follows: Section II provides
background information related to wireless sensor Contiki [5] is an operating system for networked,
networks and research topics in the area of WSN hardware memory-constrained systems with a focus on low-power
and software. Section III presents the architecture of the wireless Internet of Things devices. Contiki provides
proposed WSN platform for simulation / real data multitasking and a built-in Internet Protocol Suite (TCP/IP
gathering, with its main modules and their stack), yet it needs only about 10 kilobytes of random-
interconnections. The experimental results are described in access memory (RAM) and 30 kilobytes of read-only
section IV. Section V presents the main features of the memory (ROM).
current study, future developments and concludes the
Cooja [6] is the Contiki network simulator. Cooja
paper.
allows large and small networks of Contiki motes to be
simulated. Motes can be emulated at the hardware level,
II. BACKGROUND
which is slower but allows precise inspection of the system
WSNs are designed to gather information about the state behavior, or at a less detailed level, which is faster and
of physical world and transmit measured data to a allows simulation of larger networks. Network simulators
processing unit. allow network specialists to have practical feedback
Generally, a WSN consists of a number of wireless without the need to deploy a real network. Also, continuous
sensors (nodes) which can communicate with other sensors network monitoring can be performed for detecting
or with a base station (gateway or sink) using a radio failures, identifying the causes and remedying them [7].
connection. The data is collected and compressed at the
In order to be able to gather real data at node level, in
wireless sensor layer and then relayed to another sensor or
a simulation, weather data and soil data API’s need to be
sent directly to the gateway [3]. The data is further
transmitted from the base station to the core system (local employed.
database, cloud, processing system) for storage and data OpenWeatherMap is an online service that provides
analytics. There are many communication protocols used, weather data, including current weather data, forecasts, and
most of the nodes using IEEE 802.11 series, IEEE 802.15.1 historical data to the developers of web services and mobile
(Bluetooth) or IEEE 802.15.4 (ZigBee). applications. For data sources, it utilizes meteorological
Wireless sensors networks can incorporate multiple broadcast services, raw data from airport weather stations,
types of sensors, thus there is a wide range of application raw data from radar stations, and raw data from other
areas where WSNs are being used. official weather stations. All data is processed by
OpenWeatherMap in a way that it attempts to provide
In the agricultural domain, WSN technology can be
accurate online weather forecast data and weather maps,
applied to improve potato crop production. By monitoring
and understanding individual crop and its requirements, such as those for clouds or precipitation. Beyond that, the
farmers can potentially identify the various fertilizers, service is focused on the social aspect by involving weather
irrigation and other requirements. In [2] an irrigation station owners in connecting to the service and thereby
management model is given to estimate agricultural increasing weather data accuracy. The ideology is inspired
parameters using mathematical calculations with specific by OpenStreetMap and Wikipedia that make information
example of potato crop. free and available for everybody [8].
In order to be able to efficiently simulate a WSN, SoilGrids is a system for automated soil mapping
specific hardware and software components need to be based on state-of-the-art spatial predictions methods.
employed (see figure 1). Such components are Tmote Sky SoilGrids predictions are based on globally fitted models
(sensor node), Contiki (WSN operating system), Cooja using soil profile and environmental covariate data.
(WSN simulator) and a communication protocol. Currently, SoilGrids.org serves a collection of updatable
soil property and class maps of the world at 1 km / 250 m
spatial resolutions produced using automated soil mapping
based on machine learning algorithms. SoilGrids.org aims
at becoming OpenStreetMap and/or OpenWeatherMap for
soil data. SoilGrids data is available publicly under the
Open DataBase License [9].

III. WEATHER & SOIL DATA PROVIDER (WSDP)


In WSN applications, Contiki provides the firmware
for the sensor nodes (motes). Cooja enables users to
Fig.1. WSN simulation system
simulate a WSN, by emulating real hardware nodes (such
Tmote Sky is an ultra-low power wireless module for as Tmote Sky), enabling the usage of specific
use in sensor networks, monitoring applications, and rapid communication protocols (such as RPL), thus offering the
possibility to analyze the behavior of both the nodes and - United States Department of Agriculture (USDA)
the network. Soil Taxonomy suborders
Data gathering in Cooja is done by a sink node, which - Soil organic carbon content in ‰ (g / kg)
receives information from the sender nodes. The collected - Soil pH in H2O and KCl solution
data is then processed by a tool integrated in Cooja, named - Sand, silt and clay (weight %)
Collect View. This tool enables the user to view the data - Bulk density (kg / ݉ଷ ) of the fine earth fraction (<
organized under different forms, such as tables or graphs. 2 mm)
Collected data includes network parameters, radio duty - Cation-exchange capacity (cmol / kg) of the fine
cycle, power consumption and sensors’ measured values. earth fraction
WSDP proposes a technical solution for real data - Coarse fragments (volumetric %)
gathering at node level, based on two components. First - Depth to bedrock (cm)
component takes the form of a Cooja plugin which makes - Texture class
calls to weather and soil data API’s and collect appropriate - Available water capacity until wilting point
information, based on node’s geographical position. The
collected data will be sent by the sender nodes to the sink A. Global system architecture
node, while the sink node will pass the data to the Collect
View. The second WSDP component extends the Collect
View functionality set, creating new panels for weather and
soil information, and interconnecting Collect View with the
data collection system, adapting the Collect View to new
data sources. WSDP is designed based on Model-View-
Controller (MVC) architectural pattern. Thus, the system is
easy to install/uninstall in Cooja and, due to its architecture,
it is open for functionality set extension.
The mathematical model from [10], integrated in
WSDP, uses as inputs the sink node’s geographical position
and its cartesian distance to a sender node, in order to be
able to compute the output: sender node’s geographical
position. For every sender node, its latitude and longitude
are used as parameters in API calls to OpenWeatherMap
and SoilGrids. The data received from the API’s is then
sent to sink node and finally passed to Collect View to be
displayed using graphs and charts.
Formulas used by the mathematical model:
1) Latitude (Φ), Longitude (λ), height (h) → X, Y, Z:

Fig.2. Global system architecture

Figure 2 depicts the global system architecture,


consisting of the following modules:
2) X, Y, Z → Latitude (Φ), Longitude (λ), height (h): Weather & Soil Data Provider – it is a Cooja plugin, which
computes the nodes’ geographical coordinates and use
them in REST API calls to OpenWeatherMap and
SoilGrids, thus collecting weather and soil data.
OpenWeatherMap API – it is a web service wihich
provides, based on geographical coordinates, weather data.
SoilGrids API – it is a web service which provides, based
on geographical coordinates, soil data.
Collect View – it is a Cooja tool. It receives data from
WSDP and displays it using graphs and charts.
Data collected and imported from OpenWeatherMap:
Sink Node – collects data from the sender nodes and passes
- temperature, humidity, pressure it to Collect View.
Data collected and imported from SoilGrids: Sender Node – receives data from WSDP and transmits it
- World Reference Base (WRB) class to sink node.
B. WSDP system architecture geographical coordinates, to select soil data depth
and to control the data acquiring process.
C. WSDP usage instructions
The WSDP configuration steps are:
- select the directories which will be used to store
the weather and soil data logs
- provide the geographical coordinates of the sink
node
- select the depth for which the soil data will be
Fig.3. WSDP system architecture requested from the SoilGrids API
Figure 3 depicts the WSDP system architecture, consisting The WSDP commands:
of the following modules:
- START DATA ACQUIRING: starts the data
Modules: collection from the API’s.
- STOP DATA ACQUIRING: stops the data
Model – models, using classes and attributes, the concepts
of node, weather data and soil data. collection from the API’s.
- RESET: resets the current configuration.
- Node Model: defines a set of methods used to - CLEAR LOGS HISTORY: deletes the weather
specify the cartesian and geographical coordinates and soil logs from the configured directories.
of a node.
- Weather Data Model: defines a set of methods
used to specify weather data for a node. IV. EXPERIMENTAL RESULTS
- Soil Data Model: defines a set of methods used to
The experimental simulation uses a grid topology
specify soil data for a node.
(depicted in figure 5), which means that the sender nodes
Controller – computes the nodes’ geographical have a fixed, predetermined position and a neighbor
coordinates, perform API calls to OpenWeatherMap and distance of 10 meters. The node with ID 1 is the sink node,
SoilGrids, collects data and creates the corresponding while the rest of the nodes are senders.
models.
- CoordinatesConverter: defines a set of methods
used for conversion between geographical and
cartesian coordinates.
- Weather Data Controller: performs REST API
calls to OpenWeatherMap, using sender nodes’
geographical coordinates, collects weather data
and assigns it to corresponding sender nodes.
- Soil Data Controller: performs REST API calls to
SoilGrids, using sender nodes’ geographical
coordinates, collects soil data and assigns it to
corresponding sender nodes.

Fig.5. Network topology

The WSDP is opened and configured. After the


configuration is done, the data collection can be started.
The Collect View is opened and configured. After the
configuration is done, the data collection can be started. As
a final step, the simulation need to be started.

The sink node can now receive data from the sender
Fig.4. WSDP user interface nodes and pass it to Collect View, which will display the
data in a graphical form.
View – builds an intuitive and easy-to-use graphical user
interface, which enables the user to configure and control Figures 6, 7, and 8 present examples of data collected by
WSDP. the WSDP, at the level of the node 6.
- WSDP Configuration Panel: enables the user to
configure log directories, to set sink node’s
V. DISCUSSIONS AND CONCLUSION
Modern agriculture needs tools and technologies that
can improve production efficiency, product quality,
postharvest operations, and reduce their environmental
impact. Wireless sensor networks can help monitoring
fields, vineyards and orchards, thus helping farmers to
prevent damages to their crops and increasing crop
production.

The paper describes WSDP, a technical solution which


enhances the capabilities of the simulation environment
provided by Cooja. WSDP provides real weather and soil
data at node level, based on nodes’ geographical
coordinates, thus helping people that want to develop a
Fig.6. Temperature data at node level WSN at a certain location, to find more details about the
environment parameters and to be able to assess the
feasibility of their plan. WSDP uses, in the process of data
gathering, reliable data sources, such as OpenWeatherMap
and SoilGrids. The system is open for integration of other
API’s. Using the developed WSDP plugin, in-depth
network behavior analysis can be performed using real
data. Furthermore, data science applications can be
developed using Cooja simulator to better understand the
feasibility of certain agricultural operations.

Possible future developments for WSDP include:


extending the compatibility for another nodes’ hardware
platforms; implementing and using WSDP in a real WSN
deployment; using more API’s in order to increase the
complexity and relevance of collected data.
Fig.7. Soil class at node level
ACKNOWLEDGMENT
The results presented in this paper were obtained with
the support of the Technical University of Cluj-Napoca
through the research Contract no. 1996/12.07.2017,
Internal Competition CICDI-2017.

REFERENCES
[1] A. Forster, “Introduction to wireless sensor networks”, Wiley-IEEE
Press, John Wiley & Sons, 2016.
[2] K. Shinghal, A. Noor, N.Srivastava , R. Singh, “Wireless sensor
networks in agriculture: For potato farming”, International Journal
of Engineering Science and Technology Vol. 2(8), 2010, pp. 3955-
3963.
[3] C. Townsend, S. Arms, “Wireless Sensor Networks: Principles and
Applications”, Sensor Technology Handbook, pp. 575-589, 2005.
[4] Tmote Sky Datasheet,
http://www.eecs.harvard.edu/~konrad/projects/shimmer/references/
Fig.8. Soil particles at node level
tmote-sky-datasheet.pdf
[5] B. Sobhan babu, P. Lakshmi Padmaja, T. Ramanjaneyulu, I.
Figure 5 presents, using a graph, the temperature
Lakshmi Narayana, K.Srikanth , “Role of COOJA Simulator in IoT”,
evolution over the simulation time, which measures the International Journal of Emerging Trends & Technology in
time elapsed from the simulation start. The speed of the Computer Science (IJETTCS), Volume 6, Issue 2, March - April
simulation time can be adjusted to different values. The 2017 , pp. 139-143 , ISSN 2278-6856.
[6] Contiki website, http://www.contiki-os.org/start.html
speed also depends on the number of nodes present on the
[7] A. Peculea, “Computer Network Monitoring System Using the
simulated WSN, the usage of more than one hundred nodes Embedded Event Manager”, in Automation, Computers, Applied
drastically decreasing the speed. Figure 6 presents the Mathematics Journal, Vol. 24, No.1, 2015, pp. 7-12
WRB 2006 and USDA 2014 soil classes. Figure 7 presents, [8] OpenWeatherMap website, https://openweathermap.org/
[9] ISRIC website, http://www.isric.org/explore/soilgrids
using a stacked bar chart, the soil particles (clay, sand, silt,
[10] George P. Gerdan, Rodney E. Deakin, “Transforming Cartesian
coarse fragments) and their proportion. coordinates X,Y,Z to Geographical coordinates φ, λ, h”, The
Australian Surveyor, Vol. 44, No. 1, pp. 55-63, June 1999

You might also like