A Systematic Review of IoT Solutions for Smart Farming

The world population growth is increasing the demand for food production. Furthermore, the reduction of the workforce in rural areas and the increase in production costs are challenges for food production nowadays. Smart farming is a farm management concept that may use Internet of Things (IoT) to overcome the current challenges of food production. This work uses the preferred reporting items for systematic reviews (PRISMA) methodology to systematically review the existing literature on smart farming with IoT. The review aims to identify the main devices, platforms, network protocols, processing data technologies and the applicability of smart farming with IoT to agriculture. The review shows an evolution in the way data is processed in recent years. Traditional approaches mostly used data in a reactive manner. In more recent approaches, however, new technological developments allowed the use of data to prevent crop problems and to improve the accuracy of crop diagnosis.


Introduction
The challenge of food production in the 21st century is an increasingly relevant theme as population growth increases year after year. It is estimated that by 2050 the world will have between 9.4 and 10.1 billion people who depend on the world's biodiversity to live, increasing the demand for dedicated food production areas-specifically for planting and livestock [1]. Environmental changes caused by human beings could potentially cause conditions in which the development of new crops is not possible. Likewise, the growing urbanization decreases labor in areas typically involved in food production, increases costs and reduces the productive capacity of the sector [2]. In view of this, smart farming is a new farm management concept that employs techniques and technologies at various levels and scales of agricultural production, enabling to overcome the challenges in food production demands and reduction in the workforce [3,4]. For example smart farming may use different types of sensors to collect data (e.g., temperature, humidity, light, pressure, presence, etc.), communication networks to send and receive data which is then managed and analyzed by management information systems and data analysis solutions [5]. This system of interconnected devices is commonly referred to as internet of things (IoT) [6]. The use of the data provided by smart farming helps boosting productivity and minimizing waste by allowing necessary actions to be carried out at the right time, quantity and place [7].
Moreover, recent technological developments in areas relevant to IoT facilitates an easier adoption and use of smart farming with IoT [8]. Such technological developments include, for example, As shown in Table 1 there is a trade-off between coverage, data rate and energy consumption. Considering the technologies for star networks presented in Table 1, it is possible to notice that energy IoT solution architecture that includes 4 layers: perception, transport, processing and application, based on [22,23].
The transport layer refers to the network and transport capabilities such as network and application protocols [22]. IoT solutions use network protocols to enable communication between the perception layer and the processing layer. These protocols are used to create the so-called wireless sensor networks (WSN), that allows wireless communication between sensor nodes and applications. Each protocol has important characteristics, such as the data exchange rate, range and power consumption. Based on these characteristics such protocols can be classified in short-range, cellular networks and long-range [34]. Protocols for short-range networks (e.g., Bluetooth, ZigBee and Wi-Fi) enable communication in short distances. According to [34], usually such protocols have a high data transmission rate and low power consumption. Therefore, they are used for the communication between devices that are near each other. Protocols for cellular networks (e.g., GPRS, 3G) enable communication in long distances and with a high data transmission rate. However, they have a high power consumption [35] and costs for licensing [34]. Protocols for long-range networks (e.g., LoRaWAN and Sigfox) enable communication in very long distances [34]. These protocols are used to establish the low power wide area networks (LPWAN) due to the fact that they have a low power consumption [36]. However, the data transmission rate of these protocols is low. Therefore, these protocols are appropriate for use when the solution needs to transmit a few amounts of data in very long distances. Table 1 presents the characteristics of some network technologies used for IoT.
As shown in Table 1 there is a trade-off between coverage, data rate and energy consumption. Considering the technologies for star networks presented in Table 1, it is possible to notice that energy consumption is higher in technologies with a high data rate and short coverage. On the other hand, LoRa has a small data rate but a large coverage and low power consumption. These questions are especially relevant when considering agriculture because agricultural scenarios often have limited or no energy supply and obstacles for wireless communication. Different topologies can be used for implementing networks, such as tree, star and mesh. Star networks have a central node and several peripheral nodes. The communication in such topology occurs as follows: peripheral nodes send data directly to the central node. The central node can implement capabilities for routing messages and communicating through multiple network protocols [23]. Tree networks are composed of router nodes and leaf nodes. Such networks can be understood as a cluster of star networks. Within each cluster, leaf nodes send messages their father node. In mesh networks, in theory, each node can be a router with rerouting capability. Thus, messages in mesh networks are routed hop by hop until reaching the final destination [37].
Data is sent to the destination through application protocols such as the message queueing telemetry transport (MQTT) [38] or the constrained application protocol (CoAP) [39]. MQTT is an open-source messaging protocol that enables communication between constrained devices and in unreliable networks [40]. MQTT runs over TPC/IP or similar protocols (e.g., Bluetooth) [41], which makes the use of MQTT appropriate for different IoT solutions. The MQTT protocol, which is based on the publish/subscribe architecture, allows communication between devices to take place in the following way. First, devices publish messages that are structured in topics on a message broker. Then, other devices read these messages by subscribing to relevant topics on the message broker. These topics allow the organization of messages based on categories, subjects, etc. [42]. The use of MQTT for communication between device allows low coupling between the device that publishes the message and the devices that listen to the messages, the so-called "one-to-many" communication [38]. Like MQTT, CoAP is a communication protocol optimized for constrained devices and unreliable networks. However, CoAP messages are interchanged using User Datagram Protocol (UDP) and the CoAP protocol is based on the client/server architecture. This architecture requires that a connection is established between devices before any messages are transmitted [38]. For this reason, communication using CoAP works in the following way. First, the device that sends messages needs to know the address of each device that is expected to receive messages. Then, messages are sent over UDP to the specified address. Due to the use of UDP, CoAP messages are classified accordingly to the required status of confirmation of receival, for example, confirmable or non-confirmable [39]. The CoAP protocol does not implement a structure of topics for messages. However, a similar approach can be implemented using application programming interface (API). Nonetheless, the use of CoAP creates a high coupling between the device that sends messages and the device that is expected to receive messages, as the communication is "one-to-one" [39].
The processing layer comprises data storage, visualization and processing resources. In this context, big data allows distributed storage and parallel data processing, enabling the extraction of information in the shortest possible time [43]. Such information are used as models by artificial intelligence (AI) systems-which, according to [44], can be understood as the ability of a system to operate as if it had the thinking capacity of a human being-and machine learning-that, according to [45] is a data processing technique to detect patterns and correlation among complex and unrelated data-for the development of decision support systems and automation of irrigation control systems [46], monitoring [47] and diseases detection in crops [48], for example. Finally, the application layer comprises IoT applications that, supported by the other mentioned layers, provide management information to farmers, being able to manage the entire production process in the plantations.

