Determination of Sugars and Acids in Grape Must Using Miniaturized Near-Infrared Spectroscopy

An automatic determination of grape must ingredients during the harvesting process would support cellar logistics and enables an early termination of the harvest if quality parameters are not met. One of the most important quality-determining characteristics of grape must is its sugar and acid content. Among others, the sugars in particular determine the quality of the must and wine. Chiefly in wine cooperatives, in which a third of all German winegrowers are organized, these quality characteristics serve as the basis for payment. They are acquired upon delivery at the cellar of the cooperative or the winery and result in the acceptance or rejection of grapes and must. The whole process is very time-consuming and expensive, and sometimes grapes that do not meet the quality requirements for sweetness, acidity, or healthiness are destroyed or not used at all, which leads to economic loss. Near-infrared spectroscopy is now a widely used technique to detect a wide variety of ingredients in biological samples. In this study, a miniaturized semi-automated prototype apparatus with a near-infrared sensor and a flow cell was used to acquire spectra (1100 nm to 1350 nm) of grape must at defined temperatures. Data of must samples from four different red and white Vitis vinifera (L.) varieties were recorded throughout the whole growing season of 2021 in Rhineland Palatinate, Germany. Each sample consisted of 100 randomly sampled berries from the entire vineyard. The contents of the main sugars (glucose and fructose) and acids (malic acid and tartaric acid) were determined with high-performance liquid chromatography. Chemometric methods, using partial least-square regression and leave-one-out cross-validation, provided good estimates of both sugars (RMSEP = 6.06 g/L, R2 = 89.26%), as well as malic acid (RMSEP = 1.22 g/L, R2 = 91.10%). The coefficient of determination (R2) was comparable for glucose and fructose with 89.45% compared to 89.08%, respectively. Although tartaric acid was predictable for only two of the four varieties using near-infrared spectroscopy, calibration and validation for malic acid were accurate for all varieties in an equal extent like the sugars. These high prediction accuracies for the main quality determining grape must ingredients using this miniaturized prototype apparatus might enable an installation on a grape harvester in the future.


