An Arduino-Based Wireless Sensor Network for Soil Moisture Monitoring Using Decagon EC-5 Sensors

It is undeniable that wireless communication technology has become a very important component of modern society. One aspect of modern society in which application of wireless communication technologies has tremendous potential is in agricultural production. This is especially true in the area of sensing and transmission of relevant farming information such as weather, crop development, water quantity and quality, among others, which would allow farmers to make more accurate and timely farming decisions. A good example would be the application of wireless communication technology to transmit soil moisture data in real time to help farmers make irrigation scheduling decisions. Although many systems are commercially available for soil moisture monitoring, there are still many important factors, such as cost, limiting widespread adoption of this technology among growers. Our objective in this study was, therefore, to develop and test an affordable wireless communication system for monitoring soil moisture using Decagon EC-5 sensors. The new system uses Arduino-compatible microcontrollers and communication systems to sample and transmit values from four Decagon EC-5 soil moisture sensors. Developing the system required conducting lab calibrations for the EC-5 sensors for the microcontroller operating in either 10-bit or 12-bit analog-to-digital converter (ADC) resolution. The system was successfully tested in the field and reliably collected and transmitted data from a wheat field for more than two months.


Introduction
According to a recent report by the United Nations [1], the world's population continues to increase, reaching nearly 7.6 billion in mid-2017, adding one billion people since 2005 and two billion since 1993.The global population is growing by around 83 million per year and is expected to reach 8.6 billion in 2030, 9.8 billion in 2050 and 11.2 billion in 2100 [1].Ensuring that agricultural production can satisfy the needs of a growing population, not only globally but also locally, presents a tremendous challenge for farmers, scientists, and governments in the 21 st century.It is estimated that agricultural production will have to increase by 60% by 2050 to satisfy the expected demands for food and feed [2].During the Green Revolution of the 1960's, the world was able to meet the demand of the growing population for food and fiber by predominantly developing new high-yielding crop hybrids, increasing the application of farm inputs (such as water, fertilizers, pesticides, herbicides), and improving mechanization of farming operations.At that time, however, the potential environmental impacts of considerably increasing application of farm inputs was not a major concern as it is today.
Nowadays, the impact of agricultural inputs on the environment, especially in surface and groundwater resources is a critical aspect of current and future agricultural practices.At the same time, the economic sustainability of modern farming demands an ever more efficient use of agricultural inputs.In addition, the potential challenges imposed by climate change on agricultural production are also a major concern.As a consequence, in recent years, many organizations such as The United Nations are promoting the concept of Climate-Smart Agriculture as agriculture that sustainably increases productivity, enhances adapta- tion through increasing resilience, enhances mitigation through reducing or removing greenhouse gases (mitigation) where and when possible, and enhances achievement of national food security and development goals [2].
In order to achieve agricultural systems that are socially, environmentally, and economically sustainable, it is imperative that water resources and other agricultural inputs are used efficiently.This will require the development and adoption among growers of affordable and effective precision agricultural and irrigation technologies to enable farmers to apply water and other inputs when, where, and in the amount needed to increase profits and protect the environment.Soil moisture sensing is one of the technologies farmers can adopt to properly schedule irrigation, which has been shown to potentially increase profits while protecting the environment [3].Although many systems are commercially available for soil moisture monitoring, a number of factors still limit their adoption for irrigation scheduling among commercial growers [4].Consequently, irrigation scheduling decisions in most commercial farming operations are still based on "the condition of the crop".For example, [5] found that around 95% of growers in South Carolina used "the condition of the crop" to decide when to irrigate, which exceeded the national average of around 80%.The fact that most farmers are basing irrigation scheduling decisions mainly on "the condition of the crop" could potentially create considerable production, profitabili- ty, and environmental problems.
In recent years, however, there has been considerable development in open-source electronics [6], wireless data communication [7] [8] and Internet-Of-Things technologies [4] [9] [10] that provide opportunities for making soil moisture sensing technologies more accessible and more affordable for commercial growers.Our objective in this study was, therefore, to develop and test an affordable wireless communication system for monitoring soil moisture using Decagon EC-5 sensors.

