**Real-Time Electrical Resistivity Measurement and Mapping Platform of the Soils with an Autonomous Robot for Precision Farming Applications**

#### **˙ Ilker Ünal \*, Önder Kaba¸s and Salih Sözer**

Department of Machine, Technical Science Vocational School, Akdeniz University, 07070 Antalya, Turkey; okabas@akdeniz.edu.tr (Ö.K.); sozer@akdeniz.edu.tr (S.S.)

**\*** Correspondence: ilkerunal@akdeniz.edu.tr; Tel.: +90-506-928-9903

Received: 30 October 2019; Accepted: 2 December 2019; Published: 1 January 2020

**Abstract:** Soil electrical resistivity (ER) is an important indicator to indirectly determine soil physical and chemical properties such as moisture, salinity, porosity, organic matter level, bulk density, and soil texture. In this study, real-time ER measurement system has been developed with the help of an autonomous robot. The aim of this study is to provide rapid measurement of the ER in large areas using the Wenner four-probe measurement method for precision farming applications. The ER measurement platform consists of the Wenner probes, a *y*-axis shifter driven by a DC motor through a gear reducer, all installed on a steel-frame that mount to an autonomous robot. An embedded industrial computer and differential global positioning system (DGPS) were used to assist in real-time measuring, recording, mapping, and displaying the ER and the robot position during the field operation. The data acquisition software was codded in Microsoft Visual Basic.NET. Field experiments were carried out in a 1.2 ha farmland soil. ER and DGPS values were stored in Microsoft SQL Server 2005 database, an ordinary Kriging interpolation technique by ArcGIS was used and the average ER values were mapped for the soil depth between 0 and 50 cm. As a result, ER values were observed to be between 30.757 and 70.732 ohm-m. In conclusion, the experimental results showed that the designed system works quite well in the field and the ER measurement platform is a practical tool for providing real-time soil ER measurements.

**Keywords:** soil; soil electrical resistivity; autonomous robot; real-time measurement; precision farming; mapping

#### **1. Introduction**

Soil electrical resistivity is an important indicator to indirectly determine the soil properties in the plant production because the suitable soil conditions and water are vital sources for plant root growth and solute transport, including plant nutrients and fertilizers [1]. The knowledge of soil resistivity is a valuable data in determining the composition of soil; such as for example, moisture [2], salinity [3], porosity [4], organic matter level [5], bulk density [6], and soil texture [7].

Soil investigation studies are commonly performed to determine the properties of the soil that involves topsoil and subsoil exploration such as physical mapping, soil sampling, and laboratory testing. Soil sampling and laboratory tests are usually performed to make subsoil investigation. Especially, the borehole method has been widely used to determine the soil properties due to its good data accuracy derived from the direct test method. However, this method has several difficulties and limitations such as high cost, time consuming, and insufficient data for huge farmlands. In this context, geophysical methods offer the chance to overcome some of the problems inherent in more conventional soil investigation techniques for soil structure characterization at larger spatial and temporal scales [8]. Soil is strongly correlated and can be quantified through the geoelectrical properties [9]. Moreover,

the soil resistivity is an important property that is a geoelectrical quantity that measures how the soil reduces the electric current flow through it.

The soil composition is one of the most important factors affecting soil properties and has a heterogeneous structure consisting of solid, liquid, and gas phases. The solid and liquid phases are a determinative factor in soil electrical resistivity and behavior of electrical fields [10]. ER measurement was made of at the end of the 19th century by dipping two probes into the soil and measuring the voltage drop between two probes, which impinge a defined current into the soil. In this method, measurement results were incorrect as it intrinsically includes the sum of both soil resistivity and the contact resistivity between the probe and soil [11]. Wenner [12] suggested that the four-probe ER measurement method for minimizing contributions is caused by the soil-probe contact problems. ER measurement has been conducted with the four-probe method in soil studies since 1931 for evaluating soil moisture [13,14] and salinity [15,16] under field conditions. All the soil ER measurements applied in soil science are still based on the standard four-probe method since that time.

In the Wenner four-probe method, the system consists of four probes which are equally spaced (a) from each other to measure apparent soil ER [17]. The outer probes (C1 and C2) are used as the current source (I) for current injection to the soil and the inner probes (P1 and P2) are used as the voltage source to measure voltage difference (V) between the inner probes [12]. Wenner resistance (RW) between inner probes is calculated by dividing voltage by current. A Wenner configuration is shown in Figure 1. The apparent soil ER (ρ*E*) with this configuration is calculated by Equation (1):

$$
\rho\_E = \mathbb{1} \ast \pi \ast a \ast \mathbb{R}\_W \tag{1}
$$

where: ρ*<sup>E</sup>* = measured apparent soil resistivity (ohm-m), *a* = probe spacing (m), *RW* = Wenner resistance (ohm). Four probes are dipped into the soil to be surveyed to a depth of not more than 1/20 the distance between the probes. The measured apparent soil ER value is average resistivity of the soil at a depth equivalent to the distance "*a*" between two probes. The measuring depth can be changed by changing the distance between the probes.

**Figure 1.** Four-probe Wenner configuration.

Today, agricultural production is carried out in huge farmlands and ER data should be collected fully automated to make a precision assessment of the farmland. Moreover, real-time soil resistivity measurement is important to map spatial farmland heterogeneity for precision farming applications. A useful approach for soil-property investigations is to use proximal soil measurements that combine soil sensors and data analysis methods to obtain high resolution soil data of the huge farmland [18]. Two portable systems are used to measure real time soil resistivity or conductivity of soil in agricultural studies—electrode-soil contact based system and noncontact electromagnetic induction (EM) system. The Veris (Veris Technologies, Inc., Salina, KS, USA) that has six coulter probes arranged in a Wenner method is the most important electrode–soil contact system to use to obtain multiple ER measurements representing different depths in agriculture [19]. The ARP (automatic resistivity

profiling, Geocarta, France) is another Wenner based electrode–soil contact system using to acquire and process in real-time both electrical resistivity data and GPS information [20]. The other is the EM38 (Geonics Ltd., Mississauga, ON, Canada) that is the most widely used noncontact EM system in agriculture [21]. The electrode–soil contact-based system has the advantage that it does not require user setup configuration and measures different soil depth [22]. On the other hand, the non-contact EM system is lighter in weight, smaller in size, and thus easier to handle [23].

Real-time soil ER measurement is an important criterion for precision soil survey and can provide continuous measurements to determine temporal variables and soil structure over a huge farmland. The purpose of this study is the development and application of a real-time soil ER measurement system based on the four-probe Wenner method by the help of an autonomous robot for precision farming applications. Finally, for a thorough assessment of a measurement process, field study results are presented to identify the components of variation in the real-time soil ER measurement process.

#### **2. Materials and Methods**

The main objective of the designed system is to measure the apparent ER of the soil and map it. The system consists of four main parts:


#### *2.1. Four-Probes Wenner-Based Measurement Platform*

The developed measurement system is shown in Figure 2. The measurement platform was made of stainless steel. Some parts of the platform were made of the square steel tube 30 × 30 × 3 mm. The mechanical structure of the measuring system consists of two parts, called the H-shaped carrier grid and the Wenner measurement platform. For vertical movement of the measurement system, an H-shaped carrier grid was constructed by using two 30 × 30, 910 mm, and by three 30 × 30, 800 mm square steel tubes. Then, this grid was attached to the autonomous robot. The H-shaped grid held the Wenner measurement system. The H-shaped grid has two steel linear guides adjusted by 30 mm linear rail shaft guide supports and pillow blocks. The length of the linear guides is 910 mm. It was used a linear actuator, made up of a 30 × 850 mm ball screw, operated by a 24 V—500 W–1440 rpm DC motor which was coupled to a 1:40 reduction gearbox for the vertical movement. The DC motor was mounted on the H-shaped carrier grid. A 740 × 400 mm rectangular U-shaped sliding platform was attached to the H-shaped carrier grid. A square flanged nut ball screw is mounted on the back of the sliding platform. The ball screw was coupled to this square flange nut. Then, the Wenner measurement platform was connected to this rectangular U-shaped sliding platform.

**Figure 2.** The developed measurement system. (**a**) Full scale technical drawing of the measurement platform; (**b**) full developed measurement platform; (**c**) four-wheel drive agricultural robot, which has the Wenner measurement system.

The Wenner measurement platform has four Wenner probes. Four steel Wenner probes were linearly mounted on the Wenner measurement platform at 500 mm intervals to measure the average apparent ER values of the soil between 0–500 mm. The fiber isolation rings were used to ensure electrical isolation between the platform and the probes. The Wenner probes are 12 mm in diameter and 25 mm long. The probe length must be 1/20 of the distance between the probes. The distance between probes can be changed to measure apparent ER resistivity of the soil at the different depths. Each probe was wired with the insulated single core cable. The cables of the C1 and C2 probes are connected directly to a 24-volt battery to inject electric current into the soil. The cables of the P1 and P2 probes are connected to a multimeter to measure the potential difference between the probes in the soil. The system is also capable of measuring soil penetration resistance.

#### *2.2. Autonomous Robot and Steering Algorithms*

The four-wheel drive agricultural robot which is used in this study can be steered both autonomously and manually. Four 2.50 × 17 rubber wheels were chosen to steer the robot in field conditions. It has a differential steering mechanism. In this system, the speed difference between the right and left wheels of the robot can be created. To make the mobile robot steer in a straight line, speeds of the all wheels must be the same. If the speeds of the right and left wheels are different, the robot rotates to the slow wheels side. When the right and left wheels are rotated opposite each other, the mobile robot can be able to rotate 360 degrees where it is. The robot is powered by four

24 V—0.25 kW—1440 rpm DC motors which were coupled to a 1:10 reduction gearbox. Each wheel of the robot was independently coupled to motor-gearbox assemblies mounted on the robot chassis. In this way, the torque generated by the motors can be transmitted completely to the wheels. The robot's weight is approximately 150 kg with batteries and the measurement system and the maximum speed is 20 km/h. Two RoboteQ FDC3260 three-channel DC motor control units (Roboteq Inc., Scottsdale, AZ, USA) were used to steer the robot by varying the speed and direction of the motors. The two 12 V-90 Ah rechargeable maintenance-free sealed batteries were used as the power source of the robot and other equipment's. Moreover, two batteries were connected in the series to provide 24 V for the DC motors.

