ABSTRACT
This scientific note outlines the design, components, radiological protection, and operation of a cost-effective X-ray fluorescence (XRF) spectrometer produced in-house. Priced at approximately half that of other commercial models, this spectrometer delivers comparable performance, as demonstrated in a case study involving agricultural soil samples. The document guides researchers interested in constructing their own devices using readily available components, thereby allowing for customized setups tailored to specific applications. The objective is to encourage the adoption and automation of XRF spectrometry within the Soil Science and Agronomic Engineering community, thereby enhancing its utility as a rapid and environmentally friendly tool for monitoring agricultural samples, including those collected from hybrid and/or mobile laboratories.
Keywords:
hybrid laboratory; machine learning; mobile laboratories; proximal sensing; spectroscopy
Energy-dispersive X-ray fluorescence (XRF) spectroscopy is a well-established technique used for the rapid characterization of chemical elements in both solid and liquid samples (Marguí et al., 2022). The method works by exciting a sample with an X-ray source, which induces fluorescence, and subsequently detecting the emitted photons that possess element-specific energy signatures (Kalnicky and Singhvi, 2001). XRF instrumentation comprises an X-ray source and a detector, enabling both qualitative and quantitative analysis of most elements present in a sample.
Similar to near-infrared (NIR) spectroscopy, X-ray fluorescence (XRF) is a proximal sensing technology that enables non-destructive analysis with minimal sample preparation. This approach aligns with the principles of Green Chemistry (He et al., 2007) by eliminating the digestion and extraction steps typically associated with traditional agronomic laboratories. As a fast and cost-effective technique, XRF has been widely applied to the analysis of soils, plants, grains, and fertilizers (Acquah et al., 2022; Carvalho et al., 2018; Camargo et al., 2023; Lima et al., 2019), making it a valuable tool for monitoring agricultural variables.
Portable XRF equipment enables in situ analysis and can be integrated into robots or mobile agricultural platforms, representing a significant advancement for practical and user-friendly field analysis (Tavares et al., 2023). In agricultural research, XRF has proven effective in evaluating the nutritional status of in vivo plants and soil horizons directly in the field (Costa Junior et al., 2020; Stockmann et al., 2016). The growing interest and recent studies underscore its potential to evolve alongside other spectroscopy tools, facilitating agriculture-focused in-field data collection, and digital mapping (Silva et al., 2021; Vanhoof et al., 2021; Vanhoof et al. 2024).
To advance XRF-based analysis in agriculture, projects should focus on three key areas: (i) constructing comprehensive spectral libraries; (ii) creating modeling strategies for enhanced sensor intelligence; and (iii) minimizing variability in in situ measurements (Ravansari et al., 2020). While commercial XRF devices are typically designed for general purposes and often have limitations regarding geometry and control, tailored XRF hardware is essential for targeted agricultural applications, such as robotic in situ analysis and automated laboratory environments. An optimized hardware design is critical for ensuring accurate and reproducible analytical signals across various application contexts.
Recently, an in-house XRF spectrometer was developed to evaluate in vivo plants, optimizing the sample chamber volume and incorporating a camera and laser for precise alignment during setup analysis (Santos et al., 2024). The Laboratório de Instrumentação Nuclear at the Centro de Energia Nuclear na Agricultura da Universidade de São Paulo has been a pioneer in adapting XRF configurations for agricultural applications.
This short communication presents a practical solution: a low-cost XRF spectrometer detailing its assembly, costs, radiological protection, and performance in comparison to commercial devices. By demonstrating that a customized XRF system can be constructed using readily available components while achieving comparable performance, this study underscores its potential to enhance accessibility and affordability in agricultural analysis.
Our XRF spectrometer prototype was developed with specific components to ensure performance and cost-effectiveness. It represents the first portable, in-house XRF sensor designed for agricultural analysis; further details are available in Gozetto et al. (2024). The prototype is equipped with a 4 W Rhodium X-ray tube (Amptek Inc.), specifically the Mini X2 model, which offers adjustable voltage (10-50 kV) and current (5-200 μA) to provide flexibility for optimizing conditions tailored to specific analytes. Lower voltages combined with higher currents enhance the signal-to-noise ratio (SNR) for light elements, while higher voltages are advantageous for heavy elements (Tavares et al., 2020). X-ray spectrum acquisition is conducted using a silicon drift detector (X-123 model, Amptek Inc.) featuring a beryllium window with a thickness of 12.5 μm and an active area of 25 mm2.
The X-ray tube and detector were positioned at a 45° angle relative to the sample holder, which is contained within a custom-built aluminum and polymer case (Figure 1A, B, and E). The equipment's shielding (Figure 1D) consists of a 2 mm thick aluminum layer (Al-1200) combined with a 5 mm brass layer, effectively minimizing spectral contamination from stray fluorescence. The aluminum layer efficiently absorbs the Cu and Zn K-lines from the brass, achieving 100 % attenuation and preventing the detection of these elements. Additionally, signals from the aluminum in the shielding are also undetected due to its low fluorescence yield (3.8 %), the high absorption of Al K-lines by air, and the absorption effects of the detector's beryllium window. This configuration ensures the effective attenuation of Cu and Zn lines, thereby enhancing the accuracy of the collected data. The total weight of the equipment is 11.7 kg, with a detailed breakdown of component costs outlined in Table 1.
Details of the dimensions of the prototype (A), its components (B, C, D, and E), geometry (C), indicator lights (F), and position of the radiation isolation tests (G).
The equipment is also equipped with a vacuum chamber (Figure 1C), which connects the X-ray tube, detector, and sample holder. This setup facilitates the use of a vacuum pump to remove atmospheric gases, thereby enhancing XRF emissions, especially for lighter elements, such as silicon (Si), aluminum (Al), and sulfur (S). Additionally, two filters [molybdenum (Mo) and silver (Ag) 25.4 μm thick] are positioned between the sample and the detector. They can be manually switched to improve SNR and reduce detector dead time.
The total cost of the prototype was US$30,147, representing a reduction of at least 30 % compared to commercial models, which typically range from US$43,000 to US$68,229 (prices based on direct imports, excluding taxes and duties) (Table 1). All costs were quoted in July 2024 and encompassed four major brands currently offering portable XRF devices in the Brazilian market.
Radiological safety features are a critical component of the system design, ensuring the safe operation of the X-ray tube. To prevent activation when the cover shield is not securely in place, the system incorporates both magnetic and mechanical safety locks that are electrically connected to the X-ray tube system. The magnetic lock is located at the sample holder lid, while the mechanical lock is situated internally at the covering handle. The X-ray tube can only be activated when both radiological protection systems are securely engaged. Additionally, three LED indicators are positioned on the front of the equipment (Figure 1F). A red light indicates that the system is powered on, a green light confirms that the cover shield is closed correctly, and an orange light shows that the X-ray tube is active.
Following the assembly of the prototype, external radiation levels were measured using a Geiger-Müller monitor (model 26-1, Ludlum Measurements Inc.) to ensure proper radiation isolation. The radiation dose (μSv h–1) was recorded at 2 cm from all lateral and superior sides of the equipment, as illustrated in Figure 1G, when the X-ray tube was operating at its maximum voltage of 50 kV. The measured dose range on both the superior and lateral faces (0.176 to 0.231 μSv h–1) falls below the Brazilian regulatory control threshold, as these levels are under 1 μSv h–1 at 10 cm (CNEN, 2024). Additional information can be found in the guidelines established by the International Atomic Energy Agency, including General Safety Requirements Part 3.
The sensor prototype's operation is designed to be both efficient and user-friendly, featuring a compact and lightweight design that enables easy transport for on-site analysis. In addition to its laboratory applications, the equipment can be adapted for field use, powered by a 12-volt direct current supply linked to a power inverter (model EN900, Energizer), which provides 115-volt alternating current at 60 Hz.
For data acquisition, the sample is placed on the sample holder. Once the lid is securely closed, the XRF prototype is prepared to initiate measurements, as indicated by the illumination of a green LED. The Mini X2 controller software (Amptek Inc.) is employed to adjust the X-ray tube voltage and current for analyses. Suppose the lid is opened during sample irradiation. In that case, the X-ray tube will automatically shut down to ensure safety. XRF spectra are recorded across 2,048 channels utilizing proprietary software provided by the detector manufacturer (Amptek Inc.). Following the measurements, a ".mca" file is generated, which contains the spectral data along with instrumental conditions such as real and live analysis time, gain, and information about the X-ray tube.
Univariate XRF data treatment is typically employed to assess the signal-to-noise ratio (SNR) of specific lines or to examine the correlation between analyte concentration and its net XRF intensity using simple linear regression. Free software options such as PyMCA (Solé et al., 2007) facilitate both interactive and batch processing analysis of XRF data.
A comparative analysis involving commercial equipment was conducted as a case study to assess soil fertility. For this purpose, 198 soil samples from Brazilian Oxisol/Ferralsol were air-dried, sieved at 2 mm, and analyzed to determine various soil fertility attributes, including clay content, sand content, soil organic carbon (SOC), pH, base saturation, cation exchange capacity (CEC), and exchangeable nutrients, following the methodology outlined by van Raij et al. (2001). Each sample was evaluated using both a prototype device and a commercial Tracer III-SD XRF model (Bruker AXS). The soil samples were placed in polyethylene cups, which were sealed at the base with a 5-μm thick polypropylene film (model 3520, SPEX). Both devices operated under identical conditions: a voltage of 35 kV, a current of 7 μA for 30 s, at atmospheric pressure and without filters. Duplicate readings were averaged for analysis.
In this study, the contents of the attributes were utilized as reference data (Y-variables), while the full XRF spectra served as predictors (X-variables) for modeling purposes. Predictive models were developed using partial least squares regression after the dataset was divided into a calibration set (n = 138) and a validation set (n = 60) to ensure comparability. The effectiveness of the models was assessed through the coefficient of determination (R2), root-mean-square error (RMSE), and the ratio of performance to interquartile distance (RPIQ) (Bellon-Maurel et al., 2010). The RPIQ was interpreted using categories proposed by Greenberg et al. (2023): excellent predictive performance (RPIQ > 2.7), reasonable performance (2.7 > RPIQ > 1.8), and inadequate performance (RPIQ < 1.8). Data analysis was conducted using R Programming Environment (R Core Team, version 4.1.2), following procedures described by Wadoux et al. (2021).
A qualitative assessment of XRF spectra revealed that both the Bruker device and the prototype exhibited similar characteristics, featuring pronounced lines such as Al-Kα, Si-Kα, K-Kα, Ca-Kα, Ti-Kα, and Fe-Kα, in addition to Rh scattering peaks (Figure 2). However, the prototype demonstrated a lower overall spectral intensity, with some emission lines (e.g., Al-Kα, Ca-Kα, and Rh-Kα Thomson) displaying a reduced SNR compared to the Bruker device. Despite this, both devices achieved robust correlations (r = 0.75-0.97) for the primary emission lines, with Rh-Lα Thomson being the only exception, exhibiting a correlation of r = 0.18.
Qualitative evaluation performed on a single sample scanned in quintuplicate. The average spectra obtained from the prototype (in orange) and the Bruker sensor (in blue) are displayed at the top, showcasing the channels (C) from 1 to 2,048 on the X-axis. Below the graphs, boxplots illustrate the net intensities and the signal-to-noise ratio (SNR) for eight selected emission lines, accompanied by the Pearson correlation coefficient (r) for the peaks detected by each sensor. Additionally, the coefficient of variation (%) for the replicates is presented adjacent to each boxplot. The Kα lines of Al, Si, K, Ca, Ti, and Fe, are labeled as a, b, d, e, f, and g, respectively; the Thomson scattering Rh-Lα and Rh-Kα are indicated as c and i, and the Compton scattering Rh-Kα are indicated as h. cps = photon counts per second.
The predictive performances for both XRF devices, evaluated through the RPIQ, are presented in relation to soil fertility attributes, particularly exchangeable (ex-) soil nutrients (Table 2). Both spectrometers exhibited excellent capabilities in predicting SOC, CEC, and clay content (RPIQ > 2.7). Their performance for ex-Ca, ex-Mg, and sand was considered reasonable (RPIQ 1.8-2.7), while predictions for ex-K and ex-P were less accurate (RPIQ < 1.8).
Prediction results of Bruker and prototype models obtained on the validation set (n = 60). Relative differences (RD), based on the root-mean-square error (RMSE) values, between the Bruker and prototype models are also presented.
The RPIQs were comparable for both devices across the various models. Notably, the ex-Ca and CEC models displayed the most significant performance relative differences (RDs) of 20% and 18 %, respectively. This disparity can be attributed to their dependence on the Ca-Kα emission line, which exhibited low SNR (< 10) in both devices – a value that is considered inadequate for quantitative models (Danzer and Currie, 1998). This reduced SNR likely contributes to the variability in performance in these attributes.
While RPIQ results were comparable; the prototype exhibited slightly lower R2 values and higher RMSE values. This indicated greater variability in spectral readings, which is likely due to a lower SNR. Future designs could enhance the SNR by reducing the distance between the sample and the detector and by utilizing detectors with higher count rate capabilities.
This study presents the development of an affordable, in-house XRF spectrometer that offers performance comparable to commercial models, positioning it as a rapid and environmentally friendly tool for agricultural analysis. Its lower cost significantly enhances accessibility for research institutions and private companies, allowing them to engage in financially viable projects. Given the high costs and limited flexibility of commercial XRF devices for agricultural purposes, this study underscores the viability of customized, cost-effective solutions that maintain analytical accuracy.
Key applications of this technology encompass analyses in hybrid laboratory setups, which streamline analysis time and minimize reagent consumption, as well as on-field analyses, whether integrated or not, such as those found in mobile laboratories, within agricultural machinery. Both approaches facilitate improved spatial and temporal density of monitoring, a crucial element in enhancing soil and crop digital mappings in fields such as precision agriculture and pedometrics (Corrêdo et al., 2021; Mouazen and Kuang, 2016; Paiva et al., 2022; Tavares et al., 2021).
Acknowledgments
Tiago R. Tavares was funded by Fundação de Amparo à Pesquisa do Estado de São Paulo (FAPESP) - grant number 2020/16670-9. We thank the research productivity fellowship from the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) - grant number 303822/2023-6. XRF facilities of the commercial equipment were funded by FAPESP - grant number 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 number 01.12.0535.0.
Data availability statement
Data will be made available upon request.
References
-
Acquah GE, Hernandez-Allica J, Thomas CL, Dunham SJ, Towett EK, Drake LB. 2022. Portable X-ray fluorescence (pXRF) calibration for analysis of nutrient concentrations and trace element contaminants in fertilisers. PLoS One 17: e0262460. https://doi.org/10.1371/journal.pone.0262460
» https://doi.org/10.1371/journal.pone.0262460 -
Bellon-Maurel V, Fernandez-Ahumada E, Palagos B, Roger J-M, McBratney A. 2010. Critical review of chemometric indicators commonly used for assessing the quality of the prediction of soil attributes by NIR spectroscopy. TrAC Trends Analytical Chemistry 29: 1073-1081. https://doi.org/10.1016/j.trac.2010.05.006
» https://doi.org/10.1016/j.trac.2010.05.006 -
Camargo RF, Tavares TR, Silva NGC, Almeida E, Carvalho HWP. 2023. Soybean sorting based on protein content using X-ray fluorescence spectrometry. Food Chemistry 412: 135548. https://doi.org/10.1016/j.foodchem.2023.135548
» https://doi.org/10.1016/j.foodchem.2023.135548 -
Carvalho GGA, Guerra MBB, Adame A, Nomura CS, Oliveira PV, Carvalho HWP, et al. 2018. Recent advances in LIBS and XRF for the analysis of plants. Journal of Analytical Atomic Spectrometry 33: 919-944. https://doi.org/10.1039/C7JA00293A
» https://doi.org/10.1039/C7JA00293A - Comissão Nacional de Energia Nuclear [CNEN]. 2024. Requisitos Básicos de Radioproteção e Segurança Radiológica de Fontes de Radiação. CNEN, Rio de Janeiro, RJ, Brazil.
-
Corrêdo LP, Canata TF, Maldaner LF, Lima JJA, Molin JP. 2021. Sugarcane harvesterfor in-field data collection: state of the art, its applicability and future perspectives. Sugar Tech 23: 1-14. https://doi.org/10.1007/s12355-020-00874-3
» https://doi.org/10.1007/s12355-020-00874-3 -
Costa Junior GT, Nunes LC, Gomes MHF, Almeida E, Carvalho HWP. 2020. Direct determination of mineral nutrients in soybean leaves under vivo conditions by portable X-ray fluorescence spectroscopy. X-Ray Spectrometry 49: 274-283. https://doi.org/https://doi.org/10.1002/xrs.3111
» https://doi.org/https://doi.org/10.1002/xrs.3111 -
Danzer K, Currie LA. 1998. Guidelines for calibration in analytical chemistry. Part I. Fundamentals and single component calibration (IUPAC Recommendations 1998). Pure and Applied Chemistry 70: 993-1014. https://doi.org/10.1351/pac199870040993
» https://doi.org/10.1351/pac199870040993 -
Gozetto JD, Almeida E, Brasil MAS, Virgilio A, Santos E, Furlan GR, et al. 2024. In-house manufactured benchtop XRF spectrometer. X-Ray Spectrometry 53: 94-103. https://doi.org/10.1002/xrs.3375
» https://doi.org/10.1002/xrs.3375 -
Greenberg I, Vohland M, Seidel M, Hutengs C, Bezard R, Ludwig B. 2023. Evaluation of mid-infrared and X-ray fluorescence data fusion approaches for prediction of soil properties at the field scale. Sensors 23: 662. https://doi.org/10.3390/s23020662
» https://doi.org/10.3390/s23020662 -
He Y, Tang L, Wu X, Hou X, Lee Y-I. 2007. Spectroscopy: The best way toward green analytical chemistry? Applied Spectroscopy Reviews 42: 119-138. https://doi.org/10.1080/05704920601184259
» https://doi.org/10.1080/05704920601184259 -
Kalnicky DJ, Singhvi R. 2001. Field portable XRF analysis of environmental samples. Journal of Hazardous Materials. 83: 93-122. https://doi.org/10.1016/S0304-3894(00)00330-7
» https://doi.org/10.1016/S0304-3894(00)00330-7 -
Lima TM, Weindorf DC, Curi N, Guilherme LRG, Lana RMQ, Ribeiro BT. 2019. Elemental analysis of Cerrado agricultural soils via portable X-ray fluorescence spectrometry: Inferences for soil fertility assessment. Geoderma 353: 264-272. https://doi.org/https://doi.org/10.1016/j.geoderma.2019.06.045
» https://doi.org/https://doi.org/10.1016/j.geoderma.2019.06.045 -
Marguí E, Queralt I, Almeida E. 2022. X-ray fluorescence spectrometry for environmental analysis: Basic principles, instrumentation, applications and recent trends. Chemosphere 303: 135006. https://doi.org/10.1016/j.chemosphere.2022.135006
» https://doi.org/10.1016/j.chemosphere.2022.135006 -
Mouazen AM, Kuang B. 2016. On-line visible and near infrared spectroscopy for in-field phosphorous management. Soil Tillage Research 155: 471-477. https://doi.org/10.1016/j.still.2015.04.003
» https://doi.org/10.1016/j.still.2015.04.003 -
Paiva AFS, Poppiel RR, Rosin NA, Greschuk LT, Rosas JTF, Demattê JAM. 2022. The Brazilian Program of soil analysis via spectroscopy (ProBASE): Combining spectroscopy and wet laboratories to understand new technologies. Geoderma 421: 115905. https://doi.org/10.1016/j.geoderma.2022.115905
» https://doi.org/10.1016/j.geoderma.2022.115905 -
Ravansari R, Wilson SC, Tighe M. 2020. Portable X-ray fluorescence for environmental assessment of soils: Not just a point and shoot method. Environment Internacional 134: 105250. https://doi.org/10.1016/j.envint.2019.105250
» https://doi.org/10.1016/j.envint.2019.105250 -
Santos E, Gozetto JD, Almeida E, Brasil MAS, da Silva NG C, Rezende, VP et al. 2024. An in-house X-ray fluorescence spectrometer development for In vivo analysis of plants. ACS Agricultural Science & Technology 4: 471-477. https://doi.org/10.1021/acsagscitech.4c00003
» https://doi.org/10.1021/acsagscitech.4c00003 -
Silva SHG, Ribeiro BT, Guerra MBB, Carvalho HWP, Lopes G, Carvalho GS, et al. 2021. Chapter One - pXRF in tropical soils: Methodology, applications, achievements and challenges. p. 1-62. In: Sparks DL. ed. Advances in Agronomy. Academic Press, Cambridge, MA, EUA. https://doi.org/10.1016/bs.agron.2020.12.001
» https://doi.org/10.1016/bs.agron.2020.12.001 -
Solé VA, Papillon E, Cotte M, Walter P, Susini J. 2007. A multiplatform code for the analysis of energy-dispersive X-ray fluorescence spectra. Spectrochimica Acta Part B Atomic - Spectroscopy 62: 63-68. https://doi.org/10.1016/j.sab.2006.12.002
» https://doi.org/10.1016/j.sab.2006.12.002 -
Stockmann U, Cattle SR, Minasny B, McBratney AB. 2016. Utilizing portable X-ray fluorescence spectrometry for in-field investigation of pedogenesis. CATENA 139: 220-231. https://doi.org/10.1016/j.catena.2016.01.007
» https://doi.org/10.1016/j.catena.2016.01.007 -
Tavares TR, Molin JP, Nunes LC, Alves EEN, Melquiades FL, Carvalho HWP, et al. 2020. Effect of X-ray tube configuration on measurement of key soil fertility attributes with XRF. Remote Sensing 12: 963. https://doi.org/10.3390/rs12060963
» https://doi.org/10.3390/rs12060963 -
Tavares TR, Molin JP, Nunes LC, Wei MCF, Krug FJ, Carvalho HWP, et al. 2021. Multi-sensor approach for tropical soil fertility analysis: Comparison of individual and combined performance of VNIR, XRF, and LIBS spectroscopies. Agronomy 11: 1028. https://doi.org/10.3390/agronomy11061028
» https://doi.org/10.3390/agronomy11061028 -
Tavares TR, Minasny B, McBratney A, Cherubin MR, Marques GT, Ragagnin MM, et al. 2023. Estimating plant-available nutrients with XRF sensors: Towards a versatile analysis tool for soil condition assessment. Geoderma 439: 116701. https://doi.org/10.1016/j.geoderma.2023.116701
» https://doi.org/10.1016/j.geoderma.2023.116701 - van Raij B, Andrade JC, Cantarella H, Quaggio JA. 2001. Análise química para avaliação de solos tropicais. IAC, Campinas, SP, Brazil.
-
Vanhoof C, Bacon JR, Fittschen UEA, Vincze. 2021. Atomic spectrometry update – a review of advances in X-ray fluorescence spectrometry and its special applications. Journal of Analytical. Atomic Spectrometry 36: 1797-1812. https://doi.org/10.1039/D1JA90033A
» https://doi.org/10.1039/D1JA90033A -
Vanhoof C, Bacon JR, Fittschen UEA, Vincze L. 2024. Atomic spectrometry update: review of advances in X-ray fluorescence spectrometry and its special applications. Journal of Analytical Atomic Spectrometry 39: 2152-2164. https://doi.org/10.1039/D4JA90034K
» https://doi.org/10.1039/D4JA90034K -
Wadoux AMJ-C, Malone B, Minasny B, Fajardo M, McBratney AB. 2021. soil spectral inference with r: analysing digital soil spectra using the R programming environment. Springer International Publishing AG, Cham, Switzerland. https://doi.org/10.1007/978-3-030-64896-1
» https://doi.org/10.1007/978-3-030-64896-1
Edited by
-
Edited by:
Thiago Libório Romanelli




