Software development of STS Miniature spectrometer for crop monitoring system

In order to predict the nutrient content of crop non-destructively and quickly, a spectrum analyzer was developed to measure the spectral reflectance of 350-800 nm in this paper. The system has three parts: optical sensor, data transmission module and the controller. Spectral information collection software includes three modules: acquisition parameters, acquisition control and data management. Calibration experiment and application experiment were carried out to test the performance of the spectrum analyzer. The correlation was analyzed between the spectral reflectance measured by spectrum analyzer and ASD Field Spec Hand Held 2. The result showed that the average correlation coefficient value was 0.94. It was used to detect the chlorophyll and moisture content of potato. The SPAD regression model was established and the determinant coefficient R 2 was 0.484, moisture content regression model was established and R 2 was 0.735. Results showed that the device has a certain ability to predict chlorophyll content and moisture content of potato leaf.


Background
The radiation spectrum characteristics of crops are important aspects of remote sensing technology, they provide evidence for the selection of sensor band, it is also the theoretical basis of remote sensing data analysis. Crop spectrum characteristic analysis plays an important role on identification of crops, production estimation, condition monitoring, and nutrition diagnosis crop management. The spectral reflection characteristics of crops are influenced by different crop varieties, environment conditions, methods of management, the different development stages of the same crop and nutrition status. A large number of studies have shown that there were significant relationship between some sensitive wavelengths and plant parameters such as the relative moisture content, chlorophyll content, nitrogen content, phosphorus, potassium content, and all kinds of carbohydrate content. The relationship of these components and the spectral response characteristics can be used to establish monitoring and diagnosis model of various components based on canopy spectral reflectance. Researchers have done some researches on crop growth detections using crop leaf and canopy reflectance spectra or other vegetation index, and get high detection accuracy (Zhang et al, 2011). To detect the crop in the field, Thomas (1971) used the reflectance ratio between 550 nm and 670 nm to estimate nitrogen content. The model accuracy was close to 90%. Stone (1996) tried to use the reflection spectra of wheat to correct the nitrogen deficiency, the results showed that there is no significant difference on the production between quantitative fertilization and variable fertilization. However, variable fertilization significantly increased the total nitrogen use efficiency. Most previous studies proved that the reflectance in visible light and near infrared band increased with leaf water loss. Boochst (1990) found red edge parameters obtained from the spectrum can be used to detect small differences in the process of wheat growth. Filella (1994) used wheat red edge location and shape indicates the chlorophyll content of wheat. Wang Jihua (2001) found the Spectral reflectance characteristics near 1.45 μm can sensitively reflect the water status of wheat leaves, this parameter was suitable for remote sensing detection index. A typical representative sensor is Green Seeker, an integrated optical sensing and application system. It can measure crop status and be applied in the crop's nitrogen requirement (Noh et al, 2006). Meanwhile, laboratory of modern precision agriculture in China Agricultural University has designed a crop growth monitoring device worked in two bands, the red and near-infrared and crop spectral detection sensor worked in four bands, to detect crop vegetation index NDVI (Zhong et al, 2013).
With the development of optical sensor technology, it is possible to develop a portable spectrum analyzer to diagnose the crop nutrient content, such as chlorophyll content, nitrogen content and moisture content. Thus, a spectrum analyzer was developed to measure the spectral reflectance of 350-800 nm in this paper. Spectral information of potato leaf was collected and processed, the models were established to predict the chlorophyll content and moisture content of potato leaf.

Device Development Hardware Device
The hardware of spectrometer was designed with three parts, as Figure 1 shows: optical system, data transmission module and the controller. The optical system was developed based on the Ocean Optics STS-VIS sensor, the sensor embedded a high-sensitivity 1024 pixel linear CCD array detector to obtain reflectance light and used enhanced electronic device to control. The sensor could detect spectral between 350 nm to 800 nm, the optical resolution is 12 nm. The signal-to-noise ratio is greater than 1500:1, its actual size is only 40*42*24mm3 and the weight is 68 g, it is one of the smallest spectrometer on the market and it could be used for absorbance/transmission/reflection measurements. As designed structure, the controller was connected to sensor through USB2.0 or wireless network, the supporting software was installed on the controller to control the signal communication.
The optical sensor collected light signal through a 10 cm fiber and converts analog signals to digital signals, data was transmitted to data storage module by an USB line with Data storage module supplied by the external portable power source. Local network was established with an external Wi-Fi module, the system was controlled by the controller via wireless network and real-time spectral curve could be read, saved or deleted.
Transmission distance reached up to tens of meters, mobile phones and computers were used as the controller. The operation is more convenient and it can also be easily mounted to the UAVs.

Software System Design
The software developing platform was Windows 7. The spectral information collection and analysis software was developed by C# on Visual Studio 2010. Software included three modules: acquisition parameters, acquisition control and data management ( Figure 2). Acquisition parameters setting module adjusted integration time according to the ambient light intensity, selected file storage path, and set the sampling frequency and average number. Acquisition and control module set automatically acquisition mode or manual acquisition mode. In automatic acquisition mode, acquisition frequency and file path could be set in advance. The data management module viewed txt files saved in a directory. Operators can select a file to download or delete the wrong measurement results.
After the controller and sensor connected successfully, users should optimize the system parameters, such as the integral time. Then choose the collection function, DN value and finally, analyze and store the reflectance data.