In order to operate the mobile robot both manually and autonomously, the navigation program was codded in Visual Studio.NET 2015 using Visual Basic.NET language. This program was firstly coded for two-wheel drive robots by the author in 2015 [24], and rearranged to the four-wheel drive robots for this study. However, the navigation algorithm is the same. The flowchart for autonomous drive of the mobile robot is given in Figure 3. The flowchart of the quadrant control mechanism is given in Figure 4.

**Figure 3.** The flowchart for autonomous drive of the mobile robot.

**Figure 4.** The flowchart of the quadrant control mechanism.

In autonomous guidance algorithm, the angle difference is calculated using heading and azimuth angles. In this way, the robot can be steered to the desired direction. After that, the distance between the robot location and the target location is calculated. Lastly, when the heading angle is equal to the azimuth angle and the distance is equal to zero, the robot arrives at the desired location. In quadrant control, the compass dial is used to determine the quadrant in which the current point was located. The calculated azimuth angle helped in determining the quadrant in which the target point was located [24].

#### *2.3. Data Acquisition System*

The data acquisition system is described for two processes. The first is the autonomous steer system of the robot and the second is the measurement system of the apparent ER of the soil. In this study, Lilliput PC-700 industrial all-in-one touchscreen computer (Zhangzhou Lilliput Electronic Technology Co., Fujian, China) was used to manage and communicate with each other all of the electronic-based equipment placed on the robot. In the autonomous steer system, a Promark 500 RTK-GPS (Magellan Co., Santa Clara, CA, USA) receiver was used to collect geographical data. These data were used to determine the geographic location (latitude, longitude, speed, time, etc.) of the robot. In addition, the RTK-GPS receiver was used to determine the measurement location of the apparent ER of the soil for mapping. The Honeywell HMR3200 (Honeywell International Inc., Charlotte, NC, USA), which is a digital compass, was used to collect the precision heading angle of the robot for navigation software. The Protek 506 handheld digital multimeter (MCS Test Equipment Ltd., Denbighshire, UK) was used to measure voltage between P1 and P2 Wenner probes. Two RoboteQ FDC3260 three-channel DC motor control unit were used to control robot steering and also movement of the Wenner measurement platform. The RS232 protocol was used for connecting the industrial computer and other electronic devices.

#### *2.4. Software Development*

A program was developed using Microsoft Visual Basic.NET 2015 programming language to steer the robot both autonomously and manually and measure apparent ER values of the soil. It was used to control the robot and measuring system, monitor the telemetry data, store all the data in the database, and prepare the suitable file for ArcGIS mapping software. The program consists of two parts: Navigation software (Figure 5) and soil resistivity measurement (Figure 6).


**Figure 5.** Navigation software.


**Figure 6.** Soil resistivity measurement.

In the navigation software, the waypoint file can be loaded from database into the program. In this way, the waypoints can be used to steer the robot from point to point for autonomous guidance. Each waypoint includes a longitude (X2) and latitude (Y2) value which is the location of the target point to be measured. There are two important angles for robot navigation: Robot's heading angle and azimuth angle of the target point. Robot's heading angle is taken from the HMR3200 electronic compass by the navigation software. Additionally, the azimuth angle is continuously calculated by the

navigation software. Moreover, the distance between robot position (X1, Y1) and target position (X2, Y2) is calculated by the software. These calculations were shown in Figure 3.

In the soil resistivity measurement part, the current applied to the C1 and C2 probes and the voltage collected from probes P1 and P2 is monitored. Additionally, the Wenner resistance (Rw) is calculated instantly during the measurement using the obtained current and the measured voltage values. All data are stored instantly to the SQL Server 2005 database. The ArcObjects SDK 10 Microsoft .NET Framework was used to prepare and display the soil ER maps using ArcMap interface in ArcGIS.

#### *2.5. Experimental Field and Data Collection*

The field experiments were carried out at the Batı Akdeniz Agricultural Research Institute, in Aksu, Antalya, Turkey (36◦56 34.46" N and 30◦53 04.10" E). The experimental field has an area of 1.2 ha and an elevation of 35 m above the sea level. In this field, the corn silage was harvested on July 25, 2019. The soil type is silty-clay, having a dark brown color, consists of 18% sand, 40% silt, and 42% clay. The organic matter content was 1.4%. Soil bulk density was 1.29 g/cm3, the water content was 6.8%, and the average soil penetration resistance value was 1.62 MPa between 0 and 20 cm. The experimental field was shown in Figure 7.

**Figure 7.** The experimental field.

During the study within the experimental field, the robot was autonomously steered to 72 different geographical points and the average apparent soil ER values were collected for 0–50 cm depth. In this system, autonomous stop-and-go measurement method was used to measure the apparent soil ER values in large farmlands. The stop-and-go method is all about stopping the robot when taking the measurement. In this method, the agricultural robot goes to the first measurement point and stops, takes the measurement, and goes to the next measurement point. In this procedure, the digital map with high-resolution content of the experimental field was transferred into the ArcGIS 10.5 mapping software to determine the measurement points in large farmlands. In this way, a total 72 different GPS waypoints were randomly determined for autonomously steering the robot to the measurement point. All waypoints were stored to the database. After that, the agricultural robot was steered point-to-point to measure apparent soil ER value. All measured data were stored into the SQL Server 2005 database by the soil resistivity measurement software.

#### **3. Results**

In this study, the data obtained from all measured points were imported into Microsoft SQL Server 2005 database and mapped using ArcGIS 10.5 mapping software. In ArcGIS, ordinary Kriging interpolation was used to generate the contour map which makes a prediction of the apparent soil ER values in other parts of the experimental field for sampling.

The selection of the type of Kriging interpolation to use depends on the characteristics of the spatial data. Soil properties can spatially differ from point to point. As with most soil physical properties, soil is not also homogeneous in terms of electrical resistivity. In this regard, ordinary Kriging interpolation was used in this study. Simple Kriging is based on the theory of stationarity. This means that the mean and variance remain constant and are known in all locations. On the other hand, ordinary Kriging is a spatial estimation method and a linear geostatistical method that assumes that the mean may vary in the study area and does not remain constant. Universal Kriging is used to estimate spatial means when the data have a strong trend. This means that the trend is scale dependent. The apparent soil ER data may display trends over small geographic areas but at the scale of the huge farmlands, there is no trend that can be modeled by simple functions. Simple and universal Kriging interpolations were not chosen for this study because of these reasons.

A summary of the method used for Kriging interpolation is given in Table 1. The histogram of the apparent soil ER values is given in Figure 8. As can be seen in Figure 8, the minimum value of the soil ER is 30.757 ohm-m and the maximum value is 70.732 ohm-m. The skewness and Kurtosis values were observed as −0.14091 and 1.7091, respectively. Due to the skewness value being between −1 and −0.5, the data are reasonably skewed. This would mean that the sample data for the apparent soil ER are approximately symmetric. The Kurtosis value is low (<3). This means that the data are slightly platykurtic, the lack of outliers are in data, and the extreme values are less than that of the normal distribution.


**Table 1.** The field study data.

**Figure 8.** The histogram of the apparent soil ER (Electrical Resistivity) values.

The normal QQ plot graph was used to show the quantiles of the difference between the predicted and measured values and the corresponding quantiles from a standard normal distribution. As can be seen in Figure 9, the errors appear to be normally distributed even though there is a slight, possibly curved trend in the plot. Prediction errors of the ordinary Kriging method are given in Table 2.

**Figure 9.** The normal QQ (Quantile – Quantile) plot graph of the standardized error.

**Table 2.** Prediction errors of the ordinary Kriging method.


In order to obtain the interpolation of the soil apparent ER values, the map of soil apparent ER on the experimental field was interpolated by using the ordinary Kriging approach. The interpolation map is given in Figure 10. Moreover, the Voronoi map of the study is given in Figure 11. It is observed that the ER values on the left side of the map are higher than the right side when the map is examined visually. This is also clearly seen on the Voronoi map of the study. If the measured points are close to each other, apparent soil ER values are approximately homogeneous. However, when the distance between the points increases, homogeneity decreases.

**Figure 10.** The interpolation map of the soil ER.

**Figure 11.** Voronoi map of the study.

#### **4. Discussion**

The apparent soil ER values depend on several parameters such as size of the soil, porosity, and water content. Hunt [25] indicated that the electrical resistivity varies from 1.5 ohm-m and below for wet clay soils to more than 2400 ohm-m for massive and hard bedrocks (Table 3).