Methods
Several related works are being developed in recent years. This rich literature has already been analyzed by the academia from multiple perspectives with objective of determining the state of the smart farming development. Thus [49] presented a systematic review of precision livestock farming in the poultry sector and [50] made a review of state of the art of technologies used in precision agriculture, focusing in the innovations, measured parameters, technologies and application areas. On the other hand [4] has focused on the use of big data as a tool to support agriculture, pointing out the main opportunities and challenges of using this technology. Finally, [51] presented a quantitative literature review on smart farming related papers, helping to outline an overview of academic production related to the subject. In this way, the present work aims to complement such analyses by making a systematic review of IoT solutions applied to smart farming.
To reach the proposed objectives, this study has used the Preferred Reporting Items for Systematic Reviews (PRISMA) methodology, which is a framework developed to support reports and systematic reviews of literature [52].
As a research strategy, in October 2019 a search was made in the Scopus database through the search tool available on the website. In addition, in June 2020 a new search was made in the same database to include papers published in 2020. The choice of this database took into consideration its scope and relevance in the academia, since this database indexes several journals and catalogues, such as IEEE, ACM and Elsevier, besides being widely used in similar bibliographic reviews, as in [4] and [51]. In addition, in February 2020 a new search was performed in the same database. The strategy adopted for the work research in this database looked for terms used to refer to the application of technology in the area of agriculture, such as "Precision Agriculture", "Precision Farming", "Smart Farming" and "Smart Agriculture" in association with "IoT" and synonyms terms. The publication date of the articles was not a criterion for ignoring them. The scope of the research was limited to documents such as journal and conference articles, published in English, Portuguese or Spanish, and whose access was fully available. Thus, the resulting search instruction for the database was as follows: ("Smart Farming" OR "Smart Agriculture" OR "Precision Farming" OR "Precision Agriculture") AND ("IoT" OR "Internet of Things" OR "internet-of-things") AND (LIMIT-TO(ACCESSTYPE(OA))) It should be noted that the quotation marks have the function of ensuring that terms composed of multiple words were searched together, thus preventing words from being considered individually.
After extracting the articles that resulted from the search, they were manually reviewed through the analysis of the title, keywords, abstract and text. Initially, based on this review, the works identified in the researched database were consolidated, thus eliminating duplicate articles.
Subsequently, the articles were validated as to their framing in the objectives proposed for this study and considered valid when: (i) they were not a review or bibliographical research (ii) they were related to theme (iii) they presented a technology or solution based on IoT to solve problems related to agriculture (iv) they were published in English, Portuguese or Spanish. Furthermore, works were also excluded when they were related to livestock activities instead of agriculture.
The process of searching and selecting papers for this study followed the workflow summarized in Figure 2, where it can be observed that the initial search resulted in a total of 463 articles, which were analyzed, filtered and classified in a narrowing process that culminated in the selection of 159 articles.
In the identification phase 463 articles were selected with the search tool. During the screening phase, a manual review of the articles was carried out to identify in the titles, abstract and key words the papers adherent to the objectives proposed for this study, following the criteria mentioned in this section. Among these, 257 were considered invalid and discarded. About 62% of the discarded items did not consider smart farming to be the focus of the work, although some presented improvements for IoT that could benefit smart farming indirectly. Additionally, almost 31% of the discarded papers were studies or literature reviews related to smart farming and the use of various technologies. A smaller number of papers related to smart farming but not addressing IoT (about 5%) and papers where the abstract or text were not available (about 2%) were also discarded. During the eligibility phase, the content of the 206 resulting articles were reviewed and the papers were classified using the same criteria used in the previous step. In this phase 47 articles were discarded. Among the discarded articles 29% were not related to IoT and 30% were not related to smart farming. The other 41% of the discarded papers were paper reviews or papers without content available. This analysis resulted in 159 articles considered eligible which were included as a sample for this study.

