Real Time Traceability and Monitoring System for Agricultural Products Based on Wireless Sensor Network

A system to monitor and trace the yields and distribution of agricultural products is an important precision agricultural application. The system can be used to predict the next year's yields or provide the distribution channel of agricultural products from farmers to customers. Existing traceability and monitoring systems, usually, are implemented by using both wireless sensor network (WSN) and radio frequency identification (RFID) techniques. In this paper, we propose a system architecture that only requires WSN techniques and implement it. The implementing system consists of sensor nodes, communication hubs, a communication protocol, and an event detection engine. We define events to trace and monitor agricultural products, and our event detection engine detects those events by using the current location and the status of each sensor node. We describe the overall architecture of the proposed system and implementation details.


Introduction
During the past couple of decades, precision agriculture (PA) has emerged with the advances of electronic equipment which has enabled farmers to increase the efficiency of their operations and develop new farming practices.PA is based on numerous technologies and infrastructures such as data gathering and management systems, geographic information systems (GIS), global positioning systems (GPS), microelectronics, wireless sensor networks (WSNs), and radio frequency identification (RFID) technologies [1][2][3][4][5][6].Various applications of PA have been proposed and researched extensively.Among many applications, we focus on the agricultural products' trace and monitoring systems.
Monitoring and tracing systems for the yields and distribution of agricultural products are one of the important PA applications.The results of the systems can be used to predict the next year's yields.Also, we can provide the distribution channel of agricultural products from farmers to customers by using those systems.Most of the existing systems are based on both RFID systems and WSNs.Usually, RFIDs are used to trace agricultural products and measure their yields, and WSNs are for monitoring the environment during the distribution and storage [1].
In this paper, we propose a trace and monitoring system for agricultural products' yields and distribution based on WSNs.Without RFID technologies, we efficiently trace agricultural products and also measure the yields of agricultural products.If humidity, temperature, and other sensors are added to our sensor nodes, the applicable area of our system can be extended to quality oriented applications.We propose an overall architecture of our proposed system and describe the implementation details of the proposed system.This paper is organized as follows.In Section 2, we explain the existing WSNs and RFID technologies and various applications of PA based on WSNs and RFIDs.In Section 3, we explain the physical and logical architecture of the proposed system with some diagrams.In Section 4, we describe the implementation details of our proposed system.Finally, in Section 5, we conclude our paper.

Wireless Sensor Networks.
A wireless sensor network is a system that consists of radio frequency (RF) transceivers, sensors, microcontrollers, and power sources.Wireless sensor networks have some properties, such as self-organizing, self-configuring, self-diagnosing, and self-healing properties.These properties solve problems or enable applications that traditional technologies could not address [3][4][5].
An obvious advantage of wireless transmission is a significant reduction and simplification in deployment.Wireless sensor nodes allow impossible sensor applications, such as monitoring dangerous, hazardous, unwired, or remote areas and locations.This technology provides nearly unlimited installation flexibility for sensor nodes and increased network robustness.Furthermore, wireless technology reduces maintenance complexity and costs.Wireless sensor networks allow faster deployment and installation of various types of sensors because many of these networks provide self-organizing, selfconfiguring, self-diagnosing, and self-healing capabilities to the sensor nodes [3][4][5].
Wireless sensor node technology allows MEMS (microelectro-mechanical systems) sensors to be integrated with a sensor node with extremely low cost, small size, and low power requirement.MEMS pressure sensors, temperature sensors, humidity sensors, and various capacitive sensors for proximity, position, velocity, acceleration, and vibration measurements have been integrated to wireless sensor nodes [7].These MEMS sensors enable quality oriented applications.

Radio Frequency Identification (RFID).
RFID systems are comprised of three main components such as the tag or transponder, the reader or transceiver that reads and writes data to a transponder, and the computer containing database and information management software.RFID tags can be active, passive, or semipassive.Passive and semipassive RFIDs send their data by reflection or modulation of the electromagnetic field that was emitted by the reader.The typical reading range is between 10 cm and 3 m [1,8].
The major drawback of RFID is the limited reading range of about 20 cm, compared to other 13.56 MHz passive RFID tags (ISO15693).Sensor tags with UHF interfaces extend the reading range to a few meters and allow for automated readout during the unloading of the transport, but their signals cannot penetrate metals or liquids.Accessing passive tags during transport in a packed container is far beyond technical feasibility.