In the literature, there are not many studies measuring the apparent ER of the soil by the using mobile Wenner platform. However, there have been studies autonomously determining soil electrical resistivity of different soil types about soil science. Giao et al. [26] measured the electric resistivity of over 50 clay soil samples collected worldwide in the laboratory. Researchers have also measured the electric resistivity of over 50 soil samples taken from different locations in South Korea. As a result, they said that the sandy soil has a resistivity of above 10 ohm-m, the silty soil has a resistivity from 5 to 10 ohm-m. Juandia and Syahril [27] measured soil resistivity on 25 points across the study area using the Schlumberger configuration. Soil type was silty-sand. They reported that the average soil resistivity varied from 33 to 40.5 ohm-m. Rossi et al. [28] investigated the potential use of a direct current (DC) continuous resistivity profiling on-the-go sensor in precision viticulture. The authors used an automatic on-the-go DC recording resistivity meter (ARP, automatic resistivity profiling. Geocarta, Paris, France) in the three soil layers (V1 = 0–0.5, V2 = 0–1, and V3 = 0–2 m depth) on a vineyard area. Soil type was Inceptisol. The authors reported that soil ER values varied from 3–151 ohm-m for 0–0.5 m depth, 30–511 ohm-m for 0–1 m, and 9–750 ohm-m for 0–2 m depth. Lee and Yoon [29] investigated the theoretical relationship between elastic wave velocity and electrical resistivity. The authors measured the elastic wave velocity and electrical resistivity in several types of soils including sand, silty sand, silty clay, silt, and clay–sand mixture and the temperature compensated electrical resistivity probe was used for measuring. The authors said that the electrical resistivity showed at ranges of 1.23–2.17, 1.08–1.91, 1.01–1.40, 0.33–0.44, and 6.39–7.14 ohm-m in the order of soil types previously mentioned. Merritt et al. [30] developed a methodology for measurement and modeling of the moisture–electrical resistivity relationship of fine-grained unsaturated clay-based soils and electrical anisotropy. Soil resistivity measurements were conducted for four different soil types: Silty-clay, fine sand, clayey sandy silt, and siltstone. The results showed at approximately ranges of 10–100, 100–150, 50–800, 100–10000 ohm-m. The authors reported that the soil resistivity increases with decreasing moisture content. Kim et al. [31] evaluated the effects of soil properties and electrical conductivity on the water content reflectometer calibration for landfill cover soils. For this aim, the electrical conductivity measurements were performed for a set of 28 soils which have different soil textures by using high-frequency time domain reflectometer (TDR). The authors reported that the soils with a greater clay content or organic content have higher electrical conductivity than the soils with silts and sands. This means that the ER values of the clay soils should be low.

The traditional soil sampling is made by using the borehole method to determine the soil physical, chemical, or biological properties of soil layer in laboratory conditions. In this method, the laboratory calibration of the soil ER with soil moisture should be done. However, laboratory calibration may not give the correct relationship between soil moisture and electrical resistivity for real soil conditions [32]. On the other hand, in the precision farming domain, the autonomous and continuously measurement of the apparent soil ER has some advantages such as fast measurement and low cost for mapping both the horizontal and the vertical spatial variability in large farmlands. Moreover, the user setup configuration or calibration in this system is not required. Both Veris and ARP systems have been developed to achieve these advantages and measure the soil resistivity or conductivity as mobile for precision farming applications. The cost of the basic Veris system is 11.500 USD [33]. However, there is not any price about the ARP system in the literature. However, Andrenelli et al. [34] reported that the daily cost is 3000 Euro for ARP system usage. In our proposed system, the study was carried out within a project and the total budget was 8000 USD for all the system.

Both the ARP and the Veris system are semi-mounted type measuring platforms that are attached to the tractor or any other vehicle such as ATV. In this context, these systems need a traction system and at least one operator for their operation. Moreover, these systems are not lightweight and have low maneuverability. On the other hand, the benefits of the designed system are obvious: Easy to manufacture, compact measurement system with robot, lightweight, low manufacturing and operation cost, high maneuverability, and used autonomously.

This study was undertaken on silty-clay type soil by using the measurement system developed by us. In this study, the apparent soil ER values were measured between 30.757 and 70.732 ohm-m. The measurement results were shown similarity with the abovementioned literatures for silty-clay soils [25,27,30]. In addition to our results, for the obtained apparent soil ER values to be more significant, soil penetration resistance should be simultaneously measured and correlated with soil moisture content and bulk density [35–42]. No faults were detected in the electromechanical, data acquisition, and software parts of the system during field operation. The experimental results showed that our measurement system is suitable for map-based precision farming applications.

#### **5. Conclusions**

In this study, a new design for real-time apparent soil ER measuring system and its mapping capability has been presented for map-based precision farming applications. Although the laboratory analysis is usually the reliable method for determining most soil properties, real-time measurements to monitor the soil properties have advantages and benefits for precision farming applications. The DC apparent soil ER measurement method is one of the simplest geophysical techniques and still employed extensively because of its easy-to-use, no calibration required, and relatively easy interpretation in all engineering studies. However, a robot-based mobile Wenner measurement platform has not been found in the agriculture literature. The apparent soil ER map created by the developed software can be a useful source for precision farming applications across different fields. For researchers, data collection, analysis, and interpretation from farmlands have always been hard, time-consuming, and tedious studies in agricultural applications. The results of the study show that using this system is important for researches and professional applications of soil science.

**Author Contributions:** ˙ I.Ü. was responsible for the project administration, conceptualization, data curation, formal analysis, methodology, software, and writing—original draft. Ö.K. was responsible for funding acquisition, investigation, resources, validation, and visualization. S.S. was responsible for the supervision, funding acquisition, and writing—review and editing. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work is financially supported by The Scientific Research Projects Coordination Unit of Akdeniz University (project number: FBA-2017-1980).

**Acknowledgments:** We are very grateful to the Akdeniz University Technical Sciences Vocational School technicians for their cooperation and effort in supporting the experiment.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **An ISE-based On-Site Soil Nitrate Nitrogen Detection System**

#### **Yanhua Li 1, Qingliang Yang 1, Ming Chen 1, Maohua Wang 1,2 and Miao Zhang 1,2,\***


Received: 20 August 2019; Accepted: 23 October 2019; Published: 28 October 2019

**Abstract:** Soil nitrate–nitrogen (NO3 −-N) is one of the primary factors used to control nitrogen topdressing application during the crop growth period. The ion-selective electrode (ISE) is a promising method for rapid lower-cost in-field detection. Due to the simplification of sample preparation, the accuracy and stability of ISE-based in-field detection is doubted. In this paper, a self-designed prototype system for on-site soil NO3 −-N detection was developed. The procedure of spinning centrifugation was used to avoid interference from soil slurry suspension. A modified Nernstian prediction model was quantitatively characterized with outputs from both the ISE and the soil moisture sensor. The measurement accuracy of the sensor fusion model was comparable with the laboratory ISE detections with standard sample pretreatment. Compared with the standard spectrometric method, the average absolute error (AE) and root-mean-square error (RMSE) were found to be less than 4.7 and 6.1 mg/L, respectively. The on-site soil testing efficiency was 4–5 min/sample, which reduced the operation time by 60% compared with manual sample preparation. The on-site soil NO3 −-N status was dynamically monitored for 42 consecutive days. The declining peak of NO3 −-N was observed. In all, the designed ISE-based detection system demonstrated a promising capability for the dynamic on-site monitoring of soil macronutrients.

**Keywords:** on-site detection; ion-selective electrode (ISE); soil nitrate nitrogen (NO3 −-N); soil moisture; sensor fusion

#### **1. Introduction**

The ion-selective electrode (ISE) transfers the ionic activity (or concentration) of the target ion dissolved in testing solutions into electromotive force (EMF). Theoretically, the measured EMF is related to the logarithm of the ionic activity according to the Nernst equation. Because of the importance of fertilizer in agricultural production, ISEs have been used in soil nitrate–nitrogen (NO3 −-N) analysis for more than half a century [1]. A prototype ISE based on an in-field nitrate monitoring system was first developed in 1994 and has been successively improved by Canadian researchers [2–4]. Soil samples were collected at a depth of 0–15 cm with an autosampler. GPS information was recorded at the same time. Programmable processes of soil bulk crushing and plant residue removing were designed. NO3 −-N extraction was obtained by mixing the collected soil with de-ionized distilled water (DDW). The influence of soil texture was considered in sensor calibration. The fifth generation of the modified system demonstrated a satisfactory correlation with the standard method. An R<sup>2</sup> of 0.92 was found in testing of 13 sets of samples. The problem of random ISE signal disturbance caused by soil slurry was claimed.

In 2001, a portable ISE detection kit was developed for direct in-field measurement of soil chemical properties, including pH, mineral Na+, mineral K<sup>+</sup>, and NO3 −-N [5]. More than 500 soil samples were collected. However, the NO3 −-N testing results demonstrated obvious variations from the standard spectrometric method. At the same time, researchers from the University of Missouri compared extractants for ISE-based soil macronutrient detection. Kelowna solution was chosen for the extraction of soil available K<sup>+</sup>, PO4 <sup>3</sup>−, and NO3 −-N. Extracted soil solution was manually obtained using the recommended soil testing protocol. Feasibility was evaluated with 37 samples. ISE based laboratory soil NO3 −-N detection demonstrated good accuracy with standard deviations ranging from 8.04 to 19.7 mg/L [6,7]. Multiple studies were conducted on ISEs foron-the-go soil macronutrient monitoring by Adamchuk et al. For the purpose of achieving on-the-go soil testing, the "Direct Soil Measurement" (DSM) system was designed and then validated, updated, and commercially transformed in 2005. The ISEs of NO3 <sup>−</sup>, K+, and pH were integrated to form the sensing unit. De-ionized(DI) water was applied for the cleaning of the ISE sensing array. Sensing results were directly collected without pretreatment operations of stirring and filtration. Compared with laboratory detection, the DSM results of NO3 <sup>−</sup>, K+, pH were reported with coefficients of determination (R2) of 0.41–0.51, 0.61–0.62, and around 0.9, respectively [8,9]. Insufficient sample extraction was considered to be a possible reason for the unsatisfactory accuracy level. Sethuramasamyraja et al. improved the soil pretreatment process of the system by integrating a mechanical agitation operation into the sample extractant process. The "Integrated Agitated Soil Measurement" (ASM) results of the soil pH were comparable to laboratory testing with an R<sup>2</sup> value of 0.99. However, the predicted NO3 − value still demonstrated great deviation from standard spectrometric results with an R2 value of 0.48 [10]. On the basis of the ASM system, the latest "On-the-Spot Analyzer" (OSA) system was developed for the simultaneously measurement of soil properties at a predefined soil depth. ISEs were brought into direct contact with the conditioned soil slurry, after the testing stand was moved to the experimental field and the topsoil was removed. Once sensors readings were retrieved, the analyzer was removed to another testing spot. Forty-five sets of surface topsoil samples with NO3 −-N concentrations ranging from 0 to 30 mg/kg were measured on the spot. The correlation coefficient R2 was increased to 0.87 [11]. The improved detection accuracy with the OSA system demonstrated promising potential for the achievement of automated measurements.