Discussion
Based on the results obtained in the analysis of the articles considered for this study, it was possible to observe a growth trend in the number of publications related to IoT and smart farming since 2011, with special emphasis from 2016 onwards, as shown in Figure 3.
It is possible to observe an expressive increase of 278% in the number of published papers in 2017/2018. It's also possible to observe a very similar number of published papers in 2019/2020, until the first semester of 2020. The amount of published papers in recent years evidences the increasing in discussion and the relevancy of the topic IoT applied to smart farming. During the eligibility phase, the content of the 206 resulting articles were reviewed and the papers were classified using the same criteria used in the previous step. In this phase 47 articles were discarded. Among the discarded articles 29% were not related to IoT and 30% were not related to smart farming. The other 41% of the discarded papers were paper reviews or papers without content available. This analysis resulted in 159 articles considered eligible which were included as a sample for this study.

Discussion
Based on the results obtained in the analysis of the articles considered for this study, it was possible to observe a growth trend in the number of publications related to IoT and smart farming since 2011, with special emphasis from 2016 onwards, as shown in Figure 3.
It is possible to observe an expressive increase of 278% in the number of published papers in 2017/2018. It's also possible to observe a very similar number of published papers in 2019/2020, until the first semester of 2020. The amount of published papers in recent years evidences the increasing in discussion and the relevancy of the topic IoT applied to smart farming.  Within the reviewed papers it was identified the main scenarios and environments of agriculture. As shown in Figure 4, such scenarios can be divided into indoor and outdoor. Environments for indoor scenario are protected from climatic impacts, such as solar radiation, rain and wind. Examples of environments for indoor scenarios include greenhouse, hydroponics, crop beds, pots, etc. In contrast, environments for outdoor scenario are more susceptible to climatic impacts. Examples of environments for outdoor scenario are arable lands, orchards and generic outdoor plantation. Typical scenarios in agriculture can be divided in indoor and outdoor. Indoor agriculture includes environments such as greenhouse, hydroponics and crop beds. Outdoor agriculture includes environments such as orchards and arable lands. IoT solutions that may be applied to multiple environments are referred to as "Generic". Within the reviewed papers it was identified the main scenarios and environments of agriculture. As shown in Figure 4, such scenarios can be divided into indoor and outdoor. Environments for indoor scenario are protected from climatic impacts, such as solar radiation, rain and wind. Examples of environments for indoor scenarios include greenhouse, hydroponics, crop beds, pots, etc. In contrast, environments for outdoor scenario are more susceptible to climatic impacts. Examples of environments for outdoor scenario are arable lands, orchards and generic outdoor plantation.  Within the reviewed papers it was identified the main scenarios and environments of agriculture. As shown in Figure 4, such scenarios can be divided into indoor and outdoor. Environments for indoor scenario are protected from climatic impacts, such as solar radiation, rain and wind. Examples of environments for indoor scenarios include greenhouse, hydroponics, crop beds, pots, etc. In contrast, environments for outdoor scenario are more susceptible to climatic impacts. Examples of environments for outdoor scenario are arable lands, orchards and generic outdoor plantation.  Typical scenarios in agriculture can be divided in indoor and outdoor. Indoor agriculture includes environments such as greenhouse, hydroponics and crop beds. Outdoor agriculture includes environments such as orchards and arable lands. IoT solutions that may be applied to multiple environments are referred to as "Generic".

Application
Within the reviewed papers it was also identified that the most common applications of IoT solutions for smart farming are:

