Development of sensor nodes and sensors for smart farming

The world population is continuously increasing. Smart farming is required to keep up with this development by producing more food in a sustainable way. In many new sensor solution developments, the results of the sensor itself is at the target, but the whole solution fails to meet the requirements of the agriculture sensing use cases: the developments suffer from singular approaches with a constricted view solely on the sensor, which might be exchangeable. In this article, we present a holistic approach that can help to overcome these challenges. This approach considers the whole use case, from sense, compute, and connect to power. The approach is discussed with the example of the PLANtAR project, where we develop a soil nitrate sensor and a new leaf wetness and microclimate sensor for application in a greenhouse. The resulting sensor is integrated into a sensor node and compared to a state-of-the-art system. The work shows what is needed to assess the best tradeoffs for agriculture use cases based on a horticulture application.


Holistic sensor system development
Ramping up a new sensor use case is a long process that does not rely solely on the sensor. Therefore, a holistic approach is needed to find an optimal tradeoff, for example, between sensor node lifetime and measurement rate for the need of the specific use cases. New results of advances in sensor development, material improvements [1], new algorithms [2], and the next generation of wireless communication protocols [3] are published frequently. However, the development and integration of a whole use case solution that takes all aspects into account has not been reported yet.
With the so-called holistic sensor system development approach, all system levels are considered, from sensing over connection and computation to power. A cross-functional team has to work together, from the sensor and the integrated circuit (IC) technology to the software, including layers of data analytics. Where a single component can not be optimized without the consideration of the remaining components from the whole sensor system. Within the sensor system, the network links the sensor nodes to the user and builds the data foundation for smart farming. A sensor network, for example, a monitoring system of a high-tech greenhouse, can consist of several sensor nodes.
The sensor node has four main tasks sensing, computing, communication, and powering, visualized in Figure 1. The sensor digitalizes real-world influences. The computing part is for data management, analytics, and security. Power for energy supply and communication connects the sensor node with the user.
These nodes can differ by the combination of sensors or other components. They can be as small as 1x1 mm 2 if optimized for size or even attached to birds to track their annual migration, as well as agriculture projects [4][5][6]. However, commercializing this sensor and sensor nodes is challenging and depends on finding the best tradeoffs with a holistic approach. In the following sections, we take a closer look at each component of a sensor node. For example, the EU-funded research project PLANtAR follows the holistic approach described above, covering the complete value chain. The sensor developers contribute new sensing methods, like the leaf wetness and nitrate sensor. The technology partners provide biodegradable integration techniques, heterogeneously integrated materials, communication solutions, and artificial intelligence. Platform owners with direct customer access deploy the sensor solutions with their expertise to demonstrate and apply the sensor use case. Figure 2. shows all the partners and their contributions.
The variety of partners is beneficial to tackle the challenges from all perspectives. On the other hand, this approach raises additional challenges because multiple stakeholders and developers must align for co-development and co-optimization. The cross-functional project team needs a shared understanding of the challenges of the specific use case within reliable partners in an ecosystem over the whole value chain. Nevertheless, it is essential for a successful use case solution to apply a holistic approach. Exemplary for the interaction between the levels is that the sensor hardware depends on whether edge artificial intelligence is used. Edge artificial intelligence is the latest trend to implement artificial intelligence optimized for low-power devices, like microcontrollers. Therefore, the microcontroller has to be capable of performing these computations. Another dependency is data analysis, whether directly at the sensor, at the edge of a microcontroller, or in the cloud. The last level is connectivity and security. These dependencies converge together in the sensor node. As the sensor node is an integral part of the sensor system.