As far as we are concerned, most of the in-field soil testing discussed above involves reduced soil pretreatment operations due to the system's simplicity and efficiency. The testing error, produced by "soil particle suspension disturbance", reached a magnitude of 26.6 mg/kg with an average relative error of 50% according to our preliminary laboratory validation of ISE-based NO3 −-N detection with 15 soil samples [12]. Besides, soil slurry would contaminate the membrane of ISE. The response slope of NO3 − ISE was determined to be 44.4 and 25.4 mV/decade after continuous testing for 4 and 12 h, respectively [13]. Thus, it was necessary to obtain a transparent soil extract to enhance the accuracy and lifetime of the ISE. Pan et al. [14] tried to separate the clear soil NO3 −-N extractant from sample slurry through the short-time process of spinning centrifugation. Seven soil samples were used for the optimization of the centrifugation operation. Clear soil extractant was obtained by spinning for 30 s at the centrifugation speed of 1000 rpm. Compared with the direct soil slurry detection, the NO3 −-N detection relative error decreased from 64% to 5%. Yanhua et al. [15] attempted to evaluate the effects of uncalibrated soil moisture on NO3 −-N with six samples at the laboratory. The moisture of the tested samples was pre-manipulated to 2%–25%. The ISE based NO3 − ISE results were uniformly smaller than the standard spectrometric results when the influence of soil moisture was neglected. A soil moisture percentage of 25% produced a maximum absolute error of 30 mg/kg. An error of no less than 5.0 mg/kg occurred even when the soil moisture was 5%.

For the purpose of improving the accuracy of on-site soil NO3 −-N detection, a self-designed prototype system was designed by making use of the sensor fusion method. Both the NO3 − ISE and soil moisture sensor were employed as the sensing unit. The specific objectives were, first, to integrate necessary soil pretreatment steps, e.g., sample weighting and extractant spinning centrifugation into an on-site testing bench. Second, we investigated a modified Nernst model for the prediction of soil NO3 −-N with the real-time data provided by the ISE and the moisture sensor. Finally, we evaluated the feasibility of the system.

#### **2. Materials and Methods**

#### *2.1. Reagents and Apparatus*

A soil moisture sensor (ECH2O-5TE, Decagon, WA, USA) produced volumetric moisture readings that were used to determine the soil's net weight. The sensor was claimed to have a detection precision of <sup>±</sup>3% m3/m3. Reagents used were all Analytical grade. The testing solution was prepared with Deionized Water (Di-water). Standard soil chemical properties were provided by the soil testing center of the China Agricultural University with commercial analytical instruments. Detection was carried out according to the guidance of soil testing and fertilizer recommendations [16]. Soil moisture was oven dried at the temperature of 65 °C for 8 h (SG-GDJ50, SIOM, Shanghai, China). Soil NO3 −-N was detected with a UV-VIS spectrometer (UV2450, SHIMAZU, Kyoto, Japan) at 210 nm. H2SO4 (70%) was applied to the soil extractant for acidification. The Total-N (TN) soil concentration was determined with Kjeldahl determination (KJELTEC 8400, FOSS, Hillerød, Denmark). Soil available phosphate (AP) was detected based on Molybdenum Blue Colorimetry at 660 nm (UV2450, SHIMAZU, Kyoto, Japan). The Organic Carbon (OC) concentration was measured based on dry combustion at 550 °C for 24 h (SG-SJ1700, SIOM, Shanghai, China). Flame photometry (420, Cole-Parmer, IL, USA) was used to measure the Available potassium (AK) content of the soil. Commercial nitrate ISE (No.9707BNWP, Thermo Scientific Orion, MA, USA) with a detection limit of 1.4 mg/L was also employed in this study.

The analytical grade chemicals used for the calibrations of ISE and the detection of standard soil macronutrients were purchased from Sinopharm Chemical Reagent Beijing Co. Ltd.

#### *2.2. Sensor Fusion Model*

The detected NO3 −-N content would be greatly underestimated if soil moisture interference was not involved in the compensation of the sample net weight. In this study, volumetric soil moisture information was obtained during the on-site soil sampling. The volumetric moisture was converted into the gravimetric moisture for the correction of the sample's net (dry) weight. The detailed procedure was discussed in a previously published paper [15]. A sensor fusion model was designed for the NO3 −-N prediction, as illustrated in Equations (1)–(3). Compared to the conventional Nernst model, the ratio of extractant to soil weight of the sensor fusion model achieved real-time correction instead of using a constant value, as used in most of the previous studies.

$$
\omega = \frac{\rho\_w \times (\theta - \theta\_0)}{\rho\_s} = \frac{1}{\rho\_s} \times (\theta - \theta\_0) \tag{1}
$$

$$N = \omega + \frac{\omega m + m}{M} \tag{2}$$

$$C\_i = 1000 \text{N} \cdot A\_r 10^{\frac{\kappa - \kappa\_0}{5}} \tag{3}$$

where ρ*<sup>s</sup>* represents the pre-determined bulk density of dry soil (1.19 g/cm3); ρ*<sup>w</sup>* represents the density of deionized water (1.0 g/mL); θ<sup>0</sup> represents the pre-determined volumetric moisture ratio (–1.51%); θ represents the soil volumetric moisture (%); ω represents the soil mass moisture (%); *M* represents the weight of the raw soil sample (g); *m* represents the volume of soil extractant (mL); *N* represents the ratio of extractant to the net weight of soil (mL/g); *Ar* represents the relative atomic mass, which, for nitrogen, is 14; *Ci* represents the concentration of nitrate in the tested sample (m/V, mg/L); *E* represents the EMF value produced by ISE (mV); *E*<sup>0</sup> represents the intercept potential of the Nernstian model of the tested ISE (mV); and *S* represents the response slope of the Nernstian model of the tested ISE (mV/decade), where decade means 10 times the change in the target concentration.

#### *2.3. System Design*

The on-site soil NO3 −-N detection bench consisted of five major units, including the extractant preparing unit (A), extractant clarification unit (B), electrode holder unit (C), leveling unit (D), and electronic control circuit unit (E), as illustrated in Figure 1a,b. Centrifuge (B9) was employed to achieve separation of the clarified extractant from the soil slurry. The centrifuge process was conducted at a speed of 1000 rpm for 3 min. The manually collected soil sample was weighed with electronic scales with a precision of 0.1 g (A10). Stepper motors of A1 and B1 were employed to achieve vertical movements of two mechanical arms for extractant injection and transportation. The proximity sensors of A5 and B4 were used to define the working scale of the vertical slide table (A3/B3). The precision of vertical movement was measured to be 0.05 cm. Rotary table B7 was driven by step motor B7. Centrifuge B9 had 12 container positions, so B7 would rotate by 30 each time with a control precision of 0.5◦. Transportation of DDW and the sample extract was achieved by peristaltic pumps A4/B5 through tubes of A6/A7. The stirring operation was performed with Blender A8. ISE testing was conducted by hanging the sensor on C2. To keep the balance of A10 and B9, the bench employed leveling meter D2, positioner D3, and screw adjuster E1.

The detection bench was manipulated in a programmable way by the self-designed electronic control circuit unit, as shown in Figure 1c. The STM 32 Microchip Controller Unit (MCU) was applied as the main processor. The underlying hardware of step motors 1–3 and peristaltic pumps 1–3 were motivated with the drive unit according to the pre-designated flowchart. A proximal sensing signal was sent to the MCU when the mechanical arms were close to the vertical limitation of 10 cm. A Bluetooth connection was formed among the control circuit, ISE datalogger, and Android terminal devices, e.g., smartphones. Sensor readings and user commands were communicated. A schematic diagram of the circuit is illustrated in Figure 1c.

The rural smartphone popularity was reported to be 32% in China [17]. Considering the interface resource, flexible communication mode, convenient data storage, and upload capability, application software running on Android terminal devices was also developed in this study. The interface of the smartphone App is shown in Figure 1d. Predetermined soil sample profile information, including soil texture, bulk density, sample weight, DDW volume, and electroconductivity, should be input, saved, and downloaded to the control circuit. The parameters of the sample pretreatment operation, e.g., stirring time, rinsing method, and motor speed, are chosen according to the testing mode. Testing setups were employed with the calibration solution number, testing duration, sample number, file save option, and real-time display. A Location-Based Service (LBS) was embedded to provide the sample's geographic position. The Bluetooth setup was operated on the App.

**Figure 1.** *Cont.*

F

(d)

**Figure 1.** Diagram of the on-site detection bench: (**a**) System Design A1, Stepper motor 1 A2. Proximity sensor 1 A3, Vertical slide table 1 A4, Peristaltic pump A5, Proximity sensor 2 A6, Injecting tube A7, Outlet tube A8, Blender A9, Soil sample container A10, Electronic weight scale B1, Stepper motor 2 B2, Proximity sensor 3 B3, Vertical slide table 2 B4, Proximity sensor 4 B5, Peristaltic pump2 B6, Rotary table B7, Stepping motor 3 B8, Pipe hanger B9,Centrifuge C1, Electrode hanger 1 C2, Electrode hanger 2 D1, Horizontal Lever meter D2, Positioner D3, Leveling screw E1, Circuit controller E2, ISE connector E3, Control switches and indicator lights E4, Control switches and indicator lights; (**b**) Physical picture of the hardware; (**c**) Diagram of the Electric Control Circuit Design; (**d**) Android App for Smartphones.

#### *2.4. Field Test Design*