Introduction
The ripening process of grapes follows a three-part scheme, two growth cycles separated by a lag phase [1,2]. In the first growth phase, malic acid and tartaric acid are accumulated, thus increasing the acids content to its maximum. During the second growth period, onwards from véraison, sugar concentrations increase rapidly and acid contents begin to steadily decrease. While malic acid is mainly metabolized, tartaric acid is diluted by growth in this phase [3]. These growth phases depend highly on the weather and, thus, on the prevailing climatic conditions and their changes. It is already becoming apparent that the predicted climatic changes can lead to musts of lower quality and a more difficult vinification [4]. Due to rising temperatures and mild winters in the Northern Hemisphere, véraison tends to take place earlier in the year. As a consequence, ripening is in the warmest period of the year. This, combined with the predicted rising temperature [5], results in a separation of sugar and acid metabolisms [6]. Excessive sugar contents are possible, resulting in undesirable high alcohol contents. Furthermore, acid contents become far too low, due to concentration of sugars [7,8] and further metabolization of acids (especially malic acid) [6]. This impairment of the delicate sugar-acid balance is particularly disadvantageous for the production of high-quality wines, as the sugar, alcohol, and acid contents largely determine the taste of the wine.
In order to obtain a broader view of the maturity stage of the grapes, it is possible to carry out a laboratory analysis. In this case, most commonly Fourier-Transform infrared spectroscopy (FTIR) is used to measure various additional parameters, for example volatile acids, pH, or the content of yeast-usable nitrogen. However, this method is labour intense as clear must samples have to be prepared for the measurements in the laboratory. Additionally, specialized personal and equipment is required, and it is expensive and time-consuming. Such measurements of the quality attributes such as the sugars and acids contents can be carried out prior to harvest, but are then made again upon delivery in the cellar. The differences between these measurements show that accurate predictions of quality in the field is crucial and appropriate techniques are needed. This could be overcome through a sensor measuring important quality parameters in the tank of the grape harvester during the harvesting process. However, there is a lack of usable, inexpensive technology on the market, that collects these parameters fully automatically.
In vibrational spectroscopy, there is a so-called fingerprinting region. This region is below 1500 cm −1 , where a highly complex spectrum is obtained that can be clearly assigned to an organic substance. However, working in such wavelength ranges so far requires expensive sensors intended for the scientific use. Often some sample preparation is necessary and such sensitive spectrometers are not sufficiently robust for use in the field. To overcome this, near-infrared spectroscopy (NIRS) can be used. This is a reliable, common, and widely used easy-to-operate technique, detecting infrared radiation between 760 nm and 2500 nm. The obtained spectra contain overtones and combination of vibrations, requiring chemometric methods for the content predictions. After calibration, results could be achieved quickly and easily, and excessive sample preparation could be circumvent.
Using diffuse reflectance spectra, the reflected and returning light of an illuminated sample would be recorded. Only a small proportion of the radiation entering the sample and directly interacting with the ingredients returns. Disturbing influences on such spectra are manifold and high coefficients of variation are reported when applying this technique [9]. For this type of measurement, a great deal of research and development is still needed before suitable solutions can be found. Currently, measurements in transmission mode are more suitable. There, a light beam is guided through the homogenized sample. As a result, in particular light scattering effects can be minimized and coefficients of variation can be reduced. A high proportion of the radiation interacts with the target molecules and a higher amount of information about them are included. This enables the construction of better models using chemometrics resulting in a higher predictability of ingredients in biological samples using NIRS. Some properties as well as substances in agricultural products could already be determined on-and in-line using this technique (for an overall overview see Huang et al. [10], especially Cozzolino et al. [9] for viticulture). Due to the strong absorption of water in this wavelength range NIRS is most often used to determine the moisture content of a sample, but also the determination of alcohols in beverages is completed. Moreover, a handheld digital refractometer using NIRS for the sugar determination in individual grapevine berries is already available on the market. However, no usable, reliable and inexpensive sensors using NIRS are available for measuring important quality parameters like sugars and acids before winemaking.
There are still some challenges to overcome. Grape must is highly variable and contains many substances influencing the quantification of metabolites of interest. The changing chemical matrix can have influences on the spectra and, thus, can affect the predictive capacity of this technique. González-Caballero et al. [11] and Fernández-Novales et al. [12] have recorded transmission spectra of white and red grape must of different grapevine varieties. However, they did not create the calibrations specifically for the variety and, thus, increased the variance in the dataset. A wide wavelength range, as it was chosen in the study of González-Caballero et al. [11], requires expensive spectrometers. The prediction of quality-determining compounds can be executed using smaller wavelength ranges, which was shown by Fernández-Novales et al. [12]. However, until now acids have been less predictable. Krause et al. [13] could show the attribution of sugars and acids to particular wavelength bands in the range of 1100 nm to 1160 nm and 1300 nm to 1350 nm, respectively. These should be taken into consideration to achieve precise results, especially for the acids contents prediction.
Reliable and robust models for must of several Vitis vinifera (L.) varieties are still needed. This study is about the prediction of the important quality determining parameters, main sugars and acids in different grape musts using miniaturized NIRS. Sample preparation was minimal and models were build using accurate reference values gained with high-performance liquid chromatography (HPLC).  Plots of 'Chardonnay' were also located in Niederkirchen, as well as Kleinfischlingen. The plot next to Deidesheim was planted with 'Pinot Noir' and the one in Mühlhofen with 'Dornfelder'. Vine and row spacing in the plots were approximately the same and the greening in the tracks was well-kept. All vineyards were roughly north-south oriented, except one in Deidesheim (DH 01). Additional information can be found in the Table A1.

Sampling and Processing Samples
Throughout the ripening period from 9 August 2021 to 1 October 2021 (8 time-points), for 'Riesling' till 14 October (10 timepoints) 2021, 100 berries were taken randomly from each entire vineyard every week. Sampled vines were selected randomly, but evenly distributed over the entire plot. Care was taken to use berries from different positions on the vine, the grape bunch and according to the exposure to sunlight. To gain the must, berries were crushed with a blender (BL 6280, Grundig, Germany) and centrifuged at 20,340× g for 10 min (Sigma 6K 15, Sigma Laborzentrifugen GmbH, Osterode am Harz, Germany). Must was then poured through a 100 µm sieve into two 50 mL falcon tubes and used for recording spectral data ( Figure 2) and reference values, respectively.

Collection of Reference Values
For the analysis of sugars and acids two laboratory methods were used, (1) HPLC and (2) FTIR.