Sensing
Sensing environmental factors is a broad domain with various applications. Excellent facilities for sensor development are based in Europe. For example, micro-electrical and mechanical system (MEMS) microphones are widely used in smartphones and MEMS pressure sensors in automotive applications.
The potential for sensor usage in agriculture is abundant and the number of connected devices will continue to grow [7,8]. The world population is growing, while the available resources are limited. The European Commission tackled these challenges with the farm-to-fork strategy to reduce the use of chemical pesticides by 50 % and fertilizer by 20 % until 2030. The goal is to have sustainable food production. The agricultural sector shows an annual growth rate of 21.2 % in global spending on enterprise Internet of Things (IoT) technology. That makes it one of the sectors with the highest spending increase in the IoT market [9]. Reviews on this topic emphasize the benefit of recent IoT developments [10,11]. This is expected, as sensors are the key element to smart farming. They provide information about plants, conditions, time and place and enable growers to apply the required amount of raw materials at the right place and at the right time.
The use cases for sensor nodes identified in the EU-funded PLANtAR project vary greatly depending on the deployment area. Figure 3 shows the three identified application domains, namely, arable farming, non-arable farming, and indoor farming. Table 1 gives each domain its characteristic requirements.  Sensors translate a stimulus into a digital value. In recent years, the complexity of sensors has been highly increasing. The trend is going to low-power, heterogeneous sensor systems. Application experts provide an understanding of the stimulus of the sensor use case. Typical definitions are: what kind of stimulus, what is causing the stimulus, what sensitivity is necessary, and how rapidly or slow is it changing [12]. The challenge is to find the best tradeoff between general sensor performance, power consumption and cost efficiency by assessing the use case in a holistic way and understanding the stimulus in detail.
For example, leaf wetness and microclimate sensing are used for integrated pest management because moisture and temperature can be linked to how diseases spread [13,14]. The duration of the presence of liquid water, temperature and relative humidity on the crop surface is measured. The main sources of moisture are rain, fog, overhead irrigation or dew. In this case, the stimulus is moisture, and the change is in the order of minutes. With miniaturized and cost-efficient sensors, more sensors can be deployed in the greenhouse and measure the microclimate at the leaf. This matters because temperature and relative humidity within the canopy can substantially differ from the ambient air in the greenhouse. [15] Furthermore, in greenhouses, there can be a large spatial variability of temperature and relative humidity, which can cause local outbreaks of diseases. [16] State-of-the-art sensors use resistive or capacitive measurement principles to detect moisture, as shown in Figure 4. These bulky sensors mimic the properties of leaves. With special coatings, the sensors try to have the same radiation absorption and, thus, the same thermal properties. The goal is the same condensation and evaporation rate as the real leaf [17,18].  [17]; Right: resistive sensor (Spectrum) [18] The leaf wetness sensor developed in the PLANtAR project uses a capacitive measurement principle. This MEMS sensor is miniaturized to be attached to the real leaf and is intended to have very similar properties to the leaf. By miniaturization, it is possible to measure directly at the leaf. The sensor is coated with biocompatible Parylene C. The coating serves as a protective layer and as a sensitive layer. Underneath the sensitive layer are the sensing electrodes. The combination of the sensitive material and copper electrodes are the sensitive capacitors, as shown in Figure 5. The microclimate parameters change the dielectric properties of the sensitive layer. The sensing and reference capacitors are arranged in a Wheatstone bridge. Reference capacitors are independent of the changes in the sensitive layer. An application-specific integrated circuit (ASIC) provides an excitation voltage and converts the cross voltage of the bridge, caused by the capacitance change, to a digital value [19]. This digital data is then available for further processing. This sensor ASIC combination was mounted three times in a ceramic package in order to test three sensors in parallel. For the characterization under laboratory conditions, a 3D gas box was designed and various humidity levels were set to calibrate the sensors, shown in Figure 2 of [19]. In addition to the biocompatible materials, standard materials were tested to compare their sensitivity. The results, shown in Figure  4 and Table 1 of [19], proved the working principle of the biocompatible sensor.
After the characterization in the laboratory, the sensor is ready to be tested in the greenhouse environment. The sensor configuration is adapted in serval steps for the test. The sensor on a printed circuit board is shown in Figure 6. The request for mobile, decentralized usable chemical analysis methods for the determination of nitrate content as one important parameter of agriculture and the environment is permanently growing. The main reason for this is the intensive fertilization in farming, resulting in high nitrate concentrations in the soil as well as surface and groundwater bodies. In many groundwater samples, the legal limit of 50 mg/L is exceeded.
The methods for soil nitrate determination currently on the market have, among others, disadvantages in terms of sample handling, energy, time consumption, and costs. Ion chromatography is one example. As a highly precise method, it is commonly used to determine the nitrate content in environmental samples. However, ion chromatography cannot be used in field measurements -it is cost-intensive and needs well-trained personnel to run the measurements. Other state-of-the-art methods, like photometric cuvette tests, are simpler to run, but in most cases, they are lagging sensitivity and accuracy. Moreover, they may require the use of toxic chemicals or special preparation of the samples. Potentiometric ion analysis using electrochemical sensors has shown to be suited for nitrate determination on site. However, commercially available nitrateselective electrodes are still cost-intensive and, even more important, contain glass parts and fluid inner electrolytes. The latter makes their handling under field conditions difficult. To the best of our knowledge, no sensor system is available that allows long-term, autarkic on-site monitoring of nitrate, combined with intelligent data acquisition and IoT-based transfer.
To overcome these difficulties, within PLANtAR ion-selective nitrate sensors based on graphite electrodes in all-solid-state configuration are developed (Figure 7). Each sensor has a working electrode based on graphite and a reference electrode based on silver/silver chloride, both in an allsolid-state configuration. They are made by screen-printing technology and contain neither fluidic electrolytes nor glassy components. The modification of these electrodes determines the sensor performance in terms of nitrate detection, stability, and reproducibility. Focusing on these aspects, the graphite electrode modified with polypyrrole as conducting polymer and a final ion selective membrane layer with complexing compounds showed promising results. Conductive polymers are well known in the literature as solid contact materials due to their electrochemical properties. Their electrical conductivity is related to the formation of charge carriers in the polymer backbone, either by oxidation or reduction. Moreover, the presence of an additional charge requires the uptake of ions, e.g., from a solution, to maintain electroneutrality. Thus, the effect also makes it an ion exchange matrix. The coating with the polymer polypyrrole was carried out by electropolymerization by cyclic voltammetry from the monomer pyrrole. For the ion-selective membrane, the nitrate complexing compound tridodecylmethylammonium nitrate was immobilized equally in a polyvinyl chloride membrane (PVC). This membrane is responsible for selective and reversible forms of complexes with the desired analyte from a sample. The ion-selective membrane was applied by drop-casting method on top of the polypyrrole layer [20]. The working electrode and reference electrode are built on one planar alumina substrate (50x15x0.63 mm) used as the sensor body, which allows better miniaturization of the sensor. The production of this intrinsically robust sensor is cost-efficient and it features another interesting property. The overall mass of one sensor is only about 3 g, and it consists of more than 99 % of bio-inert materials, i.e., it shows already in the current state a very high degree of biocompatibility. Figure 8 shows an example of the potentiometric response of the sensor to ammonium nitrate (NH4NO3) standard solutions in the range between 10 -5 to 1 mol/L, and the corresponding calibration curve. The sensor shows a linear Nernst behavior over 5 orders of magnitude. Thus, it can potentially be used for nitrate detection in water (c 50 mg/L) as well as in soil with higher nitrate concentrations in the range of 1 g/L. Thorough materials' design of the working electrode has led to sensors that allow for reproducible nitrate detection in real samples over periods of months [20]. In this investigation, the process of conditioning, calibration, and nitrate detection of the samples was performed with a working electrode sensor modified with polypyrrole and graphite. The process was repeated at different times and with the same sensor. This experiment also showed that the sensor can be repeatedly dried out and reconditioned, still detecting the correct nitrate concentration. Moreover, it turned out that the working electrode is mechanically stable enough to position the sensor directly into the soil and determine the nitrate content as long as the soil is wet.
In Figure 9, an example of that is given. It shows the result of an experiment where an electrochemical sensor could be inserted directly into a wet soul sample without any extra protection on the working electrode membranes and detect stable voltage signals over time after being conditioned and calibrated in standard nitrate solutions. The results are summarized in Table  2. Reasonable agreement is observed with the nitrate concentration value added to the soul samples (0,01 mol/L) and with the reference measurements from the ion chromatography of the supernatant of this centrifuged sample.  014 These investigations suggest that it is advantageous for the interpretation of the measured nitrate values to combine the potentiometric measurements with the determination of soil moisture and temperature. At this point, the holistic approach of sensor system development proves to be the true one, easily realized.