Fresh soil samples were manually collected at a depth of 0–25 cm from a demonstration summer corn planting farm (70 L <sup>×</sup> 24 W m2) from April 30 to Aug 31, 2016 (40◦8 37" N, 116◦11 31" E). Soil sampling information is shown in Figure 2. The cornfield was divided into 12 fertility zones with a varied N application rate from 0 to 3 N, where 1 N equals the application of 375 kg/ha of compound fertilizer (Total content ≥ 40%, N:P2O5:K2O, 28%:6%:6%, Shidanli Co. Ltd., Shandong, China) and 75 kg/ha of urea; <sup>1</sup> <sup>2</sup> N represents half of the 1 N rate; 0 N means no fertility; and 3 N means triple the rate. A total of 11 groups of soil samples were collected. Raw soil samples, detected in the field by the self-designed bench without moisture compensation, were recorded as ISEraw. ISE results, provided by the self-designed detection bench by the sensor fusion model, were recorded as ISEOS. Laboratory ISE soil testing results were labeled ISELT, in which soil samples was treated with conventional soil pretreatments. Soil samples measured by the standard UV-VIS spectrometer were provided by the soil testing center of China's Agricultural University. The nitrate–nitrogen content was recorded to be StandSpec.

(a)

<sup>(</sup>b)

Forty-two sets of raw samples, labeled as Dm, with broader time variance, were randomly sampled in the field from April 30 to August 31. The Dm testing group was used to evaluate the performance of the designed sensor fusion model. Differences among StandSpec, ISEraw, ISEOS, and ISELT were compared. The evaluation results are illustrated as Figure 3.

**Figure 3.** Comparison of soil NO3 <sup>−</sup>-N predicted with ISEraw, ISEOS, and ISE.

As demonstrated in Figure 2a, three sampling positions were marked with the plus cross icon in each of the 12 zones. One representative soil sample per zone was obtained by thoroughly mixing these three cores. A total number of 108 sets of fresh soil samples were collected for 42 days, which covered the summer corn growth stages from trifoliate to silking. The first 12 samples were collected on May 30, which were labeled as group D1. Then, the 7 continuous groups of samples, marked D2–D8, were obtained from June 5 until July 2, commonly at intervals of 3 days. The last group of soil samples (D9) was collected on July 11. Soil samples were applied to validate the feasibility of the on-site NO3 −-N testing system.

The soil properties provided by the standard testing center are summarized in Table 1.


<sup>1</sup> Soil Total-N, Available-P, Organic Matter, and Available-K were tested in two groups of soil samples. Dm was 42 soil samples evaluated using the sensor fusion model. D1 was 12 samples used for the evaluation of the on-site bench. Detection was not conducted in D2–D9, because these soil properties were considered to be stable during the same corn growth season.

#### **3. Results and Discussion**

#### *3.1. Validation of the Sensor Fusion Model*

The sensor fusion compensation model, described in Equations (1)–(3), was evaluated with 42 soil samples, as demonstrated in Figure 3. The soil testing results of ISEraw were, on average, 46.8% smaller than StandSpec. The maximum deviation was calculated as 44.8 mg/L. ISEOS and ISELT demonstrated a good correlation with the standard spectrometric results. Absolute error values of 0.2–17.2 and 0–9.8 mg/L were obtained, respectively. The measurement accuracy of ISEOS was increased by more than 50% compared with that of ISEraw. The soil moisture compensation model eliminated the testing error.

#### *3.2. Evaluation of the On-Site Soil NO3* −*-N Detection*

Soil NO3 −-N detection results were compared among three different methods—standard spectrometric results, laboratory ISE testing, and on-site ISE based monitoring—as shown in Table 2. The testing efficiency was also evaluated. The time duration and the labor force consumed for dealing with a dozen soil samples were compared among UV-VIS, ISEOS, and ISELT. The results are summarized in Table 3.


**Table 2.** Statistical analysis of the linear regression fitting results.

\* represents that the linear fitting model is significant.

**Table 3.** Comparison of the testing duration and labor force among StandSpec, ISEOS, and ISELT.


<sup>1</sup> Soil samples detected by StandSpec and ISELT should be pretreated according to the soil testing recommendations. The shaking time required is 20 min. The optimal stabilization time is 20 min.; Soil samples detected by ISEOS did not undergo quantitative weighting. Fresh soil samples were first weighed after moisture measurement. A peristaltic pump was used for extractant injection. The extractant injection rate was 36 s/sample. The stirring process was used for 40 s/sample. The centrifuge filtration rate was 40 s/12 samples. A stable ISE reading was obtained when the variation of EMF less was than ±1 mV. The ISE detection rate was 4–5 min/sample. <sup>2</sup> Time used for processing 12 soil samples.

As illustrated in Table 2, the linear regression fitting results of ISEOS, ISELT, and UV-VIS were *yUV-VIS* = 1.02*ISEOS* − 0.57, *yUV-VIS* = 0.98*ISELT* − 0.71. Both linear fitting curves were close to the 1:1 line. The ISE detection accuracy demonstrated a slight variation with the change in soil NO3 −-N content. The accuracy was derived as ±30%, ±16% and 5% (Full Scale, FS) at the NO3 −-N content ranges of 0–30, 31–90, and 91–200 mg/L, respectively. The maximum error (with the possibility of <sup>±</sup>90%) was less than 10 mg/L. The intersection was close to 1. Adj. R2 values were both 0.98. The ISE results demonstrated close consistency with UV-VIS. The absolute error values among ISEOS, ISELT, and UV-VIS were calculated to be 0.1–19.9 and 0.0–18.4 mg/L with average values of 4.7 and 4.0 mg·L<sup>−</sup>1, respectively. The RMSEs were found to be 6.1 and 5.5 mg/L. No significant difference was found between the results of ISEOS and ISELT.

The ISEOS demonstrated obvious advantages in terms of the testing efficiency and labor force intensity, as shown in Table 3. Compared with the conventional soil pretreatment protocols conducted before UV-VIS and ISELT, the self-designed on-site detection bench was decreased by 45 mins. The total time consumption was reduced to 40% of the duration of the conventional spectrometry method.

Integrated with the multi-sensor, centrifuge filtration, and programmable fluidic control, the self-designed on-site soil NO3 −-N detection bench produced a reliable result with an efficient operation, which demonstrated a promising perspective for the infield monitoring applications.

#### *3.3. NO3* −*-N Variation Monitoring*

Based on the workbench, the on-site NO3 −-N variation was monitored from the trifoliate stage to the silking stage of summer corn. Samples collected from three 1N zones were selected to demonstrate the NO3 <sup>−</sup>-N content change with corn growth, as shown in Figure 4. The NO3 −-N content was at a level of around 70–100 mg/L at the beginning of D1. NO3 −-N demonstrated great variation in characteristics with time and at different sample sites. However, an obvious NO3 −-N decrease occurred uniformly at an amplitude of 80 mg/L across all three testing sites from D6 to D7. According to the definition of corn growth, D6 was the VT period and D7 was in the R1 period, as shown in Figure 2b. The monitoring results perfectly fit the nitrogen growth law of corn. After that growth stage, no clear nitrogen absorption was verified. The NO3 −-N content stayed at the level of 13.2–17.0 mg/L.

**Figure 4.** Monitoring of NO3 −-N Variation by the On-site detection Bench.

#### **4. Conclusions**

In this paper, a self-designed prototype system for on-site soil NO3 −-N detection based on ISE was designed and tested. Sensor fusion of ISE and a moisture sensor effectively eliminated 50% of the testing error. The performance of the on-site soil NO3 −-N system demonstrated good consistency with the UV-VIS testing and laboratory ISE testing methods. Compared with the UV-VIS method, the average absolute error was determined to be 4.7 mg·L−1. The RMSE was found to be 6.1 mg/L. In addition, the detection duration decreased to 40% of that of the spectrometric method.

**Author Contributions:** Conceptualization, Y.L. and M.Z.; Methodology, Y.L. and M.Z.; Software, Y.L. and Q.Y.; Validation, Y.L., Q.Y. and M.C.; Formal Analysis, Y.L. and M.Z.; Investigation, Y.L. and M.Z.; Resources, M.W. and M.Z.; Data Curation, Y.L. and M.Z.; Writing—Original Draft Preparation, Y.L. and M.Z.; Writing—Review & Editing, Y.L. and M.Z.; Visualization, Y.L. and Q.Y.; Supervision, M.Z.; Project Administration, M.W. and M.Z.; Funding Acquisition, M.W. and M.Z.

**Funding:** This research was financially supported by the National Key Research and Development Program (Grant No. 2016YFD0700300-2016YFD0700304 & 2016YFD0800900-2016YFD0800907) and Key Laboratory of Technology Integration and Application in Agricultural Internet of Things, Ministry of Agriculture, P. R. China (2016KL03).

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Simplifying Sample Preparation for Soil Fertility Analysis by X-ray Fluorescence Spectrometry** †

**Tiago Rodrigues Tavares 1, Lidiane Cristina Nunes 2, Elton Eduardo Novais Alves 3, Eduardo de Almeida 4, Leonardo Felipe Maldaner 1, Francisco José Krug 2, Hudson Wallace Pereira de Carvalho <sup>4</sup> and José Paulo Molin 1,\***


Received: 26 August 2019; Accepted: 15 November 2019; Published: 20 November 2019

**Abstract:** Portable X-ray fluorescence (pXRF) sensors allow one to collect digital data in a practical and environmentally friendly way, as a complementary method to traditional laboratory analyses. This work aimed to assess the performance of a pXRF sensor to predict exchangeable nutrients in soil samples by using two contrasting strategies of sample preparation: pressed pellets and loose powder (<2 mm). Pellets were prepared using soil and a cellulose binder at 10% w w−<sup>1</sup> followed by grinding for 20 min. Sample homogeneity was probed by X-ray fluorescence microanalysis. Exchangeable nutrients were assessed by pXRF furnished with a Rh X-ray tube and silicon drift detector. The calibration models were obtained using 58 soil samples and leave-one-out cross-validation. The predictive capabilities of the models were appropriate for both exchangeable K (ex-K) and Ca (ex-Ca) determinations with R2 ≥ 0.76 and RPIQ > 2.5. Although XRF analysis of pressed pellets allowed a slight gain in performance over loose powder samples for the prediction of ex-K and ex-Ca, satisfactory performances were also obtained with loose powders, which require minimal sample preparation. The prediction models with local samples showed promising results and encourage more detailed investigations for the application of pXRF in tropical soils.

**Keywords:** precision agriculture; X-ray fluorescence; spectroscopy; soil nutrients; proximal soil sensing; soil testing

