A Handheld IoT Vis/NIR Spectroscopic System to Assess the Soluble Solids Content of Wine Grapes
Abstract
1. Introduction
2. Materials and Methods
2.1. Hardware Design
- Arduino MKR ZERO (Arduino LLC, Monza, Italy): The Arduino MKR ZERO board was chosen for its low cost, compact size, and reliable performance. It uses the Arm Cortex-M0 32-bit SAMD21 processor and also integrates a micro SD card holder with dedicated SPI (Serial Peripheral Interface). In addition, the board provides an extra SPI and one IIC (Inter-Integrated Circuit) interface for connecting external modules. The board runs at 3.3 V and it has an onboard voltage regulator to convert from 5 V to 3.3 V which satisfies the power supply requirements of both 5 V and 3.3 V components simultaneously.
- AS7265X Triad Spectroscopy Sensor (AMS-Osram, Premstätten, Austria): The AS7265X chipset consists of three sensor devices: AS72651 with master capability, AS72652, and AS72653. The multispectral sensors can be used for spectral identification in a range from visible to NIR. Each of the three sensor devices has 6 independent on-device optical filters whose spectral response is defined in a range from 410 nm to 940 nm with an FWHM of 20 nm. The Triad is combined with a 405 nm UV (Ultraviolet), 5700 k white, and 875 nm IR LEDs to illuminate and test various surfaces for light spectroscopy.
- DR150 (USR, Jinan, China): The DR150 is a high-speed, low-delay, and user-friendly 4G Cat 1 DTU (Data Transfer Unit) with a built-in IoT SIM card. In transparent transmission mode, it enables serial devices to transmit data to a designated server and receive data from the server, which is then forwarded to the serial interface. In addition to hardware support, the manufacturer also provides an IoT cloud platform, allowing users to rapidly develop customized IoT applications.
- SD card (SanDisk, Milpitas, CA, USA): Thanks to the built-in micro SD (Secure Digital) card slot on the Arduino MKR ZERO, storage module can be easily prepared by simply inserting an SD card into the board. Once inserted, data can be read from or written to the card. After data recording is complete, the SD card can be removed and accessed on a computer for further analysis or storage.
- Li-Po battery (CKE, Jiangmen, China): A single-cell 5 V 18,650 lithium polymer (Li-Po) battery is used to supply DC (direct current) power to other modules, with a maximum supported power output of 10 W and a capacity of 3400 mAh. This configuration ensures long-term operation of the device, with an estimated cycle life of approximately 800 charge–discharge cycles.
- IPS LCD screen (ZJY, Beijing, China): A 1.54-inch color liquid crystal display (LCD) screen with an integrated font chip was selected. It features a resolution of 240 × 240 RGB, offering clear and vivid display performance.
- Push-button switch (Youxin, Shenzhen, China): A non-latching push-button switch is used, with the signal taken from the OUT port. When the button is pressed, a high-level signal is output; when released, the output remains at a low level.
- TPE enclosure (Sangong, Shenzhen, China): A TPE (thermoplastic elastomer) enclosure measuring approximately 223 × 192 × 65 mm was used to house and protect the internal modules. Its pistol-shaped design enhances grip comfort and operational convenience.
2.2. Software Design
2.2.1. Embedded Programming Design
- Insert an SD card with a capacity not exceeding 16 GB into the card slot. Align the grape sample with the spectroscopy sensor assembled at the front port of the device, then press the self-locking switch button on the battery power cable to start the device.
- After the device is powered on, the development board automatically executes the initialization function, during which communication parameters for the display, sensor, and storage modules are configured, connection statuses are verified, test tasks are performed, and finally the initialization result are returned. Meanwhile, the wireless transmission module automatically completes parameter initialization, searches for available networks, and connects to the 4G Cat-1 network.
- After the device initialization is completed, the LCD screen displays a ‘Waiting for Detection’ interface. When the user presses the confirmation button, the development board initiates the sensor data acquisition process. The LED lamp is first activated to illuminate the surface of the grape sample and diffuse reflection occurs. A portion of the reflected light that carries information about the grape’s quality enters the spectroscopy sensor and is measured. Upon completion of data acquisition, the LED is turned off.
- After acquiring data from the sensor, the development board executes the result display function, sequentially presenting the reflectance values of the 18 channels. When this set of data needs to be saved and transmitted, the confirmation button is pressed. The device saves the spectral data in a .txt file and transmits the data to the IoT cloud platform in transparent mode.
- If the device is no longer in use while powered on, press the same switch to turn it off. Users can view data tables and download data to a local computer through the IoT cloud platform. Alternatively, they can remove the SD card and copy the stored .txt file to a computer using a card reader.
2.2.2. IoT Cloud Configuration Design
2.3. Data Aquisition
2.4. Data Optimization and Modeling Methods
3. Results
3.1. IoT Cloud Configuration
3.2. Raw Spectroscopy
3.3. Outlier Detection
3.4. Spectral Data Preprocessing
3.5. Characteristic Wavelength Selection
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
SSC | Soluble Solids Content |
SPI | Serial Peripheral Interface |
IIC | Inter-Integrated Circuit |
DTU | Data Transfer Unit |
SD | Secure Digital |
Li-Po | Lithium Polymer |
LCD | Liquid-Crystal Display |
TPE | Thermoplastic Elastomer |
IoT | Internet of Things |
MC | Monte Carlo |
PCA | Principal Component Analysis |
FD | First Derivative |
SD | Second Derivative |
MSC | Multiple Scattering Correction |
SNV | Standard Normal Variate |
SGS | Savitzky–Golay Smoothing |
MAS | Moving Average Smoothing |
UVE | Uninformative Variable Elimination |
SPA | Successive Projections Algorithm |
PLS | Partial Least Squares |
SPXY | Sample set Partitioning based on joint X–Y distances |
Coefficient of Determination for the Calibration Set | |
Coefficient of Determination for the Validation Set | |
RMSEC | Root Mean Square Error for Calibration Set |
RMSEV | Root Mean Square Error for Validation Set |
CARS | Competitive Adaptive Reweighted Sampling |
DC | Direct Current |
RTU | Remote Terminal Unit |
UV | Ultraviolet |
Appendix A
References
- Zhai, H.; Li, S.; Zhao, X.; Lan, Y.; Zhang, X.; Shi, Y.; Duan, C. The compositional characteristics, influencing factors, effects on wine quality and relevant analytical methods of wine polysaccharides: A review. Food Chem. 2023, 403, 134467. [Google Scholar] [CrossRef] [PubMed]
- Mencarelli, F.; Bellincontro, A. Recent advances in postharvest technology of the wine grape to improve the wine aroma. J. Sci. Food Agric. 2020, 100, 5046–5055. [Google Scholar] [CrossRef] [PubMed]
- Xu, X.; Mo, J.; Xie, L.; Ying, Y. Influences of Detection Position and Double Detection Regions on Determining Soluble Solids Content (SSC) for Apples Using On-line Visible/Near-Infrared (Vis/NIR) Spectroscopy. Food Anal. Methods 2019, 12, 2078–2085. [Google Scholar] [CrossRef]
- Kang, W.; Bindon, K.A.; Wang, X.; Muhlack, R.A.; Smith, P.A.; Niimi, J.; Bastian, S.E.P. Chemical and Sensory Impacts of Accentuated Cut Edges (ACE) Grape Must Polyphenol Extraction Technique on Shiraz Wines. Foods 2020, 9, 1027. [Google Scholar] [CrossRef] [PubMed]
- Costa, M.V.A.D.; Fontes, C.H.; Carvalho, G.; Júnior, E.C.D.M. UltraBrix: A Device for Measuring the Soluble Solids Content in Sugarcane. Sustainability 2021, 13, 1227. [Google Scholar] [CrossRef]
- Magwaza, L.S.; Opara, U.L. Analytical methods for determination of sugars and sweetness of horticultural products—A review. Sci. Hortic. 2015, 184, 179–192. [Google Scholar] [CrossRef]
- Wang, M.; Xu, Y.; Yang, Y.; Mu, B.; Nikitina, M.A.; Xiao, X. Vis/NIR optical biosensors applications for fruit monitoring. Biosens. Bioelectron. X 2022, 11, 100197. [Google Scholar] [CrossRef]
- Grabska, J.; Beć, K.B.; Ueno, N.; Huck, C.W. Analyzing the quality parameters of apples by spectroscopy from Vis/NIR to NIR region: A comprehensive review. Foods 2023, 12, 1946. [Google Scholar] [CrossRef] [PubMed]
- Müller, S.; Knoblich, M.; Ege, A.; Lorenz, A.; Brecht, M.; Chassé, T.; Lorenz, G. Characterization of Turbid Biobased Polyurethane Thermosets by UV–Vis–NIR Spectroscopy Combined with Multivariate Data Analysis for In-Line Process Monitoring. Ind. Eng. Chem. Res. 2023, 62, 16188–16197. [Google Scholar] [CrossRef]
- Zhang, W.; Kasun, L.C.; Wang, Q.J.; Zheng, Y.; Lin, Z. A Review of Machine Learning for Near-Infrared Spectroscopy. Sensors 2022, 22, 9764. [Google Scholar] [CrossRef] [PubMed]
- Zhao, Y.; Zhou, L.; Wang, W.; Zhang, X.; Gu, Q.; Zhu, Y.; Chen, R.; Zhang, C. Visible/near-infrared Spectroscopy and Hyperspectral Imaging Facilitate the Rapid Determination of Soluble Solids Content in Fruits. Food Eng. Rev. 2024, 16, 470–496. [Google Scholar] [CrossRef]
- Aparatana, K.; Naomasa, Y.; Sano, M.; Watanabe, K.; Mitsuoka, M.; Ueno, M.; Kawamitsu, Y.; Taira, E. Predicting sugarcane quality using a portable visible near infrared spectrometer and a benchtop near infrared spectrometer. J. Near Infrared Spec. 2023, 31, 14–23. [Google Scholar] [CrossRef]
- Zhang, X.; Zhang, T.; Mu, W.; Fu, Z.; Zhang, X. Prediction of soluble solids content for wine grapes during maturing based on visible and near-infrared spectroscopy. Spectrosc. Spect. Anal. 2021, 41, 229–235. [Google Scholar]
- Tran, N.; Fukuzawa, M. A Portable Spectrometric System for Quantitative Prediction of the Soluble Solids Content of Apples with a Pre-calibrated Multispectral Sensor Chipset. Sensors 2020, 20, 5883. [Google Scholar] [CrossRef] [PubMed]
- Mejía-Correal, K.B.; Marcelo, V.; Sanz-Ablanedo, E.; Rodríguez-Pérez, J.R. Total soluble solids in grape must estimation using vis-nir-swir reflectance measured in fresh berries. Agronomy 2023, 13, 2275. [Google Scholar] [CrossRef]
- Xia, Y.; Zhang, W.; Che, T.; Hu, J.; Cao, S.; Liu, W.; Kang, J.; Tang, W.; Li, H. Comparison of Diffuse Reflectance and Diffuse Transmittance Vis/NIR Spectroscopy for Assessing Soluble Solids Content in Kiwifruit Coupled with Chemometrics. Appl. Sci. 2024, 14, 10001. [Google Scholar] [CrossRef]
- Zhu, W.; Huang, W.; Zhu, Q.; Fan, S. Development of a handheld yellow nectarine soluble solid content detection device based on Vis/NIR spectroscopy. Trans. Chin. Soc. Agric. Eng. 2024, 40, 286–292. [Google Scholar]
- Fan, S.; Wang, Q.; Yang, Y.; Li, J.; Zhang, C.; Tian, X.; Huang, W. Development and experiment of a handheld visible/near infrared device for nondestructive determination of fruit sugar content. Spectrosc. Spect. Anal. 2021, 41, 3058–3063. [Google Scholar]
- Praiphui, A.; Lopin, K.V.; Kielar, F. Construction and evaluation of a low cost NIR-spectrometer for the determination of mango quality parameters. J. Food Meas. Charact. 2023, 17, 4125–4139. [Google Scholar] [CrossRef]
- Cai, J.; Huang, C.; Ma, L.; Zhai, L.; Guo, Z. Handheld Visible/Near Infrared Non Destructive Detection System Soluble Solid Content in Mandarin by 1D-CNN Model. Spectrosc. Spect. Anal. 2023, 43, 2792–2798. [Google Scholar]
- Guo, Z.; Wang, J.; Song, Y.; Yin, X.; Zou, C.; Zou, X. Design and experiment of the handheld visible-near infrared nondestructive detecting system for apple quality. Trans. Chin. Soc. Agric. Eng. 2021, 37, 271–277. [Google Scholar]
- Wang, M.; Wang, B.; Zhang, R.; Wu, Z.; Xiao, X. Flexible Vis/NIR wireless sensing system for banana monitoring. Food Qual. Saf. 2023, 7, fyad025. [Google Scholar] [CrossRef]
- Wang, M.; Zhang, R.; Wu, Z.; Xiao, X. Flexible wireless in situ optical sensing system for banana ripening monitoring. J. Food Process Eng. 2023, 46, e14474. [Google Scholar] [CrossRef]
- Pampuri, A.; Tugnolo, A.; Giovenzana, V.; Casson, A.; Pozzoli, C.; Brancadoro, L.; Guidetti, R.; Beghi, R. Application of a Cost-Effective Visible/Near Infrared Optical Prototype for the Measurement of Qualitative Parameters of Chardonnay Grapes. Appl. Sci. 2022, 12, 4853. [Google Scholar] [CrossRef]
- Zambelli, M.; Casson, A.; Giovenzana, V.; Pampuri, A.; Tugnolo, A.; Pozzoli, C.; Brancadoro, L.; Beghi, R.; Guidetti, R. Visible/Near-Infrared Spectroscopy Devices and Wet-Chem Analyses for Grapes (Vitis vinifera L.) Quality Assessment: An Environmental Performance Comparison. Aust. J. Grape Wine R 2022, 2022, 9780412. [Google Scholar] [CrossRef]
- Du, Z.; Tian, W.; Tilley, M.; Wang, D.; Zhang, G.; Li, Y. Quantitative assessment of wheat quality using near-infrared spectroscopy: A comprehensive review. Compr. Rev. Food Sci. Food Saf. 2022, 21, 2956–3009. [Google Scholar] [CrossRef] [PubMed]
- Pandiselvam, R.; Prithviraj, V.; Manikantan, M.R.; Kothakota, A.; Rusu, A.V.; Trif, M.; Mousavi Khaneghah, A. Recent advancements in NIR spectroscopy for assessing the quality and safety of horticultural products: A comprehensive review. Front. Nutr. 2022, 9, 973457. [Google Scholar] [CrossRef] [PubMed]
- Wang, J.; Lin, T.; Ma, S.; Ju, J.; Wang, R.; Chen, G.; Jiang, R.; Wang, Z. The qualitative and quantitative analysis of industrial paraffin contamination levels in rice using spectral pretreatment combined with machine learning models. J. Food Compos. Anal. 2023, 121, 105430. [Google Scholar] [CrossRef]
- Wang, H.; Zhang, R.; Peng, Z.; Jiang, Y.; Ma, B. Measurement of SSC in processing tomatoes (Lycopersicon esculentum Mill.) by applying Vis-NIR hyperspectral transmittance imaging and multi-parameter compensation models. J. Food Process Eng. 2019, 42, e13100. [Google Scholar] [CrossRef]
- Cai, L.; Zhang, Y.; Cai, Z.; Shi, R.; Li, S.; Li, J. Detection of soluble solids content in tomatoes using full transmission Vis-NIR spectroscopy and combinatorial algorithms. Front. Plant Sci. 2024, 15, 1500819. [Google Scholar] [CrossRef] [PubMed]
- Zhang, R.; Wang, M.; Liu, P.; Zhu, T.; Qu, X.; Chen, X.; Xiao, X. Flexible Vis/NIR sensing system for banana chilling injury. Postharvest Biol. Tec. 2024, 207, 112623. [Google Scholar] [CrossRef]
- Su, Y.; He, K.; Liu, W.; Li, J.; Hou, K.; Lv, S.; He, X. Detection of soluble solid content in table grapes during storage based on visible-near-infrared spectroscopy. Food Innov. Adv. 2024, 4, 10–18. [Google Scholar] [CrossRef]
- Zhang, L.; Huang, Z.; Zhang, X. Stacking Ensemble Learning Method for Quantitative Analysis of Soluble Solid Content in Apples. J. Chemometr. 2025, 39, e3635. [Google Scholar] [CrossRef]
- Jiang, W.; Lu, C.; Zhang, Y.; Ju, W.; Wang, J.; Hong, F.; Wang, T.; Ou, C. Moving-Window-Improved Monte Carlo Uninformative Variable Elimination Combining Successive Projections Algorithm for Near-Infrared Spectroscopy (NIRS). J. Spectrosc. 2020, 2020, 3590301. [Google Scholar] [CrossRef]
- Guo, Z.; Wang, M.; Shujat, A.; Wu, J.; El Seedi, H.R.; Shi, J.; Ouyang, Q.; Chen, Q.; Zou, X. Nondestructive monitoring storage quality of apples at different temperatures by near-infrared transmittance spectroscopy. Food Sci. Nutr. 2020, 8, 3793–3805. [Google Scholar] [CrossRef] [PubMed]
- Ejaz, I.; He, S.; Li, W.; Hu, N.; Tang, C.; Li, S.; Li, M.; Diallo, B.; Xie, G.; Yu, K. Sorghum grains grading for food, feed, and fuel using NIR spectroscopy. Front. Plant Sci. 2021, 12, 720022. [Google Scholar] [CrossRef] [PubMed]
- Noguera, M.; Millan, B.; Andújar, J.M. New, Low-Cost, Hand-Held Multispectral Device for In-Field Fruit-Ripening Assessment. Agriculture 2023, 13, 4. [Google Scholar] [CrossRef]
- Dixit, Y.; Pham, H.Q.; Realini, C.E.; Agnew, M.P.; Craigie, C.R.; Reis, M.M. Evaluating the performance of a miniaturized NIR spectrophotometer for predicting intramuscular fat in lamb: A comparison with benchtop and hand-held Vis-NIR spectrophotometers. Meat Sci. 2020, 162, 108026. [Google Scholar] [CrossRef] [PubMed]
- Zhang, L.; Li, P.; Mao, J.; Ma, F.; Ding, X.; Zhang, Q. An enhanced Monte Carlo outlier detection method. J. Comput. Chem. 2015, 36, 1902–1906. [Google Scholar] [CrossRef] [PubMed]
- Tugnolo, A.; Oliveira, H.M.; Giovenzana, V.; Fontes, N.; Silva, S.; Fernandes, C.; Graça, A.; Pampuri, A.; Casson, A.; Piteira, J.; et al. Quantitative prediction of grape ripening parameters combining an autonomous IoT spectral sensing system and chemometrics. Comput. Electron. Agric. 2025, 230, 109856. [Google Scholar] [CrossRef]
- Bian, X.; Wang, K.; Tan, E.; Diwu, P.; Zhang, F.; Guo, Y. A selective ensemble preprocessing strategy for near-infrared spectral quantitative analysis of complex samples. Chemometr. Intell. Lab. 2020, 197, 103916. [Google Scholar] [CrossRef]
- Wang, T.; Zhang, Y.; Liu, Y.; Zhang, Z.; Yan, T. Intelligent Evaluation of Stone Cell Content of Korla Fragrant Pears by Vis/NIR Reflection Spectroscopy. Foods 2022, 11, 2391. [Google Scholar] [CrossRef] [PubMed]
Module | Model | Price (¥) |
---|---|---|
Development board | Arduino MKR ZERO | 298 |
Sensor module | AS7265X Triad Spectroscopy Sensor | 450 |
Data transmission module | DR150 DTU | 117 |
Storage module | SD card | 33.8 |
Power module | Li-Po battery | 20 |
Display module | IPS LCD screen | 27 |
Input module | Push-button switch | 2.4 |
Connector | 2.54 mm DuPont cable | 10 |
Enclosure | TPE enclosure | 15 |
Set | No. of Samples | Min. (°Brix) | Max. (°Brix) | Mean (°Brix) | STD. (°Brix) |
---|---|---|---|---|---|
Whole set | 113 | 20.00 | 24.60 | 22.03 | 0.86 |
Calibration set | 83 | 20.00 | 24.60 | 22.15 | 0.91 |
Prediction set | 30 | 20.80 | 23.80 | 21.69 | 0.58 |
Preprocess Type | Method | RMSEC | RMSEV | ||
---|---|---|---|---|---|
Baseline correction | FD | 0.783 | 0.426 | 0.743 | 0.292 |
SD | 0.773 | 0.435 | 0.730 | 0.299 | |
Scattering correction | MSC | 0.707 | 0.494 | 0.665 | 0.333 |
SNV | 0.739 | 0.467 | 0.691 | 0.320 | |
Smoothing | MAS | 0.791 | 0.417 | 0.756 | 0.285 |
SGS | 0.802 | 0.406 | 0.766 | 0.278 | |
Scaling | Normalization | 0.744 | 0.462 | 0.701 | 0.315 |
Autoscaling | 0.703 | 0.498 | 0.662 | 0.335 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhang, X.; Qin, Z.; Zhao, R.; Xie, Z.; Bai, X. A Handheld IoT Vis/NIR Spectroscopic System to Assess the Soluble Solids Content of Wine Grapes. Sensors 2025, 25, 4523. https://doi.org/10.3390/s25144523
Zhang X, Qin Z, Zhao R, Xie Z, Bai X. A Handheld IoT Vis/NIR Spectroscopic System to Assess the Soluble Solids Content of Wine Grapes. Sensors. 2025; 25(14):4523. https://doi.org/10.3390/s25144523
Chicago/Turabian StyleZhang, Xu, Ziquan Qin, Ruijie Zhao, Zhuojun Xie, and Xuebing Bai. 2025. "A Handheld IoT Vis/NIR Spectroscopic System to Assess the Soluble Solids Content of Wine Grapes" Sensors 25, no. 14: 4523. https://doi.org/10.3390/s25144523
APA StyleZhang, X., Qin, Z., Zhao, R., Xie, Z., & Bai, X. (2025). A Handheld IoT Vis/NIR Spectroscopic System to Assess the Soluble Solids Content of Wine Grapes. Sensors, 25(14), 4523. https://doi.org/10.3390/s25144523