Compute
In analogy to humans, a sensor node needs a brain to compute, process and store information. Within sensor nodes, microcontrollers or microprocessors perform these tasks. These ICs consume E / mv vs. Ag/AgClmodif. a significant part of the available energy budget, strongly related to the sensor node lifetime. Highperformance tasks, like security encryption, data processing, and artificial intelligence, are energyconsuming. Optimization techniques can increase energy efficiency, e.g. power-mode variations, batching, software and computation level adjustments [21].
The cross-functional team needs to find the best tradeoffs between computational power, storage size, security capabilities, availability of analog and digital interfaces and energy consumption. For this, they need to assess the data size and measured values, whether the analysis is performed on edge or in the cloud, redundancy, and possible sensor combinations.
For example, e-noses for pathogen detection generate a complex data set from which the relevant features and measurement points need to be extracted for further analysis. This can be done on the edge, at the sensor, and only relevant findings are communicated. In contrast, a leaf wetness sensor measures only one value, but several sensors are needed to cover a full canopy. Therefore, less computational power is needed, but more sensor nodes must be linked over the cloud. The digital values are read-out from the ASIC and calculated based on calibration. This value is then stored and ready to be sent to the system.

Connect
The sensor node communicates the measured and processed data either to other nodes or to a gateway. A gateway allows the connection from a low-power wide area network to another network, for example, an internet cloud server.
Recent developments result in a broad variety of wireless communication solutions with different strengths and weaknesses. The solutions differ greatly in the range, data rate, topology and more [22]. For example, low power wide area networks (LPWAN) are comparable in LoRaWAN, Sigfox and narrow band IoT (NB-IoT). For example, Sigfox and LoRaWAN operate in the unlicensed frequency range of the industrial, scientific, and medical (ISM) band, while NB-IoT is in the licensed frequency range of the LTE frequency bands. This is an important consideration for the possible interference in the unlicensed band, where any device can send and receive. Whereas, in the licensed band, a telecommunication provider is responsible for the quality of service. [23] It is on the developers to decide which hardware best fits. Depending on the use case, the best tradeoffs have to be found between communication range, data bandwidth (how much data can be sent), data rate and latency, cost of ownership, reliability and power consumption. For this decision, several points have to be assessed like available wireless technology, system architecture, measurement and reaction rate, as well as available infrastructure.
For example, in greenhouses as compared to fields for arable farming range can drastically differ. Sensor nodes with a range of less than 300 m can be useless in large open fields but work perfectly fine in greenhouses. Depending on the sensor system, the data bandwidth can be only a few digital values of temperature and humidity or pictures to determine ripening of fruits.
Depending on the stimulus, latency is important, whether to receive immediate or delayed feedback from the sensor node.
In remote areas, cellular connections are not always available, depending on the cost of ownership to setup and reliability, a wireless network can be setup and maintained by a provider or a farmer. Finally, yet importantly, wireless data can be very power-consuming. In general, more bandwidth costs more energy. Moreover, sending data over a longer range takes more power output. Balancing the factors of bandwidth, range, and latency can be specifically challenging.

