DEVELOPMENT OF A LOW-COST IOT PLATFORM FOR DATA COLLECTION

Precision agriculture in the Internet of Things (IoT) integrates different technologies able to raise crop productivity, optimize resource efficiency, and accelerate decision making. However, the adoption of this technology is usually costly, affecting the acquisition by the farmers. Thus, the objective of this work was to develop and evaluate low-cost hardware to obtain data in a hydroponic system via IoT. The experiment was conducted at the Pici Campus of the Federal University of Ceará and split into three distinct stages. Firstly, the DS18B20 temperature sensors were calibrated in water, using the KR380 infrared thermometer as a comparison method. For the second step, when the hydroponic system was installed, the water temperature was monitored in the channel and not in the solution reservoir. In this same phase, the quality of data sending and receiving was investigated. In the third step, the sensory data were analyzed with those obtained by the local Meteorological Station. The calibration results revealed that the DS18B20 sensor has reasonable accuracy and excellent agreement and reliability between data. As for receiving and storing, only 6% of the total data was lost.


INTRODUCTION
Amid the technological solutions for the raise of agricultural productivity, the concept of the Internet of Things (IoT) has stood out (FAROOQ et al., 2019). Its goal is to interconnect electronic devices to databases or the internet, using sensor networks to obtain and process data (AFONSO et al., 2015). However, one of the main obstacles in the adoption of IoT technologies on the farms is the high acquisition cost and implementation complexity (MUXITO et al., 2018).
Several irrigation platforms that adopt the IoT concept are being developed to optimize water consumption in the field (FAROOQ et al., 2019), through real-time data monitoring (BASSOI et al., 2019) that enables the best decision making, process management (FAROOQ et al., 2019) and resource rationalization. In hydroponics, monitoring of temperature, flow, water level, pH, and air humidity can be regulated using IoT, through sensors and controllers such as ESP8266-01, Arduino, and Raspberry Pi (MEHRA et al., 2018).
Nevertheless, this technology is conditioned to variables, especially the reliability of communication, which according to Gao and Bai (2014) is consistent with the user's safety regarding the use of their information and the credibility of the good functioning of the product. An example of home automation is an accessible Wi-Fi switch (COSTA, 2018), which transmits data to a cloud platform via Wi-Fi, allowing users to remotely control several connected devices through applications (MOHAMMED et al. 2020).
Selecting sensors according to Bega (2011) is a critical point in the specification of the system, and characteristics such as response time, precision, measuring range, material protection, and the repeatability factor must be considered. Concerning the usability of low-cost sensors generating a large volume of information, much of this data can be anomalous (USBERT et al., 2021), resulting in a questionable quality of the collected data (BISDIKIAN et al., 2013).
Thus, evaluating the quality of the sensed data becomes paramount, given the possibility of the taking of autonomous decisions by machines (USBERT et al., 2021). According to Steidle Neto and Zolnier (2006), inadequately calibrated data acquisition systems may constitute a relevant source of error, recording and storing data inconsistent with reality. Applying temperature sensor calibrations, Kojima et al. (2019) argue that this is an indispensable process as the temperature is considered the most controlled and measured physical quantity in several physical, chemical, and thermal phenomena. Based on the above, the objective was to develop and evaluate low-cost hardware to obtain data in a hydroponic system via IoT.

MATERIAL AND METHODS
The tests were carried out at the Laboratory of Hydraulics and Irrigation of the Department of Agricultural Engineering (DENA), located on the Pici Campus of the Federal University of Ceará (UFC), Fortaleza, state of Ceará within the geographic coordinates 3°45' South latitude and 38°33' west longitude, at an altitude of 19.5m. According to Köeppen's classification, the local climate is Aw', with an average temperature of 33.4 °C and relative humidity (RH) of 47.3%.

DS18B20 sensors calibration
The circuit prototype for the first experiment was carried out with the aid of a contact matrix, three DS18B20 immersible temperature sensors, two ESP8266-01 Wi-Fi modules, and a 12V 5A power supply. Jumpers, LM78XX voltage regulator, and 10K resistors were also used ( Figure 1).