PA Applications.
According to [3], there are various PA applications that have been studied and addressed.Particularly, we briefly describe RFID-based traceability systems of [3] in the following.Inexpensive, disposable RFID biosensor tags were studied.These tags were used for history checking and contamination and inventory control on food products.The biosensor tags were based on an acoustic wave platform and used antigen-antibody reaction to detect bacteria.Also, some researchers introduced the potential of RFID tags for smart packaging, automatic checkout, smart appliances, smart recycling, and marketing [3].
An on-the-road monitoring system for animals during transportation was developed.The system included sensors installed in the animal compartment to identify the animals and to monitor the air-quality, vibration, and animal behaviors.A GPS provided the location of the vehicle.A data transfer unit regularly sent data to a service center via the GSM network.It was reported that the system greatly improved animal welfare during handling and transportation [3].
A field data acquisition system was developed to collect data for crop management and spatial-variability studies.
The system consisted of a data collection vehicle, a manager vehicle, and data acquisition and control systems on farm machines.The system collected data of soil water availability, soil compaction, soil fertility, biomass yield, leaf area index, leaf temperature, leaf chlorophyll content, plant water status, local climate data, insect-disease-weed infestation, grain yield, and so forth.The data collection vehicle retrieved data from farm machines via a WLAN and analyzed, stored, and transmitted the data to the manager vehicle wirelessly [3].
A greenhouse monitoring and control system was developed to collect outdoor and indoor climate data in Portugal.Several solar-powered data acquisition stations (SPWAS) were installed indoor and outdoor to measure and monitor the climate data.RF links were established among multiple SPWASs and a base station, which was used to control the SPWASs and to store the data [3].

Architecture of the Proposed System
The architecture of our proposed yields and distribution trace system for agricultural products is in Figure 1.We assume that workflow is as follows.First, picked agricultural products are stored in farms' local cold warehouses for a time.Picked agricultural products are packed in boxes that sensors are attached to.Agricultural products stored in farms are transported to an APC (agricultural products processing center).The APC sorts and repacks agricultural products transported from farms and stores to its cold warehouse.The agricultural products are shipped whenever wholesalers require products.
Each farm has boxes that are equipped with sensor nodes.A sensor node has some functionalities such as temperature sensors, humid sensors, gyro sensors, infrared sensors, CPU, and wireless communication functions.CPU and wireless communication functions are mandatory.Other functions may be optionally applied to a sensor node.Also, a communication hub is placed in each farm's local cold warehouse.The communication hub gathers data from sensor nodes in boxes and processes sensor data.Also, transport vehicles that deliver agricultural product boxes may have one or more communication hubs.Communication hubs send gathered data to a central server with their location data.The server stores sent data from each communication hub to a local database.
Sensor nodes of the proposed system are inactive status when they are not used.Infrared sensor and gyro sensor of a sensor node detect whether boxes are used or not.The sensor node is activated when agricultural products are put into a box and the box is moved.A communication hub sends gathered data from sensor nodes and location data of the communication hub.The location data is used to detect and trace the boxes that are equipped with sensor nodes.

Implementation of the Proposed System
In this section, we describe the implementation details of our proposed system.We focus on software components rather than hardware components.Mandatory requirements of hardware components like sensor nodes and communication units are shown in Table 1. Figure 2 shows sensor nodes, a hub, and box equipped with a sensor node.A sensor node is installed in a box as in Figure 2(b) to detect whether the box is filled with agricultural products.Figure 3 shows the database schema for the proposed system.Temperature humidity and CO2 tables are used when a sensor node has humidity, temperature, and CO2 sensors.Hub table is used to register hubs.Each hub has cell phone number for its WCDMA module.Hub table stores the phone number and the ID of a hub.Location table stores the  Place table registers the location of farms, APCs, and wholesalers.Our system traces and monitors the distribution path and yields of agricultural products by using this table and locations of hubs.Event table stores detected events by our event detection engine.We define four events as shown in Table 2.The event detection engine uses those tables and input data stream from hubs to detect these events.Event 1 occurs when a box containing agricultural products has moved into a registered place.Event 2 occurs when the box Algorithm 1 shows the algorithm of our event detection engine.This algorithm works whenever a central server receives data from a hub.First, it finds a place where a sensor exists by querying which geo fence contains the location of the sensor.Geo fence is given by users, and it is used to compensate the GPS error.Then, the algorithm checks the previous event of the sensor and decides the event of the sensor as in Figure 3.If previous event is null, it means that the sensor is activated at the place, and event 0 is assigned.If previous event is 1, and the current place is null, the event of the sensor node is 3 which means that the sensor node is moving.If the previous event is 3, and the current place is not null, the event of the sensor node is 1.Also, if the previous event is 2, and the current place is null, the sensor node starts moving out of a place.Figure 4 shows an example of event detection algorithm.There are three places and transport vehicles with CUs.Three boxes with sensor nodes are moved between places by transport vehicles.At time t1, sensor 3 (S3) sends data through the hub of place 1.Since the previous event of S3 is null and the current place is not null, we decide that event 1 occurs.At time t2, S3 sends its data through the hub of place 2. The previous event of S3 is 1, and the current place is place 2 so we decide the events are 2 and 1.It means that the sensor node was moved out of place 1 and moved in place 2. At t2, sensor 1 (S1) sends its data through the hub of a transport vehicle.The previous of S1 is 1, and the current place is null, so the events

Figure 1 :
Figure 1: The overall architecture of the proposed system.

Figure 2 :
Figure 2: Deployed sensor nodes and a communication hub.

Figure 3 :
Figure 3: Database schema for the proposed system.

Table 1 :
Required specifications of hardware components.

Table 2 :
Definition of events.