Power
The backbone of the sensor node is the power source. For long-term monitoring and measurements, sufficient power must be stored and reliably retrieved. For energy provisioning, power management must monitor and control energy storage, like batteries, and potentially energy harvesting, e.g., solar panels. The best fit for energy storage depends on various factors, like energy and power density, battery discharge, energy capacity, operating temperature, and rechargeability. Typical non-rechargeable batterie compositions are alkaline (ALK), lithium manganese dioxide (LMD), and rechargeable compositions are lithium polymer (LIPO) [24].
An energy harvester can ease maintenance because the sensor node does not need battery exchange services and saves the resources of non-reusable power storage production. Different energy sources and their combination are under investigation, like solar, wind, radio frequency, or vibrations [25].
For co-optimizing the sensor use case, the best tradeoffs have to be selected for the power source, power storage and/or energy harvesting, voltage level, maximum current and power density. With energy-aware optimization of data processing, encryption, and wireless communication, like "think before you talk" and "race to sleep", significant improvements are possible [24].
The best tradeoffs are found when the following is assessed: the available infrastructure and use case environment, the components of the sense-compute-connect solution and the desired sensor node lifetime, one harvesting season or several years.
For example, a biodegradable sensor node can remain on the arable field, so the battery needs to last for one growing season. One data transmission per day is sufficient. Therefore, a biodegradable battery can be the best choice. This mostly biodegradable sensor node is planned within the PLANtAR project. Whereas non-biodegradable, more expensive sensor nodes are expected to last longer, as in the use case of indoor farming in greenhouses.