•
Chemical control (e.g., pesticides and fertilizers). Vehicles and machinery control. Table 2 presents the reviewed papers, grouped by agricultural environment and application of the IoT solution. It is worth mentioning that several IoT solutions presented on the reviewed papers could be applied to multiple environments ( Figure 4). Thus, such IoT solutions are classified as "Generic". Additionally, the "Others" column in Table 2 includes papers whose IoT solutions were developed for agricultural environments that were less mentioned, such as pots, crop beds, etc. It is possible noting a predominance in projects where the application is for crop monitoring, irrigation management, and disease prevention. As shown in Table 2, the most common application of IoT solutions for smart farming is crop monitoring. Moreover, as shown in Table 2, these solutions have been developed for multiple agricultural environments, such as arable lands, orchards, greenhouses, etc. The fact that this type of application is so common in agriculture can be justified by the relevance that crop monitoring has for farmers. IoT solutions developed for monitoring crops focused on collecting environmental data of plantations (such as temperature, humidity, luminosity, etc.). Farmers can use these data to obtain a better insight of the plantations. For example, such data was used to determine the vigor of rice [47,58], alfalfa [30] and maize [57] crops and to control the environmental conditions of greenhouses [99,100,102,104]. Similarly, IoT solutions for irrigation control has also been developed for multiple agricultural environments, as demonstrated in Table 2. Such IoT solutions aimed to optimize the use of water resources in agriculture in different ways, such as by simply using sensors for measuring the soil moisture and using these data for controlling the irrigation source [34,139] or in a more sophisticated way, by combining humidity data with datasets of weather to determine the amount of water required during the irrigation [140]. IoT solutions for disease prevention aimed to identify and prevent diseases on plantations. For this purpose, these IoT solutions collected multiple environmental and plantation data, such as images of plants [129,132,134], sounds [135], temperature, humidity, etc. [131,137]. These data were processed with different approaches, such as image processing [129,134] or artificial intelligence [132,137]. For example, the IoT solution developed in [129] processes images collected from a sugarcane crop and identifies diseases on the leaves of plants. In addition, [135] developed an IoT-enabled device that captures sounds produced by larvae inside trees. IoT solutions for chemical control presented in Table 2 aimed to optimize the application of fertilizers and pesticides on plantations. For this purpose, these IoT solutions collect data (such as nitrogen, salinity or PH) from the crops. Based on the collected data, such IoT solutions can identify crop areas that may require the application of fertilizers or pesticides. For example, in [54] aerial images of crops are processed to determine the nitrogen concentration in a large plantation. These images are useful to determine the specific region that requires fertilizer. In addition, [55] developed an automated robot that optimizes the application of pesticides in greenhouse cultivations. IoT solutions for soil management aimed to identify different soil attributes used for planting. For example, such IoT solutions are used to measure the soil moisture [163], to identify the water consumption pattern [159,161] and to identify the nutrients of the soil [158]. IoT solutions for vehicles and machinery control focused on collecting data of and managing agricultural equipment and machinery such as tractors, harvesters and trucks. For this purpose, IoT solutions had to deal with the characteristics inherent to agricultural equipment, such as mobility. Data from the equipment itself, such as implement status, engine performance, or speed are collected using sensors [41] to optimize their maintenance cycle. Additionally, due to the mobility of agricultural equipment, opportunistic computing was used to collect data from remote crop areas by using sensors coupled to tractors [174].
Each agricultural environment presented in Table 2 brings its own challenges for the projects, which includes the environment impact on the communication between sensors, either by the distance between the sensor nodes [25,105,180], by the lack of communication in the croplands [98,174] or even by the impact of vegetation in the signal propagation [70,175]. Furthermore, as indicated in [28], climatic elements-such as rain, snow or solar radiation-have influence on both the planting and the sensor nodes.
To cover these scenarios commercial electronic sensors are used by 96% of the reviewed papers. This expressive usage can be justified by the fact that such sensors are affordable, certified, ready-to-market and meet the main monitoring needs in IoT solutions for smart farming. Such sensors are used for collecting real-time data about multiple agricultural parameters, such as climatic data, substrate information, luminosity, CO2 concentration and images through cameras and multispectral sensors, as shown in Table 3. Moreover, several papers (4%) focused on developing custom-made sensors for monitoring specific agricultural aspects, such as soil nutrients (e.g., nitrate [158]) and leaf evapotranspiration for measuring the hydric stress in tobacco crops [81].
Different types of sensors are used in agriculture for collecting data from different aspects of agriculture such as crop monitoring, substrate monitoring and environment monitoring.
As presented in Table 3, different types of sensors were used in IoT solutions for smart agriculture to collect data from multiple aspects of agriculture, such as the crop, substrate, environment and other. For this purpose, as shown in Table 3, for environment monitoring electronic sensors were used in IoT solutions to collect environmental data, such as temperature, humidity and luminosity [104,109,114]. In addition, for substrate monitoring electronic sensors were used to collect data from the substrate (e.g., soil and water), such as temperature, moisture and nitrogen. Likewise, pH sensors were used for measuring the acidity or the alkalinity of the water in hydroponics cultivations. For crop monitoring, cameras and multispectral sensors were used to collect images of crops. These sensors can be installed on an UAV to obtain aerial images of large plantations [47,57,58] or used in robots to retrieve a detailed image of the leaf of a plant [111].

Perception
The choice of hardware is a very important aspect of the IoT project development because it impacts the costs and the technologies that can be used. 60% of the reviewed papers mentioned the hardware used to support the IoT solution. Furthermore, SBCs were mentioned by 40% of the reviewed papers. The use of SBCs can be justified by the fact that these devices are affordable and versatile [38], enabling the development of custom-made IoT devices. For example, some SBCs such as Arduino has an integrated development environment (IDE). This IDE enables the development of custom programs to be installed as firmware on the Arduino boards [184]. Similarly, Raspberry Pi is compatible with several operating systems, such as Raspbian, Ubuntu Core or Mozilla Web Things [185]. Some of these operating systems are open-source, which allow for the customization of its source-code. Besides, these operating systems support applications developed with programming languages such as Python [26]. Furthermore, the capabilities of SBCs can be extended by associating them with other hardware components, such as sensors or transceivers. This characteristic makes SBCs able to work as gateways or sensor nodes in IoT solutions. Among the papers that mentioned SBCs, 82% mentioned the use of Arduino, Raspberry Pi and ESP boards (such as ESP8266, ESP12 and ESP32). Table 4 presents the application of embedded system platforms and UAV devices in smart farming. As shown in Table 4, IoT-enabling devices are used for multiple applications on IoT solutions for smart farming. SBCs were used both as sensor nodes and gateways. Table 4 reveals that Arduino was the most commonly used embedded system platform among the reviewed papers. The extensive use of Arduino can be justified by the fact that Arduino is open-source hardware that enables the development of different devices through the use of boards that extend their native functionality. Table 4 also shows that embedded system platforms have been more widely used in IoT solutions for crop monitoring. As sensor nodes, for example, in [124] sensors for collecting environmental data such as soil humidity, solar radiation and rain are connected to an Arduino Uno. The Arduino is, then, used to monitor the health of a vineyard. Likewise, in [117] a Raspberry Pi is used to manage the temperature and air humidity of a greenhouse. IoT devices are also used as gateways to connect short-range WSN with the internet by using long-range communication protocols. For example, in [127] a gateway is used to connect WSNs using 3 different protocols (ZigBee, Bluetooth and Wi-Fi) with a remote server by using 3G. In [84] a LoRaWAN gateway obtains data from sensor nodes using LoRa and retransmits this data to a cloud-hosted platform by using 4G. 3G and 4G are cellular network technologies that, as discussed in Section 2.3, enable communication in long distances and with a high data transmission rate. These technologies will be discussed with more details in Section 4.3.
In addition, Table 4 also reveals that UAV is widely used by IoT solutions for monitoring crops, disease prevention and chemical control. The use of UAV for crop monitoring is due to the fact that UAV has the potential to accelerate and reduce the cost of monitoring extensive crops. For this purpose, cameras and multispectral sensors are attached to UAV devices that are used to obtain aerial images from large crops. Such images are processed by the IoT solution to calculate agricultural parameters, such as the leaf area index (LAI). The LAI is a parameter used to determine the vegetation coverage within a specific area. LAI, combined with other parameters, can be used to evaluate the amount of nitrogen in rice crops [58], determine the vigor of rice and maize [47,57] crops and detect diseases in sugarcane crops [129]. Moreover, UAV devices are used in [46] to optimize the application of pesticides and fertilizers in arable lands.