#### **1. Introduction**

Brazil is the fourth largest consumer of fertilizers in the world [1] due to the predominance of acidic and low fertility tropical soils. Thus, the diagnosis of soil fertility is crucial for the correct management of fertilizers and limestone in crops. Per year, it is estimated that about 1 million soil tests are carried out by Brazilian fertility analysis laboratories. There is an expectation of increasing this number, due to the expansion of agricultural areas [2], as well as the adoption of soil mapping techniques for precision agriculture (PA) practices, which demand information in a high spatial and temporal density [3]. In addition, as commented by Demattê et al. [2], traditional soil analyses face other challenges related to the time required for performing the laboratory measurements (about 3 to 15 days), and also the hazardous reagents still used in some tests (e.g., dichromate and sulfuric acid).

The establishment of a robust method for the direct analysis of soils using sensing techniques—allowing farmers and laboratories to increase the number of analyses in a practical and clean way, without relying exclusively on traditional fertility soil tests—is a current need in Brazil and all over the world [3]. This task is a great multidisciplinary challenge for the researchers involved [4]. Hence, discussions have recently begun between academics [2] and companies for the development of hybrid laboratories. The term hybrid refers to labs, where analyses performed by sensor systems are used in combination with the traditional methods, allowing one to use the sensing techniques to predict some soil attributes. Hybrid laboratories are compatible with controlled-environment and on-field analyses (e.g., using a mobile soil-testing lab [5]). This is an interesting strategy, which should boost worldwide research in the coming years to seek the best set of sensors compatible with direct analysis of soils, as well as the best strategy for calibration of the predictive models.

X-ray fluorescence (XRF) is a spectroanalytical technique compatible with direct soil analysis, which can be applied with minimal or no sample preparation [6]. The recent technological advance of the optical and electronic components allowed the development and miniaturization of this technology, and it has become attractive for use in hybrid laboratories and in situ analyses. Some studies have already pointed out the potential of using XRF sensors in proximal soil sensing (PSS) approaches [7,8]. Despite that, XRF has been poorly explored for assessments of physical and chemical attributes of tropical soils, mainly under the context of PSS and PA.

To use XRF sensors as a practical analytical method in hybrid laboratories—in order to ensure a massive increase in the number of samples analyzed—it should be compatible with a simple soil sample preparation (e.g., just air-dried and sieved rapidly). Recent studies involving XRF sensors for practical analysis of soil attributes have used dried samples with particle sizes smaller than 2 mm [8–11]. It is a consensus that pellet preparation after grinding the soil allows one to explore the potential of the XRF technique in soil analysis [12]. The preparation of a pellet is recommended for analyses with the XRF technique because it improves the homogeneity of the material and also allows one to control the density, porosity and surface roughness characteristics, reducing the physical matrix effects [13]. Although it is known that the preparation of pellets guarantees better precision in the measurements performed with the XRF [14,15], recent studies have assumed that, when analyzing soil samples with particle sizes smaller than 2 mm, its heterogeneity and physical matrix effects can be neglected.

XRF analyses are more flexible with regards to sample preparation because—unlike other elemental analysis techniques, such as laser induced breakdown spectroscopy (LIBS)—they also allow one to evaluate loose powder [14]. However, we did not find any study comparing XRF performance for the prediction of fertility attributes on soil samples that were just dried and sieved (<2 mm) with samples prepared with the optimal sample preparation method. Therefore, the level of performance loss when neglecting the physical matrix effect and heterogeneity is unknown. For a robust development of the XRF technique as a practical tool for soil fertility analysis, one of the key points is to understand the tradeoff between analytical performance and sample preparation, in order to reduce or eliminate these procedures based on the analytical potential of the sensor for each sample condition. Such knowledge is important for the development of PSS applications using this tool.

To evaluate the possibility of simplifying the sample preparation procedure for XRF analyses, this work aimed to assess the performance of a portable XRF (pXRF) to predict exchangeable nutrients in soil samples prepared using two contrasting types of sample preparation: pellets and loose powder (≤2 mm). The effect of sample preparation in the spatial distribution of nutrients on the sample surface was evaluated using a benchtop microprobe X-ray fluorescence spectrometry (μ-XRF). Moreover, a procedure for preparation of soil pellets, involving planetary ball milling and the use of binding agents was also assessed.

#### **2. Material and Methods**

#### *2.1. Soil Samples*

A set of 58 soil samples were selected for the comparison of their exchangeable nutrients content with the X-ray fluorescence produced by the pellet and loose powder samples. These samples were collected from 0 to 0.2 m soil depth in an agricultural field located at the southeast region of Brazil, in the municipality of Piracicaba, state of São Paulo (at coordinates 22◦41 57.24" S and 47◦38 33.33" W, WGS84 datum). The soil is classified as Lixisol [16] with a clayey texture and high nutrient variability.

The soil samples were air-dried and sieved (<2 mm) and after that, three subsamples were separated: (i) 0.8 g was used for pelletizing, (ii) 10 g was analysed as loose powder, and (iii) about 30 g was used for the reference measurements.

#### *2.2. Sample Preparation*

For pelletizing, the samples (particles < 2 mm) were initially dried at 105 ◦C for 24 h and thereafter ground in a planetary ball mill (Retsch model PM 200 mill, Germany) (Figure 1A) by using two grinding tungsten carbide jars (50 mL; Retsch, Germany) with 10 tungsten carbide balls (10 mm diameter) (Figure 1B). Grinding was performed at 400 rpm for 5 min clockwise/5 min counter clockwise with a 10-s stop before changing the rotation direction.

**Figure 1.** Planetary ball mill (**A**), loose soil inside the tungsten carbide jars with the tungsten carbide balls (**B**) and hydraulic press (**C**), which were used at work.

Preliminary experiments were carried out by just pressing the soil samples without a binder. It was observed that for the sandier sample (clay content of 175 g dm−3) the resulting pellets were friable and easily crumbled (Figure 2A). Therefore, binder addition was decisive for improving the quality of the pellets. The binders tested were chosen based on their similarity to the analytical blank, i.e., lower analyte mass fractions of elements evaluated in the soil fertility (e.g., P, K, Ca, and Mg). In this case, binding agents, such as a microcrystalline cellulose powder (Sigma-Aldrich, Merck, Darmstadt, Germany), and cellulose (SPEX 3642, Metuchen, NJ, USA) were evaluated in the proportion of 10 and 15% w w<sup>−</sup>1, with grinding/homogenization times of 10, 15, and 20 min.

**Figure 2.** Soil samples without the addition of binder and with different grinding times (**A**); pellets resulting from tests with different grinding times, cellulose concentrations and brands (**B**).

The grinding and homogenized samples were pelletized in a hydraulic press (SPEX 3624B X-Press) (Figure 1C) by transferring 0.8 g of the powdered material to a stainless steel set and applying 8.0 t cm−<sup>2</sup> for 3 min. Cylindrical pellets were approximately 15 mm diameter and 2 mm thick, with mass per unit area of 0.45 g cm<sup>−</sup>2. The pellets were visually inspected, evaluating their homogeneity aspect and integrity. Furthermore, an XRF spectra (obtained with pXRF, as described in Section 2.5) of a pellet and a loose soil sample were also compared in order to assess possible contamination during the milling process. Further experiments were performed with 10% w w−<sup>1</sup> cellulose binder (Sigma-Aldrich, Merck, Darmstadt, Germany) and 20 min of grinding in a planetary ball mill.

Sample presentation in the form of loose powder was also considered for the analysis. The air-dried samples were sieved in a sieve with apertures of 2 mm. Ten grams of test sample was transferred to an XRF polyethylene cup of 31 mm (n. 1530, Chemplex Industries Inc., Palm City, FL, USA) assembled with a 4-μm thick polypropylene film (n. 3520, SPEX, USA).

#### *2.3. Soil Laboratory Analysis*

Soil testing conducted by a commercial laboratory determined the exchangeable (ex-) contents of P, K, Ca and Mg via ion exchange resin extraction. Clay content was quantified by the Bouyoucos hydrometer method in dispersing solution. The pseudo total content (ptc) of P, K, Ca and Mg were also analyzed following the USEPA Method 3051A [17]. The latter methods involve the extraction of ions using HNO3 and HCl. The multielement quantification was made by inductively-coupled plasma optical emission spectrometry (ICP OES). The term ptc is used, because it is not a total digestion method. Despite this, this method presents proportional recoveries to the most aggressive methods for the determination of elements in tropical soils [18], allowing one to understand the relationship between exchangeable and total content of the elements evaluated. In addition, it is a method that requires less time for digestion, less consumption of acids and lower risks of environmental contamination [19].

#### *2.4.* μ*-XRF Chemical Images*

μ-XRF is a type of energy dispersive X-ray fluorescence that employs a micrometric beam with a shape and size defined by a primary optic element; this can be done by a simple collimator, an optical capillary or a focusing mirror [20,21]. In this work, the μ-XRF technique was employed to characterize, on the sample surface, the influence of the sample preparation method on the spatial distribution of elements of interest.

The net intensities for K and Ca Kα emission lines were characterized with high spatial resolution on the surface of loose soil and pellet samples. A benchtop μ-XRF system (Orbis PC EDAX, United States) furnished with a Rh anode X-ray tube was used. The detection was carried out by a 30 mm<sup>2</sup> silicon drift detector (SDD). The μ-XRF tube current and voltage was operated at 15 kV and 200 μA, respectively; the beam size used was 30 μm and no primary filter was used; the live time was set to 2 s per spot; and the analysis was carried out under vacuum. In each sample, 800 points (matrix of 32 × 25 points) were evaluated in an area of about 2.32 mm<sup>2</sup> (1.60 <sup>×</sup> 1.45 mm).

Chemical images showing the variability of K and Ca, produced by Orbis Vision software, were linearly interpolated using Origin Lab 2016. The mean, maximum and minimum values, as well as the coefficient of variation (CV)—the ratio between the standard deviation and the mean expressed in percentage—were also calculated. P and Mg Kα emission lines were not identified in the samples, which did not allow the evaluation of these element lines. Similar μ-XRF analysis procedures are described by Rodrigues et al. [21].