Demonstration of sensor nodes for smart farming
For the next step towards the demonstration of the PLANtAR sensor node in indoor farming, a first demonstrator for the greenhouse application is developed, as shown in Figure 10. This intermediate step allows the gathering of data without the constraints of highly optimized solutions, like low data rates and power restrictions. As the sensing component, the sensor was mounted and wire-bonded to a printed circuit board (PCB) and coated with Parylene C. An additional 3D printed housing ensures protection and constant distance to the leaf. For communication and to power the sensor, we connected the sensor to a Raspberry Pi. The Raspberry Pi is a single-board computer widely used for research projects. The performance, connectivity, ease of use and modularity make it a good fit for rapid prototyping. Power was retrieved from a wall plug. Communication was established with a wired connection. A Python program was programmed to initialize the sensor node and collect data. The sensor values were transmitted to an online database. With this configuration, a rapid demonstrator, the parameters of this use case were recorded for further investigations. The sensor was deployed and tested in a Venlo-type greenhouse compartment at the Wageningen University and Research Center in Bleiswijk, the Netherlands.
In this study, cucumber was used as a crop. The large, sturdy cucumber leaves are suitable for this application. The grower's goal is to maximize crop growth, but the climate, especially high air humidity or longer periods of leaf wetness, may affect production due to disease outbreaks. In greenhouses, several parameters are monitored and controlled, like temperature, humidity, radiation, CO2 level and opening angles of windows. The goal is to maximize plant growth and development. While the climate is also affecting the development and activities of diseases. The leaf wetness sensor data could be used additionally to the existing sensors to warn in case of local nonoptimal climate conditions that could invoke outbreaks of diseases. Figure 11 shows an example of the recorded data for one week. In the top graph, the leaf wetness sensor response left y-axis, and the relative humidity on the right y-axis, are plotted.  The middle graph shows the response of the state-of-the-art leaf wetness sensor [17]. Once the sensor detects moisture, the minutes are counted until the sensor is dried up. This value resets every day. For example, in the middle of 21.10.22 moisture is detected. The minutes are counted up over 100 minutes until the moisture evaporates. The duration of wetness is then constant until it is reset to zero the next day. In order to check the correlation with other events in the greenhouse, the bottom graph shows the window opening in percent of the windward and leeward windows.

Conclusion and outlook
Developing solely a sensor is not sufficient to solve a use case challenge. The development of a whole sensor solution takes years and is not only relying on the sensor alone. The goal is to have a wide impact with the innovative sensor use case. A holistic approach must tackle the use case challenges with partners over the whole value chain by co-development and co-optimization. This raises skills and organizational challenges for the cross-functional teams between partners and ecosystems. However, with this approach, the risk can be mitigated, and the best tradeoffs between the discussed solutions for each component can be identified for smart farming.
With the results of this first trial, we determine the sensing capabilities under relevant conditions and the needed data rate. Once algorithms are developed to extract the important features of the recorded data, the needed computational power can be assessed. Accordingly, to the sensor response, the communication rate is selected for the best tradeoff between latency and power consumption. With these results at hand, the power components for power storage or power harvesting can be selected.
The miniaturized potentiometric nitrate sensor showed from the beginning accurate results for real samples. Further investigations demonstrated that the sensor can be used for nitrate determination over months, even after extreme conditions for an electrochemical sensor. The robustness of the electrodes allowed them to be inserted directly into wet soil and measure consistent nitrate values. All these features make this potentiometric sensor promising for versatile monitoring, easy handling, and with as little intervention as possible.