Figure 1.
Calibration test for data acquisition through the DS18B20 temperature sensor Three DS18B20 temperature sensors were used to obtain readings every minute and data were simultaneously obtained using an Akrom infrared thermometer KR380 (Table 1). At the manipulation of the infrared thermometer to obtain the readings, it was placed at the center of the beaker at 5 cm from the edge of the glassware, using an emissivity of 0.93 according to technical specifications. The water level was kept constant in the calibration process.
For the performance of the tests, the temperature sensors were immersed in a beaker containing water, with a temperature ranging from 75 to 9ºC in the cooling process and from 9º to 75ºC in the heating process. For the latter, the gradual increase in heat in the medium was carried out with the aid of an immersible grebe. In the inverse process, the continuous addition of chilled water was carried out, at a temperature of approximately ± 8 °C. Five repetitions were generated for each process performed, totaling 926 data.
To manage the survey of water temperature data, the Arduino Nano programmed in modified C++ language was used, in order to perform the readings at intervals of one minute according to the plate programming. These data were sent to a computer through a micro USB converter cable and displayed through a serial monitor. According to Sabo et al. (2020), the Arduino Nano has digital inputs and outputs, serial communication, analog inputs and outputs with pulse width modulation, characteristics that enable to integrate the Arduino with a large part of the sensors available on the market.
The data obtained by the DS18B20 temperature sensor, simultaneous with the acquisition of data determined by the infrared thermometer enabled to correlate the two analyzed processes. The evaluations and classifications of the statistical indices were based on the root mean square error "RMSE" (Equation 1), the confidence index "c" (Equation 2), the agreement index "d" (Equation 03), and the coefficient of determination "R 2 ".
Where, RMSE = root mean square error; P i = values estimated based on sensor readings; O i = values calculated based on an infra-red thermometer; n = number of observations. c = r x d Where, "c" = confidence or determination index; "r" = coefficient of determination; "d" = index of agreement represented by the following Equation 03. Statistical analyses were performed using the Microsoft Excel ® program. In the classifications of the root mean square error (RMSE) ( Table 2), confidence index (c) ( Table 3), and agreement index (d), it was used the classification proposed by Fares et al. (2011), Camargo and Sentelhas (1997) and Willmott (1981), respectively.

Development of the plate and data test via IoT
At this step, a low-cost sensing infrastructure was developed for monitoring hydroponic systems. A FTDI FT232RL USB/serial converter module (A), a male/female pin bar (B), an ESP8266-01 onboard module (C), 3-connector terminal (D) and a 3 x 7-cm Pcb perforated plate(E) ( Figure 2) were used. To connect the pins, solder and enameled copper wires were used. The manufacturing of the hardware cost US$ 9.03 (Table 4) in the prototype used to measure the temperature data of the solution in the channel and in the tank, valued in November 2020. According to Atzori et al. (2010), several studies promote the development of real-time and low-cost IoT monitoring systems.
The prototype was installed in an NFT (Nutrient Film Technique) hydroponic system to obtain the temperature according to the scheme shown in Figure 3.
The programming onboard the ESP8266-01 module requested the temperature data from the sensors and later sent them via WIFI to the DT4.0 website (Data for Agriculture 4.0) accessed through the electronic address http://dt04.com.br/, which organizes the record of the data received per date and time (Figure 4).

Comparison using climate data
In the field tests, a white polyvinyl chloride (PVC) channel was used, measuring 10 cm in diameter and 70 cm in length, containing 10-cm diameter holes spaced 10 cm apart. For the water circulation in the system, a 20-L reservoir was used   Camargo and Sentelhas (1997) to hold the water and two hoses at both ends of the channel ( Figure 5).
In the acquisition of the water temperature readings, two DS18B20 digital sensors were installed. Sensor "A" performed the acquisition of the values of the water temperature in the channel, and sensor "B", the temperature of the water in the reservoir. The installation of the test was carried out in the field at the Hydraulics Laboratory at UFC, for five days, between 9:00 a.m. and 5:00 p.m.   During the period of analysis of the tests, the data on relative air humidity (RH) using a psychrometer, wind speed by an anemometer, and air temperature by a thermometer were collected at the Meteorological Station of Campus do Pici of the Federal University of Ceará at three different times from October to November 2020 (Table  5). Statistical analyses were performed using the Microsoft Excel® program.

DS18B20 sensor calibration
After analyzing the calibration tests, it was found in the generated graphs (Figure 6), that the temperature obtained by the infrared thermometer and by the DS18B20 sensor varied linearly between the initial and final temperature, indicating a coefficient of determination (R 2 ) of 0.9957, in the water heating state ( Figure 6A) and R 2 of 0.9914 in the water cooling state ( Figure 6B), showing values close to 1, which shows a good correlation between the results obtained by the thermometer and those measured by the sensors, in both methodologies. Similar results were reported by Kojima et al. (2019), when working with a system for automating the calibration of temperature sensors, including the DS18B20, heated in a bath using a  Peltier tablet. The authors elucidate that once the proposed system manages to generate a temperature "ramp" that enables the comparison between the measurements of the sensor to be calibrated with the measurements of a standard in a particular hour and temperature interval, this one is shown to be reliable. However, Usbert et al. (2021) reported the existence of multidimensional aspects to be further explored when it comes to the "reliability" assessment dimension, with the quality of information (QoI) being fundamental in the trust between IoT services and users. Martinazzo and Orlando (2016) in a study carried out to compare three temperature sensors (thermistor, LM35, and DS18B20), concluded that the digital sensor DS18B20 was more stable, being more appropriate in applications that demand greater data accuracy.
It was observed in this work that in the calibration of sensors in both methodologies (Table  6), it is noted that the values of the root mean square error (RMSE) point to reasonable accuracy according to the classification of Fares et al. (2011), showing reasonable accuracy of the sensor in data acquisition. After analyzing the stored temperature data, a slight disparity can be observed between the first readings obtained in the digital thermometer and those obtained by the DS18B20 sensors. It is believed that this response is due to the delay in the initial stabilization and monitoring of the water temperature variation by the sensor. Rodrigues et al. (2020) in working with the DS18B20 sensor, found that after tests carried out later that the stabilization time of that sensor varies from 10 to 15 minutes. Likewise, Rocha et al. (2019) observed that abrupt changes in readings are not intensely assisted by low-cost sensors, neither is recommended for readings that require high accuracy and sensitivity to changes.
The indices of confidence (c) for both processes were considered excellent, showing performance above 0.85, according to the classification of Camargo and Sentelhas (1997), which reveals the excellent reliability of the sensor. Likewise, the agreement indices (d) exhibited values close to 1.0, thus evidencing perfect agreement between the temperature values by the infrared thermometer and by the DS18B20 sensor. According to Walker et al. (2004), values close to zero mean that there is no agreement between the data obtained, and if close to 1, there is a perfect agreement between them.