Network
Data obtained with sensor nodes are usually sent to the destination (e.g., database, server, IoT platform) through a wired or wireless network. Within the reviewed papers, 60% have mentioned the network protocol used in the IoT solution. Among the mentioned network protocols, CAN and Ethernet were the most used ones for wired networks. Likewise, LoRaWAN and protocols for cellular network (e.g., GPRS, 3G, etc.) were the most used protocols for long-range wireless networks. Analogously, ZigBee, Wi-Fi and Bluetooth were the most used protocols for short and mid-range wireless networks. Table 5 shows network protocols used for the IoT solutions within the reviewed articles. Sigfox [34] As shown in Table 5, several network protocols are used in different environments of agriculture (e.g., arable land, greenhouse, orchard) to enable communication between IoT solution devices, such as sensor nodes and gateways. Such network protocols enable the creation of short or long-range networks. Table 5 reveals that for short and middle-range communication, IoT solutions of the reviewed papers used different technologies, such as Wi-Fi, ZigBee and Bluetooth. Moreover, it is possible to observe in Table 5 that Wi-Fi is the most common network technology for communication within the analyzed articles. This extensive use of Wi-Fi can be justified by the fact that Wi-Fi is a ubiquitous technology and, therefore, easy to implement. However, due to the higher energy consumption of Wi-Fi, low-energy consumption technologies, such as ZigBee or Bluetooth, are also extensively used. For example, [62] used ZigBee to send images from a plantation to a remote server and [188] developed a sensor node that uses Bluetooth to deliver monitoring information from the farm directly to an application installed on a smartphone. Table 5 also demonstrates that IoT solutions of the reviewed papers used cellular networks, Sigfox, or LoRaWAN for long-range networks. Cellular networks are prevalent in IoT solutions for Smart Farming. This can be justified by the fact that cellular networks allow the communication of IoT devices in long distances and with a high data rate. For example, [141] uses cellular network to send data collected from humidity sensors to a cloud-based platform and to control an irrigation system. Similarly, Sigfox and LoRaWAN enable communication in very long distances while requiring low energy to operate. Based on these characteristics, Sigfox and LoRaWAN were used for long-range communication, as an alternative to cellular networks or in regions where there was no cellular network coverage. Sigfox is used in [34] as the network protocol of an IoT solution used to control the irrigation of a plantation. Likewise, in [137] the LoRaWAN is used to send data from multiple sensors installed in a greenhouse to a remote platform.
Besides the distance between sensor nodes, gateways, and other network elements, the vegetation itself can be an obstacle for sensor communication, as demonstrated by [175] and [70] who analyzed the impacts on signal propagation on 433 MHz and 2.4 GHz frequencies in rice plantations and an orchard. An additional challenge for greenhouses arises from the high density of sensors, which can lead to interference in the wireless signal due to proximity [105,112,180]. To mitigate this problem wired networks, such as CAN [100] or Ethernet [122], can be used. As shown in Table 5, these technologies have been more used in greenhouses, because usually this type of agricultural environment is more appropriated for implementing wired networks. Moreover, [112] investigated the path loss on wireless signals and concluded that the proper positioning of directional antennas can optimize the number of sensory nodes required for monitoring a greenhouse.
Network topology is another important aspect of an IoT solution. According to [61] the topology of sensor networks can be star, tree (or cluster) or mesh. The network topology impacts the distance between the sensor nodes and the destination and, consequently, the number of sensor nodes in the WSN [190]. For example, star networks are composed of a central node (coordinator) and several peripheral nodes. In such topology, peripheral nodes send data to the central node [93]. Therefore, the maximum distance between the peripheral nodes and the central node is limited by the maximum distance allowed by the physical layer communication standard. On the other hand, as discussed in Section 2.3, in mesh networks each node has routing capability, hence extending the network coverage by allowing multi-hop communications [191]. Based on the architecture of the IoT solution and on the project description it was possible to identify the topology adopted by 61% of the reviewed papers. For example, a star topology is used in [34] for connecting sensor nodes to a central node using the LoRa protocol. This central node acts as a gateway and retransmits messages to a cloud-based application that controls an irrigation system using Sigfox. Also, in [107] the star topology is used to connect multiple sensors within a greenhouse. Such sensors use the ZigBee protocol to send messages to a central node, which acts as the network gateway. Mesh networks are considered more complex to be implemented but also more reliable due to the redundancy of communication between the sensor nodes [105]. Such topology is used in [105,107] for monitoring a greenhouse. Tree (or cluster) networks combine multiple star networks. Both [61] and [178] implement a cluster network for monitoring crops. In [61] sensor nodes collect information from a crop and send messages to a router node. This router node acts as the gateway of the cluster and retransmits the message to the main router node of the network. In [178] several router nodes are deployed in the crop area in order to optimize the energy consumption of sensor nodes. Furthermore, embedded system platforms have been used to support network topologies. The chart in Figure 5 presents the distribution of embedded system platforms by network topology or device connection type. It is worth mentioning that although point to point is not a network topology, this type of device connection was used in several IoT solutions within the review articles. As shown in Figure 5, Raspberry Pi is often used in IoT solutions implementing the star network topology. Arduino is the embedded system platform used in multiple types of network topology or device connections. Additionally, Arduino is the most frequently used embedded system platform to support star network topology and point-to-point communication. Finally, ESP-based devices include devices that use system-on-a-chip (SoC) modules such as ESP-32 and ESP8266 (Espressif Systems, Shanghai, China). ESP-based devices are often used in IoT solutions that implement star network topology or point-to-point communication.
As mentioned in Section 4.2, embedded system platforms can be used to build gateways or sensor nodes. As shown in Figure 5 the use of Raspberry Pi, Arduino and ESP stand out, probably because such embedded system platforms are cost-effective [38] and enable different network protocols (e.g., ZigBee, Wi-Fi and Bluetooth) with the use of transceivers. This characteristic allows such embedded system platforms to act as sub-nodes and central nodes in a star network [27,30,34] or as router nodes in mesh and cluster networks [106,178]. chart in Figure 5 presents the distribution of embedded system platforms by network topology or device connection type. It is worth mentioning that although point to point is not a network topology, this type of device connection was used in several IoT solutions within the review articles. As shown in Figure 5, Raspberry Pi is often used in IoT solutions implementing the star network topology. Arduino is the embedded system platform used in multiple types of network topology or device connections. Additionally, Arduino is the most frequently used embedded system platform to support star network topology and point-to-point communication. Finally, ESP-based devices include devices that use system-on-a-chip (SoC) modules such as ESP-32 and ESP8266 (Espressif Systems, Shanghai, China). ESP-based devices are often used in IoT solutions that implement star network topology or point-to-point communication. As mentioned in Section 4.2, embedded system platforms can be used to build gateways or sensor nodes. As shown in Figure 5 the use of Raspberry Pi, Arduino and ESP stand out, probably because such embedded system platforms are cost-effective [38] and enable different network protocols (e.g., ZigBee, Wi-Fi and Bluetooth) with the use of transceivers. This characteristic allows such embedded system platforms to act as sub-nodes and central nodes in a star network [27,30,34] or as router nodes in mesh and cluster networks [106,178].
IoT devices transmit information to cloud-based platforms or applications through application protocols [109]. Such protocols can follow the publisher/subscriber architecture which, as mentioned in Section 2, are appropriate for devices with limited computing resources. Among the application IoT devices transmit information to cloud-based platforms or applications through application protocols [109]. Such protocols can follow the publisher/subscriber architecture which, as mentioned in Section 2, are appropriate for devices with limited computing resources. Among the application protocols used in the reviewed papers HTTP, MQTT and CoAP stand out. Such application protocols are useful to enable compatibility between non-standardized IoT devices and IoT platforms. For example, SmarFarmNet developed in [32] adopts the "bring your own IoT device" concept by implementing loosely coupled application protocols such as MQTT and CoAP. Furthermore, although HTTP is not a specific protocol for machine-to-machine (M2M) communication, its use associated with REST APIs enables low coupling between IoT devices and applications, analogous to MQTT, for example. However, as [109] concludes, the MQTT protocol is preferable for smart farming applications due to its resiliency, interoperability across different network protocols and transmission rate.
Finally, although the power consumption is not an exclusive topic within the transport layer, according to [178] the highest power consumption for IoT devices within a WSN occur during the transmission of data. This review identified several approaches for optimizing the power consumption in IoT solutions for smart farming. Among the identified solutions are the use of low energy protocols (e.g., BLE, ZigBee, Sigfox), reduction of data transmission in sensor nodes by an optimized duty cycle [177,178,192] and the use of message routing approaches that are more energy-efficient [72,193].