High-Performance Liquid Chromatography
A subsample of the must was transferred to a 2 mL reaction tube, centrifuged (12,100× g for 5 min, Minispin Eppendorf, Hamburg, Germany) and 1:3 diluted using double distilled water. After mixing and another centrifugation step the dilution was filled into vials and placed in the multisampler (G7167B) of the HPLC apparatus (Agilent 12900Infinity II, Agilent Technologies Inc., Santa Clara, CA, USA). The HPLC system consited of a binary pump (G7120A) and a Rezex ROA-Organic Acid H + ion exclusion column (300 mm × 7.8 mm, 8 µm) protected by a security guard Carbo-H + column (Phenomenex Inc., Torrance, CA, USA) kept in a column oven (G7116B) at 75°C was used for separation. Detection of malic acid and tartaric acid was conducted for diode array detector (G7117B) at 210.4 nm. The sugars glucose and fructose were detected using a refractive index detector (G1362A) kept at 50°C. Then, 5 µL of each sample was injected and analyzed in a 16.5 min run under an aqueous phase of 0.4 mM sulfuric acid with a flow rate of 0.6 mL/min. As multi-component standard a four-stage dilution series was created containing 1.5 g/L to 90 g/L fructose and glucose and 0.15 g/L to 9 g/L malic acid and tartaric acid, respectively. Analysis of data was performed with Agilent OpenLab Chemstation software (Agilent Technologies, Santa Clara, CA, USA).
If the recording of a spectrum had to be repeated later than on the day of sampling, the levels of the target substances were determined again using HPLC.

Fourier-Transform Infrared Spectroscopy
FTIR is a rapid and commonly used spectroscopic method for the measurement of a wide range of wine and must parameters. Therefore, reference values for the sugars and acids content were also recorded using FTIR (WineScan SO 2 , Foss, Denmark) on the same day when the berries were sampled and the respective must was gained. The system was coupled with an ASX-260 auto sampler (Teledyne CETAC, Omaha, NE, USA). Automatically 10 ml of the centrifuged grape must was injected and measured in duplicate. Values for glucose, fructose, malic acid, and tartaric acid (in g/L) were gained, as well as for density (g/mL), pH, total acidity (g/L), volatile acids (g/L), gluconic acid (g/L), ethanol (%), glycerol (g/L), ammonia (mg/L), and alpha amino nitrogen (mg/L). For the quantification of these parameters, the default wavelength range of the system was used. Calibration was verified against classical detection methods and in inter-laboratory proficiency tests every year.

NIR Apparatus and Acquisition of Spectral Data
The samples were examined using Fraunhofer IOSB SmartSpectrometer system [13] using a SpectralEngines spectrometer. The NIRONE Sensor S 1.4 detects wavelengths between 1100 nm and 1350 nm with a resolution of 12-16 nm using a single element InGaAs detector and a Fabry-Pérot interferometer for optical filtering. According to the manufacturer, this sensor has a signal-to-noise ratio of 15,000. A halogen lamp HL-2000-HP (Ocean Optics, Orlando, FL, USA) was used as light source which has a wide spectral range from 360 nm to 2400 nm.
The samples were inserted into a 1/4 flow cell (Avantes, Apeldoorn, The Netherlands) extended with a hose at the end of which a tap was attached, to hold the sample stable. For accurate measurement, the optical path (5 mm) was perpendicular to the flow cell and is accordingly as long as the diameter. A step-index fiber optic cable with a diameter of 365 µm and a numerical aperture of 0.22 (Thorlabs, Newton, NJ, USA) was used to connect light source, flow cell and spectrometer. This enabled the conducive use of the dynamic spectrometers and prevents overloading.
Due to hydrogen bonding, the sample temperature has an impact on the spectral data. To decrease this influence during harvest, all samples must be measured at precisely defined temperatures for reference. Therefore, each sample had to go through a temperature profile and was measured after reaching specific points. The flow cell mentioned above were attached to a Peltier element with thermal adhesive. The advantage of Peltier elements are that the surface can be heated and cooled by changing the direction of the electric current. The DT-AR-075-24 (European Thermodynamics, Kibworth Harcourt, UK) fits our need and has a maximum cooling power of 74.5 W and an operating range from −10°C to 47°C, depending on ambient temperature. To improve the heating process, a fan was located on the opposite side. A classical Pt100 is mounted near the edge of Peltiers surface for temperature measurement. Experiments have shown that the temperature at this position is equal to the temperature of the sample in the flow cell. With this configuration, the temperature can be controlled via a proportional-integral-derivative (PID) controller. However, due to non-linearities of the Peltier element, a classically configured PID controller is not suitable for this task. Therefore, the controller has a non-linear I component that increases faster as temperature is not changing and time is progressing. The setup is shown in Figure 3. Final size of the prototype NIR apparatus was 320 mm × 280 mm × 265 mm.
For temperature reference, each sample is measured at 10°C to 18°C in 4 degree increments. Before starting a series of measurements, the system must be referenced with water and 20°C.  (2) depending on the sample temperature (3) and triggered / read out the sensor (6); optical path from left to right (4-6): lamp (4), tube (5), and sensor (6), coupled by fibers.