Experiment Calibration Experiment
Calibration experiment was carried out in order to test the performance of the spectrum analyzer in March 23, 2016, in the top of the building College of Information and Electrical Engineering, China Agricultural University, it was sunny day without cloud.
Gray board which had four different gradations standard board was measured, it was measured from 12:00 to 15:30 and every 10 min measured once, a total of 20 sets of data. The number of sample is actually 80. The ASD Field Spec Hand Held 2 (Analytical Spectral Devices, Inc., USA) and the spectrum analyzer were placed 10 cm over the gray board, and four different gradations was measured in turn, each measurement was repeated three times and averaged. Because of the light changes, ASD and the spectrum analyzer measured the whiteboard to optimize before each measurement. At the same time, an illuminance-meter was used as reference substance. Data needed to be measured twice when the light intensity changed suddenly (the value of illuminancemeter changed over1Lux).
The gray board had four different gradations standard board. G1 ~ G4 represented from white to black as shown in Figure 3(a). Different gradation had different reflectance, gray board manual provided a standard reflectance data from 250 nm to 2500 nm of the four gray gradations. The standard reflectance is shown in Figure 3(b).

Figure 3. Spectral reflectance of calibration board
Correlation was analyzed between the reflectance measured by spectrum analyzer and ASD from 400 nm to 700 nm, as shown in the following table (1). Most of the correlation coefficients were over 0.9, the average correlation coefficient was 0.94 and the highest was 0.99.The results showed that under different light conditions the developed spectrum analyzer was stable and had a high accuracy.

Application Experiment
The experiment was carried out in March 27, 2016, in the top of the building College of Information and Electrical Engineering, China Agricultural University, it was sunny day without cloud.
36 leaves of potatoes planted in the greenhouse were measured, chlorophyll-content index was measured by SPAD-502 and each measurement was repeated three times and averaged. Spectral information was collected by the spectrum monitoring system at noon, each sample was weighed two times: the saturated weight and the dry weight, then leaf moisture content was calculated as formula (1).
Where M = moisture content, Wsaturated = the saturated weight, Wdry= the dry weight. (1) The relationship between nutrient parameters and spectral reflectance were analyzed and showed in Figure 4. For the chlorophyll content, the correlation coefficient between spectral reflectance and SPAD value was negative in 450-720 nm and positive in other bands. The better data were shown in 650-680 nm with the highest correlation coefficient reached -0.67.
To analyze correlation coefficient between the spectral reflectance and leaf moisture content, there were positive correlation in 465-565 nm and 650-800 nm; meanwhile, they were negatively correlated in 390-465 nm and 565-650 nm. The reflectance and leaf moisture content had better correlation in 490-530 nm and 660-745 nm, especially in 675-700 nm. The highest correlation coefficient reached 0.88.

Figure 4. Correlation analysis result between spectral reflectance and SPAD, moisture content
To monitor the chlorophyll and moisture content of potato leaf non-destructively, the predicting models were established, table 2 shows the main component of statistics. The fore three characteristic value variance cumulative percentage was 99.995%. The former three principal component contains the original multichannel 99.995% of the information, then choose three principal components on behalf of the original multiband and SPAD for regression analysis. The SPAD regression model was created using principal component analysis (PCA), selecting 36 samples of which 30 samples for the calibration, 6 samples for the validation. 36 samples was ranked and divided into 6 groups according to SPAD. And the validation set was chosen one sample from each group. As shown in Table 2 and Figure 5.
Where S = predictive SPAD value of winter wheat, X = principal component parameter values calculated from reflectance in 655-670nm.
(2) As shown in Figure 5, determinant coefficient of the equation R is 0.695，R 2 is 0.484. The R and R 2 values were calculated directly by SPSS. The results showed that the model can be applied to quantitative detection of chlorophyll content of potato leaf, and support for field crop information collection.
Then create moisture content regression model using PCA, Table 2 shows the main component of statistics. The fore two characteristic value variance cumulative percentage was 99. 977%, the former two principal components contains the original multichannel 99.977% of the information. Then choose three principal components on behalf of the original multiband and moisture content for regression analysis. Selecting 36 samples of which 30 samples for the calibration, 6 samples for the validation. 36 samples was ranked and divided into 6 groups according to moisture content. And the validation set was chosen one sample from each group. As shown in Table 3 and Figure 6.
Where M = moisture content prediction of winter wheat, X = principal component parameter values calculated from reflectance in 675-700nm.
(3) As shown in Figure 6, determinant coefficient of the equation R was 0.857，R 2 was 0.735. The R and R 2 values were calculated directly by SPSS. The results showed that the model can be applied to quantitative detection of moisture content of potato leaf, and support for field crop information collection. Figure 6 Results of moisture predicted and measured

Conclusion
In order to predict the moisture content of potato leaf non-destructively and quickly, a spectrum analyzer system was developed. The system has three parts: optical sensor, data transmission module and the controller. The sensor can detect spectral between 350nm to 800 nm. Meanwhile, spectral information collection software was developed, the software includes three modules: acquisition parameters, acquisition control and data management.
1. Calibration Experiment was conducted. The result showed that developed spectrum analyzer is stable and has a high accuracy under different light conditions, the average correlation coefficient with ASD device was 0.94.
2. SPAD regression model was established according to the reflectance in 655-670 nm. R 2 was 0.484. Results showed that the device has a certain ability to predict chlorophyll content.
3. Moisture content regression model was established according to the reflectance in 675-700 nm. R 2 was 0.735. Results showed that the device can be applied to quantitative detection of moisture content of potato leaf.