Processing
Among the analyzed papers it was possible to observe that initially, the main objective of IoT solutions was to collect and store data from sensor nodes. However, in more recent years, it is possible to observe an increasing number of IoT solutions that used supplementary techniques and technologies to treat the collected data, such as cloud computing and big data. Likewise, it is possible to observe an increasing number of works that used simultaneously two or more techniques or technologies for processing data. As shown in Figure 6, the most cited technologies within the reviewed papers are cloud computing (34%), machine learning (15%), big data (13%), and artificial intelligence (9%).

Processing
Among the analyzed papers it was possible to observe that initially, the main objective of IoT solutions was to collect and store data from sensor nodes. However, in more recent years, it is possible to observe an increasing number of IoT solutions that used supplementary techniques and technologies to treat the collected data, such as cloud computing and big data. Likewise, it is possible to observe an increasing number of works that used simultaneously two or more techniques or technologies for processing data. As shown in Figure 6, the most cited technologies within the reviewed papers are cloud computing (34%), machine learning (15%), big data (13%), and artificial intelligence (9%). Figure 6. Techniques and technologies for data-processing in smart farming identified within the reviewed papers. In recent years, the use of modern processing techniques, such as artificial intelligence and big data became more common. IoT applications relies on cloud computing for storing and processing the big data of agricultural information collected by IoT devices. Table 6 presents IoT solutions that relied on cloud-based platforms for processing data and highlights the main data processing techniques (e.g., Artificial Intelligence, Big Data, etc.). The column Figure 6. Techniques and technologies for data-processing in smart farming identified within the reviewed papers. In recent years, the use of modern processing techniques, such as artificial intelligence and big data became more common. IoT applications relies on cloud computing for storing and processing the big data of agricultural information collected by IoT devices. Table 6 presents IoT solutions that relied on cloud-based platforms for processing data and highlights the main data processing techniques (e.g., Artificial Intelligence, Big Data, etc.). The column "Other/Not identified" comprehends IoT solutions that have used cloud-based platforms but have either (i) used any of the data processing technologies identified by other columns on Table 6 or (ii) not explicitly mentioned the type of data processing technology that was adopted. Table 6 reveals that the most found cloud-based platforms in the reviewed papers are ThinkgSpeak, FIWARE, Ubidots, SmartFarmNet, AWS IoT and Thinger.io. In particular ThingSpeak is the most used cloud-based platform across all the reviewed papers, due to the fact that this platform is open-source with low infrastructure requirements [34]. In addition, Table 6 shows that AWS IoT was used with a higher number of data processing techniques. Not all cloud-based platforms offer the same set of functionalities, but in general, they have capabilities for data storage [30,94,102,122,132], processing [194] and visualization [102] and action control on farms [34]. Furthermore, Table 6 also reveals that, even though there are multiple cloud-based platforms, several reviewed papers developed their own cloud-based platform for the IoT solution.
Cloud-based platforms provide scalability for IoT solutions by relying on cloud computing to process and data. For instance, some platforms shown in Table 6, such as Thinger.io [33], are built entirely on top of infrastructure services provided by cloud providers (e.g., Amazon AWS and Microsoft Azure). Also supported by such services, the platforms make available data analysis modules with graphics and panels that allow real-time monitoring of the information obtained or the creation of customized panels from the integration of multiple data [33].  [28,94,117,131] Due to the scalability provided by these platforms, the large amount of data generated by the sensors is stored in databases to form the so-called big data, an unstructured set of information that is used to generate information about crops. According to [197] big data demands the use of technologies to optimize the processing time due to the large volume of information. For example, Hadoop-a parallel database for big data applications-proved to be efficient when analyzing the rainfall index data from several meteorological stations [197].
IoT solutions use different types of techniques and technologies for processing the collected data. Table 7 presents commonly used technologies per applications as identified in the reviewed papers. Column "Other Technologies" encompasses all the technologies that are not identified by any of the other columns in Table 7. Table 7 reveals that the most commonly used technologies to support data processing are artificial intelligence, machine learning, and big data. The use of these technologies is related to their ability to process large amounts of information in a short time. In addition, Table 7 also shows that crop monitoring is the most common type of application for IoT solutions that have used data processing technologies. Moreover, crop monitoring is also the type of application that used the most different technologies for data processing. This can be understood by the fact that usually IoT solutions for monitoring crops collect a bunch of data and rely on machine learning and big data to process such data. As demonstrated in Table 7, bigdata was used for different applications in IoT solutions, such as crop monitoring, soil management and irrigation control. For example, supported by big data, in [142,161,194] the soil moisture data gathered by physical sensors were related to data made available in datasets, such as the NASA Prediction of Worldwide Energy Resources (POWER) [198]-which contains meteorological data-purchase and sale values of crops, information from the user and government agencies to optimize the amount of water in irrigation cycles, support the farmer in the acquisition of agricultural inputs-such as seeds and fertilizers-and generate information and perspectives about other activities related to agriculture. Big data was also used by [56] in the development of a decision support system to provide irrigation and monitoring advice to farmers from a knowledge base created with data obtained by physical sensors (e.g., temperature, soil moisture) and virtual sensors (e.g., soil type, season). Virtual sensor is a type of software that, given the available information, processes what a physical sensor otherwise would [199].
In addition, automatic management with IoT depends on the manipulation of multiple variables. Initially, the simple observation of soil humidity and temperature can be used to trigger irrigation or cooling systems, as proposed by [187]. Nevertheless, greenhouse management can be more complex. As shown in [104,107,120], greenhouse parameters like temperature and humidity are closely tied and changing one of them can affect several others.
Fuzzy logic, as indicated in Table 7, was used in IoT solutions applications that need to handle multiple variables, such as irrigation control and monitoring crops. For this purpose, [120] uses fuzzy logic to handle multiple variables of temperature and humidity into a greenhouse and determine when a cooling system and an irrigation system should be started. Similarly, [73] uses fuzzy logic to optimize the number of sensors for monitoring soil temperature and moisture. Machine learning was also used in data processing by [46] to predict environmental conditions based on the forecast values of weather, humidity, temperature and water level and thus to control an irrigation system, by [47] to combine multiple parameters obtained from images, such as color and texture indices and by [48] to identify marks on the plants and, thus, to identify possible diseases. Similarly, in [58,125] it was used to detect diseases, identify growth stages and the health of plantations.
Similarly, as shown in Table 7, IoT solutions used computer vision for applications that need to deal with image processing, such as crop monitoring and diseases prevention. It was also possible to observe in the reviewed papers the use of computer vision to identify and classify elements in images obtained by cameras, enabling the identification of fruit in an orchard [200] or the existence of diseases and pests in plantations [48,129,133]. Additionally, in [133] computer vision was used as a monitoring tool to detect the presence of insects that can cause diseases in olive groves and in [48] the same technique was employed to analyze diseases that cause morphological deformations in plants. Additionally, computer vision was used in crop management systems, for example in [134] where it was implanted in a robot equipped with a camera and other sensors, being able to obtain images of vegetation and, through computer vision, detect weeds in plantations and eliminate them. Similarly, in [111] a robot can identify a plant and interact with the environment to irrigate it, if necessary.
Finally, blockchain proved to be an opportune technology for systems that need to implement traceability of the supply chain, as shown in Table 7. According to [171] blockchain is a global public distributed ledger that records all transactions between users. In fact, this type of control is relevant for agriculture in several aspects, such as food safety, guarantee of origin or cost reduction. To ensure information security, this technology was proposed by [30,167,171] for agricultural product traceability. For example, in [171] an IoT solution uses blockchain to record information regarding the tea production based on 5 business processes: production plan, quality inspection, sales processing, product quality inspection and order delivery. In [167] a production tracking system for agricultural cooperatives have been developed. In [30] a similar system is being proposed but still in development stage.