Spectral Processing and Statistical Analysis
The NIR spectra were pre-processed by reducing multiplicative scattering effects using standard normal variates. For smoothing and de-trending of the spectra a Savitzky-Golay filter with 7 points and a polynomial of order 2 in combination with the first derivative was used. Analysis of spectral data and modelling was performed using spectraltoolbox framework from Fraunhofer IOSB based on Python 3.8.
Partial least square regression was used to calibrate sugars and acids from nearinfrared (NIR) spectra. The number of required latent variables was determined as 6. The PLSR calibration model was validated, using leave-one-out cross-validation. Therefore, the root mean square error of prediction (RMSEP) and R 2 are calculated based on samples that are not used for optimization.

Reference Data
Data of sugars and acids content of grape must were collected throughout the ripening period at 8 to 10 time points. The dataset for the calculation of the models consisted of the values of the respective six last sampling time points for the different varieties. The amounts and the variances of the ingredients in these given moments can be found in Table A4.
Modelling was performed using reference values gained from HPLC. These data included values in minimum and maximum of 27.63 g/L to 112.19 g/L fructose, 32.37 g/L to 111.70 g/L glucose, 4.54 g/L to 24.38 g/L malic acid, and 5.06 g/L to 12.49 g/L tartaric acid ( Table 1). The median limits of quantification (LOQ) over the whole measurement period were 3.34 g/L and 3.85 g/L for fructose and glucose, as well as 0.59 g/L and 0.95 g/L for malic acid and tartaric acid, and could be determined using the calibration measurements according to the guideline on validation of analytical procedures from the International Council on Harmonization.
Comparing the reference values measured using HPLC with one of the common standard methods for the determination of ingredients, FTIR, using simple linear regression (see Figure 4) revealed root mean square errors (RMSE) of 3.38 g/L and 4.84 g/L (r 2 = 0.99) for the sugars fructose and glucose, respectively. For the acids, values measured with both methods correlated better for malic acid (RMSE = 1.25 g/L, r 2 = 0.99) than for tartaric acid (RMSE = 0.87 g/L, r 2 = 0.96). Table 1. Value range (minimum and maximum contents) of the analyzed ingredients in the different Vitis vinifera (L.) varieties from the dataset used for model calculations and their respective root mean square errors of prediction (RMSEP), determination coefficients (R 2 ), as well as the number of the must samples (n samples ) and used corresponding spectra (n spectra ) recorded from 10°C to 18°C in 4°C increments.

Spectra and Modelling
Spectral data recorded at the first few time points represented outliers, which had to be excluded due to insufficient referencing with the water blank. Average recorded, normal-ized, and filtered spectra for each Vitis vinifera (L.) cultivar used for modelling are shown in Figure 2. Models were created individually for each grapevine variety (Figures 5-8) using the respective reference values gained with HPLC. The resulting different regression coefficients (R 2 ) and root mean square errors of prediction (RMSEP) are summarised in Table 1.    On average, for red and white Vitis vinifera (L.) varieties quality of prediction was comparable. Reliable results were obtained for the sugars that were well predicted by the models, with the RMSEP ranging from 6.86% to 11.49% of the ingredient variance (RMSEP from 4.09 to 8.08 g/L, R 2 0.84-0.95). For the acids, the results were mixed and the RMSEP (0.25-1.84 g/L, R 2 0.63-0.97) was 5.89% to 17.57% of the respective value range. Over all the must samples from 'Riesling' (Figure 6) and 'Chardonnay' (Figure 5) performed best and were followed by the predictions for 'Dornfelder' (Figure 7) and 'Pinot Noir' (Figure 8). The accuracy of the predictions for the two sugars were very similar within and between the respective varieties. The forecasts of the malic acid contents were comparable to the sugars, too. The tartaric acid was well predictable for the variety 'Riesling' and, in an lesser extent, for the variety 'Pinot Noir' (see Table 1).
A comparison of the NIR predictions at 14°C with the results from the FTIR and HPLC measurements for the must of the 100-berries samples revealed excellent predictions for the two sugars and malic acid in all varieties. Tartaric acid prediction was only possible for the variety 'Riesling', as the HPLC values did not correlate well with the values gained with FTIR for the varieties 'Pinot Noir', 'Chardonnay', and 'Dornfelder' (see Table A3) due to delays in spectral data acquisition.