Development of plate and data test via IoT
A total of 2,150 records were obtained, with nodes configured to send data every 3 minutes, for 37.5 hours. However, due to the instability in communication, a total of 100 losses were found. It can be seen in Table 7 the survey of data sent by ESP8266-01, received by the DT4.0 local server and the respective percentage of receipt, in order to analyze the accuracy of sending and receiving data by the monitoring system.
This metric corresponds to the verification of the number of data that, when sent, are received by the destination local server. To ensure success in sending and receiving data, Oliveira (2009) elucidates the need to apply control mechanisms in the data collision and constant monitoring, as wireless networks exhibit higher bit error rates than wired networks. Instability in connection and signal reduction can affect data quality performance.
Thus, the prototype developed by using a wireless sensor network, proved to be outstanding in terms of monitoring the temperature of the water in the channel, exhibiting losses of less than 6% of the total acquired by the DS18B20 sensors. The analysis of this sending and receiving data associated with the sensor calibration response significantly corroborates, attesting to the possibility of using the developed prototype as a reliable and low-cost data monitoring source. Correia et al. (2016) developed a low acquisition cost prototype for monitoring an irrigation system with remote activation via the WEB application and, after analysis, they reported that the signal was influenced by the distance due to physical barriers between the devices. However, the authors clarify that the low cost of the developed prototype enabled the promotion of the study and emphasize the adoption of these systems in further works. Figure 7 expresses the comparison of data acquisition by the DS18B20 sensor in the water temperature variation in the hydroponic channel (•), the temperature inside the tank (▲) and the air temperature data (∎ ) in the five analyzed days ( Figure 7A: day 1, 7B: day 2, 7C: day 3, 7D: day 4, 7E: day 5) every 30 minutes between 9:00 and 17:00. The acquisition of air temperature data was provided by the meteorological station at three specific times, 9:00, 15:00, and 21:00.

Comparison with the climate data
The behavior of the curves showed a variation in the temperature of the solution in the channel of approximately 2°C during the hottest hours of the day, with no significant contrast between the data for the solution in the channel and the tank. In general, the temperature of the hydroponic system exhibited a behavior superior to the air temperature, at approximately 5°C.
According to Bremenkamp et al. (2012) in a study on the effect of solution temperature on lettuce growth in a hydroponic system, observed that the nutrient solution temperature within the range of 24 to 27°C did not affect the morphological variables of the lettuce crop. Cometti et al. (2013), also working with lettuce in an NFT (Nutrient Film Technique) system, reported values close to those of Bremenkamp et al. (2012), observing an increase in production at the solution temperature at 26ºC.
However, the aforementioned experiment exhibited temperatures higher than those recommended for the cultivation of vegetables. According to Bezerra Neto (2017), as the high temperatures in the northeast limits production, it is essential to use shading screens and protection against bad weather.
After comparing the means obtained by the DS18B20 sensor in reading the water temperature inside the channel and the reservoir, it could have been seen in Figure 8 that there was no significant variation between the readings. However, the data showed an increase of about 5°C in the hottest hours of the day, around 12:45 p.m. to 2:45 p.m., when compared to air temperature readings collected from the weather station.
The temperature of the water in the channel and the tank remained above the air temperature. During the entire experimental period, temperatures higher than those recommended as ideal for the cultivation of vegetables were observed. . Mean values of water temperature in the channel, in the tank, and air temperature over the fiveday evaluation period of the DS18B20 sensor the present study, where they showed a maximum temperature from 3:00 pm to 6:00 pm. Cometti et al. (2013) also analyzed the interaction curves of air temperature with the temperature of the hydroponic solution and observed that both presented a peak from 12:00 p.m. to 3:00 p.m. This behavior, also observed in the present study, is caused by the fact that at higher air temperatures, the solution tends to return to the reservoir at a higher temperature, as it comes into contact with the heated PVC (polyvinyl chloride) material, causing greater heat exchange.

CONCLUSIONS
• The DS18B20 sensor calibration showed excellent reliability and perfect agreement between the compared data; however, reasonable precision, owned by a delay in the initial stabilization.
• The percentage of receiving and storing data via wireless network showed losses of only 6% of the total data acquired by DS18B20 sensors.

DECLARATION OF INTERESTS
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.