Considerations
IoT solutions for smart farming take advantage of the scalability provided by platforms and cloud computing to store large amounts of data obtained by sensors. These big data of specific information may be processed with artificial intelligence techniques-such as machine learning-to improve the management of smart farming. For example, the processing of big data may be used to obtain crop insights, optimize water resources and increase the crop quality by preventing disease and reducing the amount of chemical products employed. Crop monitoring solutions use SBC (e.g., Arduino and Raspberry Pi) or UAV (e.g., drones) together with sensors (e.g., humidity, temperature, CO 2 or image) to collect data in indoor or outdoor environments.
Different types of network connections are used for communication between IoT devices, such as wired and wireless connections. The review shows that wired networks, such as CAN and Ethernet, are used for indoor agriculture (e.g., greenhouses). The use of wired network on indoor agriculture may be justified by the fact that in this scenario the physical components of the network are less susceptible to climatic agents impacts. Likewise, generally distance between sensor nodes in indoor agriculture enables this type of connection. Wireless connection, on the other hand, is used both in indoor and outdoor agriculture. Wi-Fi is the most mentioned protocol within the analyzed projects, due to its ubiquitous utilization in the daily life. However, power consumption and signal range characteristics may limit use of Wi-Fi in larger projects or in projects with power restrictions. To overcome the power consumption issue, energy-efficient protocols such as ZigBee, BLE or LoRa are used for communication in wireless networks.
Furthermore, it is worth mentioning that this review investigated papers where the IoT solution for smart farming was applied to agriculture only. However, the use of IoT for smart farming can also be applied to other activities related to farming, such as livestock [201]. Moreover, despite the fact that power-supply in IoT solutions for smart farming does not represent a specific layer of an IoT solution architecture [17,18], this topic has been covered in some of the reviewed papers. For example, [72,177] proposed improvements in algorithms for message routing and in duty cycles in sensor nodes. These approaches contribute to the reduction of power consumption by IoT devices. Similarly, a mission-based approach was used in [53] to optimize the power consumption in UAV. This approach was used to identify the most efficient path for a set of drones. Likewise, [177] proposed an intelligent activity cycle to improve the performance of data aggregators in terms of energy efficiency on cloudy days.