Discussion
A fast and reliable method for the quantification of substances that determine quality in viticulture is the FTIR. This method is based on the indirect determination of compounds using infrared light over broad spectral ranges in the mid-infrared light. Its calibration with the reference methods of the OIV (International Organisation of Vine and Wine) and the advantages of measuring with it led to its widespread use in viticulture. In wineries, any new technology will have to compete with it.
Another highly precise method to quantify non-volatile compounds is the HPLC. It is restricted to laboratories and not used in wineries due to its sensitivity and the knowledge required. Both methods were used for the reference measurements in this study. The participation of the methods in a round robin test with several other participating laboratories (data not shown) confirmed their correct measurements. Comparing HPLC and FTIR showed high correlation coefficients and low root mean square errors (see Figure 4) for the two sugars and malic acid. The so gained high-quality dataset provided the opportunity to calibrate the miniaturized prototype sensor system for estimating sugars and acids contents with an accuracy at the laboratory level.
Adequate and reliable models for all varieties could be built for the both sugars glucose and fructose, as well as for the malic acid with comparable prediction accuracies (see Table 1). RMSEPs were lowest for all substances in 'Riesling' and, except for tartaric acid, R 2 values also showed good prediction accuracies for the other three varieties. Due to the high dependence of the RMSEP and R 2 on the span of values, a direct comparison of the models for the respective varieties is difficult. However, with regard to the range of values, predictions for 'Riesling' were best for all substances. The RMSEP accounts for only 5.89% to 7.50% of the total variance in this variety. These results are followed by the predictions for 'Chardonnay', 'Dornfelder', and 'Pinot Noir'.
The used spectrometer was chosen due to its wavelength range. Krause et al. [13] showed that the wavelength ranges from 1100 nm to 1160 nm and from 1300 nm to 1350 nm could be attributed to acids and sugars, respectively, in red grapevine varieties. Additionally, spectral influences of temperature were minimized in this experiment by recording the spectra of the samples at defined temperatures to calculate the models. Moreover, sugar concentration has a similar effect on the spectra [18]. Ripe berries contain 22% to 25% sugar, so their concentrations are near the tipping point between structure-breaking and structure-making effects of the different sugar concentrations. Variance in the dataset could not been eliminated, but this could have additionally changed differences of the RMSEPs in different content ranges. Therefore, lower variations and lower RMSEPs could be calculated for must of ripe berries. Thus, the predictions of the sugars at higher, as well as malic acid at lower concentrations are best (see Table A2).
In the literature, sugar content in grape must is often measured with the total soluble solids content and great predictions were possible using NIRS [19]. Investigations of fruit composition using NIR above 1100 nm and, in particular, for measuring in transmission mode are rare. For the respective sensors used by Fernández-Novales et al. [12] (700-1060 nm) and González-Caballero et al. [11] (380-1650 nm) calibration, as well as validation for sugar contents worked well, with coefficients of determination (R 2 ) of crossvalidation of 0.98 and 0.86, respectively. However, for must of ripe grapevine berries standard errors of 0.47°Brix to 1.82°Brix would lead to measurement uncertainties of the equivalent of circa ±8 g/L to ±20 g/L sugar. In comparison, the correlation coefficients and prediction accuracies in the presented study were excellent (see Table 1).
However, despite good predictions for the sugar contents so far, it has hardly been possible until now to calibrate the acidity well using NIRS, let alone predict it. [19] In the study of Fernández-Novales et al. [12] it was possible to successfully calibrate pH and titratable acidity with R 2 values of 0.81 and 0.76, respectively. However, calibration failed with correlation coefficients below 0.30. González-Caballero et al. [11] were able to achieve slightly better results for the validation of pH values using a higher wavelength range. Additionally, attempts were made to predict individual acids, as was performed in the presented study. Although calibration for malic acid was possible (R 2 = 0.77), validation failed due to the low correlation coefficient in the study of González-Caballero et al. [11]. The current results confirm that modelling was more successful for malic acid. In fact, in the presented study it was predictable in an equal extent like the sugars glucose and fructose for all varieties.
Tartaric acid was also not predictable in the study of González-Caballero et al. [11], as the correlation coefficients of calibration and cross-validation were near zero. In the actual study, tartaric acid, except for the variety 'Riesling' (RMSEP = 0.43 g/L, R 2 = 0.93), had the lowest prediction accuracies with RMSEPs ranging from 0.25 g/L to 0.70 g/L and R 2 from 0.56 to 0.76 for the other three varieties. Since the range of contents of this acid are much smaller in these varieties compared to that for 'Riesling', it is very likely that the poor prediction accuracy is evident from the dataset. The majority of tartaric acid in the berries can probably be diluted by their growth from véraison onwards. In the larger berries, its content drops particularly sharply [20], resulting in only a small range of values as soon as the berries begin to increase in volume. Since the 'Riesling' has the smallest berries and a late ripening start compared to the other varieties, there was a wider range of values. With the help of these data, however, it could be shown that the prediction of tartaric acid in biological samples with complex matrices, such as grapevine berries, is quite possible if the mathematical basis is given. For this a larger value range should be considered, possibly by collecting more unripe and small berries. These could then be used to compute models for better prediction results. In addition, the measurements of the ingredients with both reference methods should be carried out at the same time as the recording of spectral data. Since tartaric acid contents decreases rapidly when the sample is stored, accuracy of the NIR predictions compared to FTIR reference values were lowered. Chemometric models were unaffected by this, since they were calculated using HPLC values recollected when the spectral data were acquired on a different day. However, delays in spectral data acquisition led to a reduction in the already small range of values.
For wines, it has already been shown that NIRS can be used to distinguish the origin of wine over large and small distances. It was assumed that climatic differences, microclimatic influences and differences in soil composition and topology could be the cause for this possibility of differentiation [21][22][23]. This could even be shown for grapevine berries in the study of Arana et al. [24], in which berries of two white varieties ('Chardonnay' and 'Viura') could be assigned to their closely spaced origins with the help of NIRS. Therefore, the origin of the musts could also be a factor influencing the evaluation, since 'Riesling' plots that achieved the best results, were located close to each other. For all other varieties, the plots were further apart. In particular, the 'Chardonnay' and 'Pinot Noir' datasets each contained an area in the northern Rhine plain where slightly contrasting growth conditions prevail.
In addition to the measurements carried out, a promising attempt was made to implement the sensor on a grape harvesting machine. For calibration, spectra at different temperature steps were used for each sample. During harvest, each sample would then only have to be measured once, with the recorded temperature contributing as additional information to the prediction accuracy. A device for sampling, a filter unit (20 µm) and an identically constructed prototype sensor system were set up on a harvester. Automatic acquisition of a low number of spectra was possible, but further improvements are needed. The system has to be optimized for high-throughput spectra collection and an adequate sample flow must be ensured on the grape harvesting machine. Being able to automatically estimate the average quality of the grapes in the harvester's tank would close the large gap between guesswork and a true estimate. If the method is established for the grape harvesters, this would help save time and money during the busiest part of the year and help the viticulturists making decisions. It will be a big step towards digitization in viticulture and is a basis for the development of complex systems for selective harvest, or the identification of target areas for quality-improving methods, such as fertilization and yield adjustment. A future expansion of the system with additional sensors and new calibrations to record more quality-determining properties will be possible and probable. If this sensor is coupled with a non-destructive, near-infrared handheld device measuring ripeness in the field by winegrowers and making these data available, the cooperatives will have more planning security and the current successes of viticulture in the region could be tracked and possibly also used scientifically.

Conclusions
Taking all data and results into account, it can be concluded that the models developed are well suited for predicting the sugars and acids contents in must of different Vitis vinifera (L.) varieties with a miniaturized near-infrared sensor in the wavelength range of 1100 nm to 1350 nm. A semi-automated prototype near-infrared spectrometer with a temperature control and a flow cell was built, with which the must samples were measured at different temperatures. Using corresponding reference measurements and chemometric methods models for the prediction of quality determining ingredients could be calculated and successfully applied. The accuracies achieved for high sugar and low acid contents, which are prevalent in ripe berries, predestines this technique for high-quality estimates during harvest. Further investigations should be addressed to the implementation of the apparatus on a grape harvester for automated determination of the major quality traits during harvest. Since the grapes in the vineyard ripen unevenly, no exact prediction of harvested grape quality can be made and until now there is no commercial available device that can be incorporated on the grape harvester during the harvesting process. This could simplify and accelerate processes in viticulture, advance digitalization, and increase sustainability through planning security.