#### *2.5. pXRF Measurements and Its Performance Evaluation*

The measurements were carried out using a portable X-ray fluorescence spectrometer (portable ED-XRF), Tracer III–SD model (Bruker AXS, Madison, USA), equipped with a 4 W Rh X-ray tube and 12 mm2 of active area, and a X-Flash®Peltier-cooled SDD, with 2048 channels (Bruker AXS, Madison, USA). The tube operated at 23 μA and 15 kV, and emission intensities were measured for 90 s without vacuum. The voltage configuration was chosen based on the interest in low atomic number elements and the current, in order to keep deadtime below 15%, and avoiding spectral distortions and artifacts. Soil samples were measured in triplicate at different portions of its surface. To ensure the same attenuation conditions of the loose soil samples, the pellets were placed on a 4-μm-thick polypropylene thin-film.

All data were acquired using the software Bruker S1PXRF®(Bruker AXS, Madison, USA). The data were obtained through the deconvolution process using the Artax®(Bruker AXS, Madison, USA). The Kα emission characteristic lines of the elements P, K, Ca and Mg were evaluated. However, only K and Ca presented detectable emission lines, which were evaluated by their signal-to-noise ratio (SNR) and intensity, through the counts of photons per second (cps). The SNR was determined by dividing the characteristic X-ray net intensities by the background square root [22], and the cps were obtained by the ratio of total X-ray intensity to detector live time. The standard deviation (SD) behavior of the intensity of the K and Ca Kα emission lines within the replicates was also evaluated for both sample preparations.

The intensity of K and Ca Kα emission lines, obtained from pellets and loose soil samples, were compared with the exchangeable contents of these nutrients. Calibration models were built using simple linear regressions (a univariate model), with the independent variable being pXRF data and the dependent variable being the soil property measured via commercial laboratory procedures. The prediction models were validated using "leave-one-out" full cross-validation. The quality of the developed calibration was assessed with the coefficient of determination (R2), the root mean square error (RMSE) and the ratio of performance to interquartile range (RPIQ), as recommended by Bellon-Maurel et al. [23]. Arbitrary groups were used for simplification of interpretation, as proposed by Nawar and Mouazen [24]: (1) excellent models (RPIQ > 2.5), (2) very good models (2.5 > RPIQ > 2.0), (3) good model (2.0 > RPIQ > 1.7), fair (1.7 > RPIQ > 1.4), and very poor model (RPIQ < 1.4). The descriptive statistics of soil fertility and the correlation between pseudo total and exchangeable contents were also determined.

#### **3. Results**

#### *3.1. Soil Pelletizing Procedure*

The pelletizing of sandy soil samples (e.g., about 175 g dm−<sup>3</sup> of clay content) was only possible with the addition of binder. In the initial tests, which evaluated different grinding times, they did not form pellets without the addition of binder (Figure 2A). In general, pellets produced after 10 and 15 min of grinding were brittle, except for pellets containing 15% w w−<sup>1</sup> of binder (Figure 2B), which, in turn, were less homogeneous with white spots on their surface. The best cohesion between particles was obtained with 20 min of grinding. For this milling time, the pellet with 15% w w−<sup>1</sup> of binder was slightly less heterogeneous than the pellet with 10% w w<sup>−</sup>1. In relation to the brand, microcrystalline cellulose powder (Sigma-Aldrich, Merck, Darmstadt, Germany) presented more cohesive pellets. The best results were observed for pressed pellets prepared from soil mixed with cellulose binder at 10% w w−<sup>1</sup> and ground for 20 min.

Tungsten (W) contamination was observed in these ground soil samples. This contamination was caused by the tungsten carbide ball mill and it was evidenced by the W L-emission lines presented in the pellet spectrum, which were not observed in the loose soil spectrum (Figure 3). In the XRF spectra, W presents L and M-emission lines with energy lower than 15 keV, as highlighted in the red lines in the spectrum of Figure 3. In this range, the main W emission lines present energy of 1.77 (Mα), 1.83 (Mβ), 8.39 (Lα), 9.67 (Lβ1) and 9.95 keV (Lβ2). The effect of this contamination is best seen on L-emission lines, as they do not overlap with any other emission lines present. The W M-α line overlaps with Si (1.74 keV) and can also promote the enhancement of the Al Kα line (Al K edge = 1.55 keV) due to secondary radiation excitation (chemical matrix effect). Thus, this W interference must be considered and corrected in the case of Al quantification. For the Ca and K determinations performed in this work, contamination with W was not a limiting factor.

**Figure 3.** X-ray fluorescence spectra obtained with pXRF equipment using the pellet and loose soil sample. Tungsten (W) emission lines were identified with red lines. The emission spectra intensity is shown in the logarithm to reduce the differences in scales between the emission lines, allowing a better qualitative assessment.

#### *3.2.* μ*-XRF Chemical Images and Sample Homogeneity*

The spatial distribution patterns of Ca and K at the pellet and loose soil surface are shown in Figure 4. For both elements, the preparation of pellets resulted in more homogeneous surfaces than those observed for loose soil. The particle size reduction—required for pellet production—allows one to homogenize the distribution of the different elements in the sample, which occurs because it fragments the regions where these elements are agglomerated (nuggets). In the loose soil sample, the presence of nuggets can be observed for the Ca and K (Figure 4B,C, respectively), which do not appear in the pelletized samples. The homogenization promoted by pelletizing drastically reduced the CV of both Kα emission line intensities, oscillating from 100.17% to 13.03% for Ca and from 46.09% to 18.01% for K, respectively.

**Figure 4.** μ-XRF chemical images showing the spatial distribution of Ca and K in the loose soil (**B** and **C**, respectively); Ca and K in the pellet (**E** and **F**, respectively). Photo of the analyzed area of (**A**); the loose soil (**A**) and pellet (**D**).

#### *3.3. Soil Exchangeable Nutrient Prediction Using a pXRF Spectrometer*

Soil samples were characterized by clayey texture, low variability of clay content (between 345 and 511 g dm−3) and high variability of exchangeable nutrients. According to the local fertility interpretation [25], the level of ex-P content oscillates between low to medium; and the level of ex-K, ex-Ca and ex-Mg content varies between medium to very high. These samples are also characterized by a significant correlation between available and pseudo total contents for all nutrients. A descriptive summary of these analyses is presented in Table 1.

The qualitative evaluation of the XRF spectra (Figure 3) allowed us to identify the K and Ca emission lines, but no fluorescence emission was detected for Mg and P. The XRF intensity and the SNR of K and Ca were slightly higher for loose soil than pellet samples, and both had a highly significant correlation (r > 0.9) between pellet and loose soil, indicating that the changes promoted by sample preparation were well standardized for all samples (Figure 5). Despite the small gain in fluorescence intensity (an average of 4.21 and 15.31 cps for K and Ca, respectively) and in SNR (an average of 0.63 and 2.49 for K and Ca, respectively), when evaluating the behavior of the emission line intensity SD for the replicates, we can observe that the loose soil samples presented greater variation in relation to the pellets, both for K and Ca (Figure 5E,F, respectively). The replicate SD is an indicator of the

reading precision. In this work, the lower precision of the loose soil samples might be related to their lower homogeneity in relation to the pelletized ones. Despite this loss of precision among the different replicates obtained in loose soil samples, the triplicate scans smoothed this effect. After averaging the replicates, the distribution of the XRF intensity showed a similar distribution between both sample preparations (Figure 5A,B).

**Table 1.** Descriptive statistics of exchangeable and pseudo total nutrients and the correlation between the respective nutrients.


\* Significant correlation at the probability level of 0.01.


**Figure 5.** Box plot of the Kα emission line intensity of K and Ca (**A** and **B**, respectively), after averaging the replicates. Box plot of the signal-to-noise ratio (SNR) of the Kα emission lines of K and Ca (**C** and **D**, respectively), after averaging the replicates. Box plot of the standard deviation (SD) of the Kα emission line intensity of K and Ca (**E** and **F**, respectively) for the replicates. The Pearson correlation between the pellet and loose soil is also presented (correlations followed by \* were significant at the probability level of 0.01; correlations followed by ns were not significant).

Regarding the regression analysis, there was a slight reduction of precision in the calibration of ex-K and ex-Ca in loose powder soil samples, marked by a slight increase in error and reduction in R<sup>2</sup> (Figure 6). Comparing the loose soil samples in relation to the pellet samples, the prediction error of ex-K increased from 0.65 to 0.78 mmolc dm<sup>−</sup>3. Similarly, for the ex-Ca prediction, the error increased from 5.89 to 6.12 mmolc dm<sup>−</sup>3. Moreover, concerning the R2 values, it oscillated from 0.87 to 0.81 for ex-K, and from 0.78 to 0.76 for ex-Ca. Besides that, all prediction models, obtained from both pellet and loose soil, showed excellent performance in their validation with RPIQ values above 2.5.

**Figure 6.** Scatter plots of measured versus predicted ex-K, for the pellets and loose soil (**A** and **B**, respectively), and of measured versus predicted ex-Ca, for the pellets and loose soil (**C** and **D**, respectively). Models were obtained using simple linear regressions with the Kα emission lines of each element (n = 58) and the validation was performed by "leave-one-out" full cross-validation.

#### **4. Discussion**

Although the XRF technique measures the total content of elements present in the soil, these sensors have been suggested as an auxiliary technique for evaluating fertility attributes [8–10]. In addition, interest in such equipment has recently increased due to its portability, enabling on-field studies [7] and in controlled environments such as hybrid laboratories [2,11]. Such applications are only compatible with minimal or no sample preparation.