The Decagon EC-5 Sensor
The new system was developed to measure soil volumetric water content (VWC) from four depths using Decagon EC-5 sensors (Decagon Devices, Pulman, WA) (Figure 1(a)).The EC-5 sensors were selected for this study because of their affordability and because they had been tested in previous lab and field studies and have been shown to have a fast response that linearly relates to VWC [11].The EC-5 sensors measure VWC by measuring the dielectric constant of the media using capacitance/frequency domain technology [12].They need 2.5 -3.6 VDC (10 mA) as input and their output voltage is proportional to the VWC and to the input voltage [12].The sensors were designed to work in the temperature range of −40˚C to +50˚C, requiring a measurement time of 10 ms [12].Several commercial data loggers are capable of sampling and recording data from the Decagon EC-5 sensors.A portable manual readout (ProCheck) is also available from the manufacturer to manually read the EC-5 sensors (Figure 1

Data Sampling and Communication System
The data sampling and communication system includes a Coordinator and several End Nodes following a Star Topology (Figure 2), similar to that described by [4], except that the End Node does not require a voltage divider to read the EC-5 sensors.Each End Node is identified by a unique address and is hardwired to the EC-5 moisture sensors.The End Nodes periodically sample the four EC-5 sensors and the data from the sensors is transmitted wirelessly to the Coordinator via radio communication [4].The Coordinator then sends the received data to a website to be permanently stored in a Cloud server and visually displayed [4].
Each End Node was built using a Feather 32u4 RFM95 LoRa Radio (RFM9x) (Adafruit Industries, New York, NY), which integrates an ATmega 32u4 microcontroller (Arduino-compatible), which uses 3.3 V logic at 8 MHz, and a Long Range (LoRa) packet radio transceiver [4].The transceiver transmits or receives radio signals at 868 or 915 MHz frequencies, which can be specified in software.
The 915 MHz frequency was used in this study.The line-of-sight distance range of the radio is over 2 km, using a wire quarter-wave antenna [4].Wires from the moisture sensors and from the battery were connected to the microcontroller of the End Node via pitch terminal blocks (Feather 0.1", Adafruit Industries, New York, NY).Since the Decagon EC-5 sensor produces a voltage output, it can be directly read by the microcontroller without any additional electronic interface.
A sample End Node for the Decagon EC-5 sensors is shown in Figure 3   processor, which uses 3.3 V logic at 48 MHz.This device has an Atmel WiFi module, which supports 802.11 bgn networks using WEP, WPA and WPA2 encryption [4].The microcontrollers of the two Feather devices communicate with each other using I 2 C [4], in which the device with the radio transceiver is the Server, which gets data from the End Nodes (Clients) and then transfers the data received to the device with the WiFi chip, which is the Master.The Master then uses the Internet connection to post the data to a Cloud server.

Reading the EC-5 Sensors with the Microcontroller
The Decagon EC-5 sensors were read by the End Node microcontroller by first powering the sensor with 3.2 V excitation, using a separate digital pin for each sensor, and waiting for 15 ms before reading the sensor output in the corresponding analog pin.The anolog output of the sensor (voltage) was converted to a digital output (ADC output) ranging from 0 to 1023 (for the 10-bit ADC) by the internal analog-to-digital converter.After taking the reading, the digital pin powering the sensor was set low.Ten readings were taken each time to calculate an average ADC output, which was converted to VWC using the calibration equation developed in this study (see below).

EC-5 Sensor Calibration
A laboratory calibration experiment was conducted to be able to convert the The sensors were read using both the microcontroller and ProCheck, with the sensors exposed to six different media.These media included air, water, and four soil samples with different water contents.The soil samples included an air-dried soil, a saturated soil, and two moist soils with different water contents.
Each of the four soil samples was first placed in a large container, water was added as needed, the sample was vigorously mixed to obtain a uniform water content, and placed in a 400 mL beaker (Figure 4).In this process, knowing the amount of water added to the soil was not critical, since the target was just to create a range of water contents among the four soil samples, and it was already known from previous work that the sensor's output was linearly related to changes in VWC [11].The four sensors were first connected to the microcontroller and readings were taken by alternatively immersing each sensor into the appropriate media.The sensors were then disconnected from the microcontroller and readings were taken using the ProCheck manual readout.This calibration process was possible since the Decagon EC-5 sensors respond almost instantaneously to changes in soil water status in contact with the sensor, and there is no need to allow for the readings to stabilize for a long time.

Data Storage and Visualization
There are many Internet-Of-Things (IoT) platforms available for data storage and visualization in The Cloud [4].The ThingSpeak (http://www.thingspeak.com/)platform was used in this study, which is free of charge under certain conditions, and can receive data from a variety of Internet-connected devices (such as Arduino, Raspberry Pi, Beagle Bone Black, Particle Electron, Particle Photon, etc.).The ThingSpeak platform was setup to receive the soil water content data collected, as described by [4], and allows the user to remotely visualize the data in real time via a web page interface.

Testing the System in the Field
On February 13, 2017, the system, which included one EC-5 End Node, was installed in a rainfed wheat field at the Clemson University, Edisto Research and Education Center, in South Carolina (33.3642˚N, 81.3294˚W) (Figure 5).Four EC-5 sensors were installed at depths of 15, 30, 45, and 60 cm.End Node was inside a waterproof enclosure and power was taken from a car battery ( 12VDC).A 10-Watt solar panel was used to recharge the battery using a model CMP12 Solar Charge Controller (Y-Solar, Shenzhen, China) to make sure that the battery was not over-charged (Figure 5(a)).A linear voltage regulator was used to bring the voltage down from the 12 VDC provided by the battery to the 5 VDC required by the microcontroller.
The Coordinator was housed in a waterproof enclosure and was attached to the outside wall of a field shed located 200 m from the End Node (Figure 5(b)) [4].It was powered from a USB port connected to a 120 VAC power outlet and connected to the Internet via WiFi from a Verizon Wireless Jetpack 6620L (4G LTE) mobile hotspot that was installed in the shed [4].

Cost of the System
The list and purchase price ($US) of components needed to build the Coordinator and End Node (excluding shipping, taxes, and labor) are shown in Table 1.

Results of Calibration of the Decagon EC-5 Sensors
The VWC measured with ProCheck with each Decagon EC-5 sensor (EC-5/1 to EC-5/4) in air, water, saturated soil, dry soil, and unsaturated soil with different water contents are shown in Figure 6.All four EC-5 sensors had similar response when exposed to each the different media.For example, readings taken with the sensors exposed to air or with the sensors installed in very dry soil resulted in negative VWC readings for all the four Decagon EC-5 sensors.The (b)).

J
. O. Payero et al.DOI: 10.4236/ojss.2017.710021293 Open Journal of Soil Science output of the Decagon EC-5 sensors to VWC (m 3 •m −3 ).Calibrations equations were derived by correlating the outputs of the sensors measured using the microcontroller against the readings measured with the ProCheck readout (Figure 1(b)).Measurements were taken with four Decagon EC-5 sensors covering a wide range of VWC, from air-dried to saturated soil.

Figure 4 .
Figure 4. Soil and water containers used to calibrate the Decagon EC-5 sensors.

Figure 5 .
Figure 5. (a) End Node installed in a wheat field, and (b) Coordinator.

Table 1 .
List and price ($US) of components needed to build the coordinator and end node.