Conclusions
This work presented a systematic review of the state-of-the-art of IoT adoption in smart agriculture and identified the main components and applicability of IoT solutions. This review reported a change in the treatment of data in recent works: while previous work showed that the majority of decision support systems used simple processing mechanisms to handle data collected in real-time, more recent work showed an increasing number of management systems that use complementary technologies that rely Sensors 2020, 20, 4231 20 of 29 on cloud and big data computing for processing large amounts of data. Furthermore, it was observed in this review that in recent work the use of artificial intelligence and image processing techniques has become more common to improve the management of smart farming. From the identified applications of IoT for smart farming it was observed that the most common application is the monitoring of crops. This review also showed that different network protocols may be simultaneously used in IoT solutions for smart farming. In addition, the comparison of types of network connections used in IoT solutions for smart farming revealed that wired networks are used in indoor scenarios (e.g., greenhouse) while wireless networks are used both in indoor and outdoor scenarios (e.g., arable lands, orchards). Moreover, the review discussed in this work suggests the increasing relevance of IoT solutions for smart farming. Future work may extend this review by including other relevant articles and complementary analysis of project costs, usability and regional challenges intrinsic to IoT applications. Another important future research direction could be the analysis of the edge and fog computing usage in smart agriculture as a way to deal with challenges associated with traditional centralized cloud solutions such as high communication latencies, lack of support for real-time reaction to detected events, large bandwidths, etc.