Even if the XRF technique is flexible concerning sample preparation, there is a consensus that pellet preparation increases the data precision [15]. Pellet preparation consists of conforming and binding the samples into a specific shape. For pellet formation, the soil samples must be grinded to an extremely fine powder by using a grinder; furthermore, a proper binding agent can also be necessary [26]. In this work, a procedure for soil pellet preparation was evaluated, with and without binding agents. Sandy soils are more likely to not form pellets without the use of a binder [12]. In our work, it was perceived for samples with clay content around 175 g dm<sup>−</sup>3. During testing for optimizing binder concentration and ball milling time, it was observed that increasing the grinding time, as well as the binder concentration, improves the cohesion between the particles of the pellet. In contrast, higher concentrations of binder (e.g., 15% w w<sup>−</sup>1, in this work) make it difficult to homogenize it. It is known that the smaller the particle size to be pressurized is, the more resistant and cohesive the pellet will be [27]. However, pellet preparation in different soil sample sets can be optimized with different binder concentrations and milling time. To optimize these conditions, we suggest conducting preliminary tests, as described in this paper.

The reduction of the particle size, before pressing the material, promotes sample homogenization [26]. Both the element spatial patterns and the SD behavior on the replicates, clearly showed gain on homogeneity after pelletizing. The lower homogeneity of loose soil samples should be considered for determining the number of replicates during data acquisition with a pXRF device. Due to the high variability of element distribution in loose soil samples, a greater number of scans has to be acquired for more accurate representation of the sample surface, and then, different spectra can be averaged [12]. In this work, pXRF spectra were obtained in triplicate (at different positions) and were sufficient for a good characterization of both sample preparation samples.

One point to consider while milling samples is the possibility of contamination. Two types of contamination can occur, cross-contamination, due to inefficient cleaning when changing samples, and/or contamination with milling surfaces (e.g., agate and tungsten carbide), due to the abrasion between the sample and mill components. In addition to the careful execution of cleaning procedures, the milling surfaces should be considered in terms of hardness and elemental composition to avoid the risk of sample contamination [12]. In this work, the grinding in a ball mill made of tungsten carbide contaminated the samples with W. Soil samples usually have hard minerals, like silicates, and W should not be measured when tungsten carbide milling jars and balls are used for milling soil [28]. Specifically, in XRF analysis, W contamination can also be a problem for the determination of Si and Al, as described in the previous section. Iwansson and Landström [29] showed that this kind of contamination is higher in quartz-rich samples and increases with grinding time. When the element contamination (e.g., W) is the same one that is to be quantified, the values must be adjusted, discarded, or over-looked to avoid misinterpretation of the results [29].

Pelletizing also reduces surface roughness effects and increases the density of the material [26]. Theoretically, reducing sample roughness means decreasing the physical matrix effect, which would attenuate part of the fluorescence produced by the analytes, and increasing the density of samples and fluorescence intensity [14]. Thus, a higher fluorescence yield and an upsurge in the SNR were expected for the emission lines of the pelletized samples, due to the increase of their density and reduction of the physical matrix effect [13]. Nevertheless, this behavior was not observed in this work. In turn, the addition of binder (10% w w<sup>−</sup>1), as well as the contamination by W, and the differences in homogeneity found (Figure 4B,E), appear to be the factors that influenced this behavior, slightly altering the chemical composition of the pellet samples and, consequently, their fluorescence production.

Soil samples are naturally heterogeneous and therefore comminution procedures are generally recommended for improving matrix homogenization, and should yield homogeneous pellets [26]. Ultimately, this can avoid heterogeneity effects, such as grain size effect, mineralogical effect, and segregation, factors that cause errors in the XRF analysis [30]. However, in this work, the prediction models of ex-Ca and ex-K using pellets showed just a small performance gain over those obtained in loose powder soil samples. Using loose powder soil, prediction models for ex-Ca and ex-K calibrated with the 58 local samples obtained excellent performances, with RPIQ values over 2.5. These results are promising and encourage more detailed investigations on the application of the XRF technique. They even lead us to new questions such as: (i) how long will this calibration remain robust over different cropping seasons? (ii) is it possible to further reduce sample preparation without losing analytical quality? (iii) what would be the analytical performance in samples with field conditions (e.g., with different humidity and particle size patterns)? (iv) how to determine fields where the XRF sensor will have potential as an auxiliary tool alongside traditional fertility analysis methods?

Different works on temperate soils have shown good performance in predicting fertility attributes such as pH [9], cation exchange capacity (CEC) [10], base saturation (V%) [31], soil texture [32] and total content of different elements [8,11]. In Brazilian tropical soils, satisfactory performances have already been obtained for predictions of organic carbon and organic matter [33] and textural attributes [34]. Although, so far, the prediction of available nutrients has not been explored. The possibility of XRF application on soil samples that have just been dried and sieved (<2 mm), with satisfactory predictions of ex-K and ex-Ca using local models, is a promising alternative to increasing the efficiency of analytical

procedures. This may intensify the amount of analysis in tropical soil samples without the need for wet chemistry methods. In addition, this level of sample preparation is compatible with evaluations using vis-NIR diffuse reflectance, opening the potential to exploit joint XRF and vis-NIR sensors on these types of samples. Moreover, the vis-NIR technique has great potential for obtaining information about texture, and organic and mineralogical components, which can synergistically complement the XRF information for a more complete characterization of the attributes of soil fertility [11].

A simple calibration method was applied in this work, using only the emission line of the elements of interest for predictive modeling. XRF spectra are multi-informational, allowing the measurement of several soil properties from a single scan. This is possible because each spectrum stores a large amount of information along with its emission lines and different types of scattering (e.g., Compton and Thomson scattering), not strictly related to the elementary constituents of the samples. An example is the prediction of organic carbon and organic matter in soil samples using the information contained in the scattering region of the spectra, as explored by Morona et al. [33]. In this sense, predictive modeling based on multivariate statistics and machine learning methods are an alternative to better exploit the hidden information present in XRF spectra [35], and it can enable robust determinations of fertility attributes that have an indirect relationship with inorganic soil constituents such as pH, CEC, V% and texture.

The evaluation of Mg and P using the XRF technique is challenging as they are light elements that produce fluorescence emission at low energy levels (between 1.2 and 2.2 keV) that are absorbed by atmospheric gases (N2, O2, and Ar) before reaching the detector. The maximum pseudo total content (Table 1) of P (670 mg kg<sup>−</sup>1) and Mg (790 mg kg−1) in our samples was not enough to produce X-ray fluorescence intensities detectable by the equipment. Therefore, even if there is a correlation between their pseudo total and available contents, direct calibrations for ex-P and ex-Mg (made with their own emission lines) have not been possible using the XRF spectra so far. However, this does not preclude an attempt of indirect calibrations, using other information present in the spectrum. Furthermore, the determination of these elements can be improved by using a vacuum system and changing the X-ray tube conditions to lower voltage (<10 keV) and increasing the current (10 to 15% of deadtime), which reduces air attenuation over Mg and P emission lines, and increases the fluorescence yield of these chemical elements. Some portable XRF equipment already allows the use of this condition and future work should be done to evaluate the use of a vacuum to improve the detection of light elements in soil samples to predict fertility attributes.

In addition, this study was conducted under a clayey lixisol, which is a representative and common type of soil in Brazilian tropical areas [36]. Therefore, this pioneering evaluation provided useful information to help XRF users—who aim to use this technique as a tool for practical soil analysis—to understand that the expected effects of sample preparation related to heterogeneity and physical matrix effects can be neglected. However, it is fundamental to also validate other types of soils with contrasting textural classes, which can proportionate distinct levels of physical matrix effects.

#### **5. Conclusions**

The addition of a binder was decisive for improving the quality of the pellets. The best results for soil preparation in the form of pellets were obtained with samples prepared with cellulose binder at 10% w w−<sup>1</sup> and ground for 20 min.

Pressed pellets allowed a slight gain in performance over loose powder samples for the prediction of ex-K and ex-Ca. In spite of that, predictions in loose powder soil for ex-Ca and ex-K, calibrated with 58 local samples, obtained excellent performances in their validation, showing that it is possible to reduce the optimal sample preparation of XRF analyses for predicting soil nutrients. However, loose samples are less homogenous than pellets, and scanning loose soil samples in replicates is important for smoothing this effect.

The prediction models of ex-K and ex-Ca calibrated with local samples presented promising results. More detailed investigations are necessary to foster the application of the XRF technique in agricultural soil samples for determination of soil fertility attributes. Finally, XRF can serve as a complementary method to traditional laboratory analyses.

**Author Contributions:** Conceptualization, T.R.T., L.C.N. and J.P.M.; methodology, T.R.T., L.C.N., E.E.N.A., E.d.A., and H.W.P.d.C.; validation, L.C.N., E.E.N.A. and J.P.M.; formal analysis, T.R.T., L.C.N. and E.E.N.A.; investigation, T.R.T.; resources, T.R.T.; data curation, T.R.T. and L.F.M.; writing—original draft preparation, T.R.T.; writing—review and editing, L.C.N., E.E.N.A., E.d.A., H.W.P.d.C. and J.P.M.; visualization, T.R.T. and L.F.M.; supervision, H.W.P.d.C., F.J.K. and J.P.M.; project administration, T.R.T. and J.P.M.; funding acquisition, T.R.T., J.P.M. and H.W.P.d.C.

**Funding:** The T.R.T. and E.E.N.A. were funded by São Paulo Research Foundation (FAPESP), grant number 2017/21969-0 and 2018/08877-2, respectively; and also partial funded by the Brazilian Federal Agencies: Coordination for the Improvement of Higher Education Personnel (CAPES) – Finance Code 001, and the National Council for Scientific and Technological Development. (CNPq). XRF facilities were funded by FAPESP, grant 2015-19121-8, and "Financiadora de Estudos e Projetos" (FINEP) project "Core Facility de suportes às pesquisas em Nutrologia e Segurança Alimentar na USP", grant 01.12.0535.0.

**Acknowledgments:** We would like to thank the technicians Fátima Patreze and Liz Mary Bueno de Moraes, from Analytical Chemistry Laboratory, for the support with the sample preparation; and, also the technician Marina Colzato, from the Laboratory of Environmental Analysis, for the support with soil analysis.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

#### **References**


© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

#### *Article*
