Detection of fruits in warehouse using Electronic nose

An electronic nose system for storage environments was built. The system would consist of sensor array, data acquisition module and host computer software. The electronic nose made up with eight metal-oxide-semiconductor gas sensors was used to test four types of stone fruit (Dragon fruit, Snow pear, Kiwi fruit, and Fuji apple). The results showed that the rate of corruption of kiwifruit was the fastest, followed by pitaya, and the apples and pears was comparable.The tested fruits can be divided into fresh and spoiled grades by using PCA. And finally,according to the problems related to node deployment, the electronic nose node deployment program was proposed


Introduction
Due to improper storage and perishable factors, fruit rot have caused serious environmental pollution and waste in the circulation process, which has directly been affecting the progress and economic benefits of sustainable development and improvement. The main reason for the loss of fruit rot is the inappropriate preservation of the storage. The traditional methods for assessing fruit quality are mainly chemical analysis methods, which require considerable chemical reagents. The test and analysis process is cumbersome and slow, and the fruits must be destroyed during the test, which is of little practical significance for fruit quality identification. The non-destructive testing methods that have emerged in recent years based on the physical, optical, electrical, and biological properties of fruits [1][2][3][4] could determine the physical and chemical indicators of fruit without destroying the fruit itself.
As a non-destructive testing technology, electronic nose technology has developed rapidly. It's mainly used to monitor the quality of products by detecting aroma components. The aroma components of different fruits are very distinct, and the odor of fruits is closely related to their maturity, storage time and even the degree of decay. After the fruits maturity, it is easy to be decayed and deteriorated by the physiological diseases, invasive diseases,and physical injury during the process of picking, transporting, storing and selling. By monitoring the change of fruit odors composition through the electronic nose, the fruit quality can be judged.
Many scholars at home and abroad have been using electronic nose to detect the odors of fruits and evaluate the fruit quality. Natale et al [5] and Saevels et al. [6] used electronic noses to evaluate the quality of harvested apples and found that there was a large correlation between hardness changes and predicted results during storage period.Tabassum S et al. [7,8]used an efficient and convenient method of patterning nanostructures on the cleaved facet of an optical fiber to realize a highperformance fiber-optic gas sensor. The gas sensor is realized by coating the guided mode resonant (GMR) structure with a thin layer of graphene oxide (GO) nanosheets. The sensor provides sensitivities of 0.92 and 1.37 pm/ppm for ethylene and methanol vapors, respectively, with a threefold enhancement in sensitivity and 50% reduction in response time compared with the non-GO coated counterpart. Hui Guohua et al. [9] studied a method for identifying banana storage time based on an electronic nose system.At the same time,the identification model about banana storage time based on signal-to-noise ratio maximums was established, and it has a high prediction accuracy. Fu Jun et al. [10] designed a portable intelligent electronic nose system,and it was used to evaluate grape shelf life and obtained a higher recognition rate. Yin Fangyuan et al. [11] selected 8 TGS sensors to detect mango samples stored for nine days and constructed a mango storage prediction model. The predicting experimental results showed that the model had an accuracy of 87.5%. The research on the electronic nose in the fruit field at home and abroad mainly lies in the differentiation of fruit's maturity, the prediction of storage period, and the identification of varieties.
In this paper, eight types of metal oxide gas sensors were used to construct the electronic nose system to monitor the change rules and diffusion process of gas components in the process of fruit spoilage under storage environment. The NI USB-6366 data-acquisition card with 8-channel was used and the data acquisition and analysis software based on the LabVIEW platform was developed.The system was used to monitor the corruption of the four kinds of stone fruits (pitaya, snow pear, kiwifruit and Fuji apple).After that, PCA was used to analyze the degree of fruit's corruption.

Electronic nose system design
The electronic nose experimental test system constructed in this study is shown in Figure 1. It mainly consists of three parts: sensor array, data-acquisition module, and host computer software, among them: (1) The sensor array is the core component of the electronic nose and is used to monitor the changes of odor's composition during fruit's spoilage. According to the types of fruits, we could select different gas sensors.
(2) Data-acquisition module is an important part of the electronic nose,which is utilized to filter and condition the analog signal output from the sensor array, and then transmit to the host computer software.
(3) The host computer software is used to collect and store experimental data, and carries out PCA to extract effective information.
During the experimental testing, the samples to be tested and the sensor array are placed into a simulated storage environment (size 130cm×80cm×50cm) to simulate the storage condition of the fruits. The distance between the samples and the sensor array are 50cm, and the gas from the tested samples are diffused and passed through the sensor array to be detected. The sensor array transmits the signals to the data-acquisition module in the form of voltage and uploads to the host computer for display,storage and analysis simultaneously.

Sensor Array and Data Acquisition Module
The gas sensor array is equivalent to human olfactory cells, and its sensitivity, selectivity and stability would be directly affected to the performance of the system. According to different materials, the existing gas sensor is classified into metal oxide gas sensor, organic polymer gas sensor, electric potential gas sensor, quality sensitive gas sensor and optical gas sensor. Since the sensor array studied in this paper is aimed at fruits, different fruits have different odors, and various odors are also composed of many chemical components. The chemical components that affect the intrinsic quality of fruits are not completely determined. When selecting the sensor array, we try to make each sensor have certain crosssensitivity.Therefore,the followed two requirements should be met when determining the sensor array composition [12]: (1) The sensitivity of the gas sensors should be high, which can respond to very low odor factors.
(2) The selectivity of the gas sensors should not be so high that the responses signals of the sensors become a comprehensive response to various components of fruits, but due to the difference in selectivity, the response values of different sensors are vary.
At the same time,in order to improve the performance of the electronic nose, some scholars have proposed the use of statistical methods to optimize the sensor array [13]. In this way, the responses of the sensors in the array to the fruits are both distinct and related,and exhibiting a certain correlation, and the output of the array also more fully reflects the chemical composition of the odors so that the assessment of the artificial olfactory system can be performed more trustworthy. The MQ series sensors come with signal conditioning circuits and are less expensive, so this study selected MQ series sensors.
The aroma components released during fruits storage included esters, alcohols, aldehydes, ethylene, and gases such as hydrogen sulfide, alkanes, and ammonia that may be generated due to spoilage. These gas components all have a certain degree of reducibility. 8 metal oxide gas sensor modules of the MQ series were selected to form the sensor array. The sensitive material of MQ series sensors is SnO 2 . Its conductivity increased with the concentration of measured odor when reacts with sample. The sensing species are shown in Table 1. The signal conditioning circuit is set up as shown in Figure 2.There are two forms of the output signals generated by the MQ sensor array. One is digital signal; the other is analog signal (0-5V), the higher the concentration, the higher the voltage.
The output signals of the sensors are low-frequency signals with a maximum value of 5V. The data are sent to the host computer interface through the dataacquisition module. The National Instruments NI USB-6366 data-acquisition card was used as the dataacquisition circuit module, which has 8 simultaneous analog inputs in 2 MS/s channels and 16-bit resolution, and could truly restore the electronic nose response.

Software design of electronic nose system
The host computer interface was built by LabVIEW. The sampling frequency of data can be set, and data can be received, displayed, and stored in a specified format. Figure 3 is the front panel of the main interface of the software. The collected odors information is transmitted by the gas sensor array to the host computer through the data-acquisition module in the form of voltage, and the real-time data waveforms are displayed. The figure shows the real-time voltage values of eight sensors, including ethanol, hydrogen sulfide, and ammonia. Users could choose the path of file storage according to their need. Because of storing data in real time, the amount of data is large.Therefore, the selected storage format is the .TDMS. To eliminate measurement errors and noise effects as much as possible, the values from the data storage file were selected and subtracted by the baseline values of the sensors, the absolute increment detected by each sensors is obtained. Finally, the average value of the increment was taken as the final results. As shown in equation 1. (1) is the sampled value detected by the sensor, is the baseline value, N is the number of data points, and i is the number of the sensor. That is, a mean value is used to represent the steady state value of each sensor over a period of time, thereby, reducing the amount of data while ensuring the accuracy greatly. Then using the PCA to analysis the data, LabVIEW could directly call the mathscript node,using the princomp function in MATLAB to achieve PCA [14].

experiment and analysis of electronic nose system
Four species of fruits were selected: white heart pitaya, Zhaozhou snowflake pear, "Cuiyu" kiwifruit and Fuji apple as test material [15].In normal temperature environment, the four kinds of fruits to be tested were washed and sliced. 50 g of each fruit slice was placed in a 420-mL glass container with a closed lid, so the rotting changes would be observed. In the test, the glass container containing fruit slices was placed into the warehouse environment simulator, then the lid was opened, and the sample odor was released by the diffusion method. Each experiment lasted for 30 minutes and was measured every 12 hours. After completing of each sample test, the sample glass container was removed from the simulator,and then passing the clean compressed air, cleaning the warehouse environment simulator, waiting until the baselines of the test reached to the initial state, and then proceeding with the next sample. The host computer was set the sampling rate of the system to 10Hz. The time for each sample collection is 15 minutes. At the end of each test, the data is automatically stored in the computer, which is convenient for further analysis. Figure 4 shows that the response curves of the kiwifruit in the fourth day. At the 5th minute, the sample gas was introduced, and after a short period of reaction, the responses of the sensors increased with the constant releases of the gas. Continuously collected for 15 minutes, at the 20th minute, the sample was taken out and the response values of each sensor began to decrease. It could be seen from the figure that the sensor response values would fluctuate greatly during the sample insertion and removal.  As can be seen from figure 4, the response amplitudes of the sensors MQ-3 (alcohol), MQ-135 (ammonia), MQ-136 (hydrogen sulfide) and MQ-138 (formaldehyde, benzene) are the most obvious. It was observed that the four main types of fruits ordors were detected in the storage simulation environment as alcohol, ammonia gas, hydrogen sulfide, and aromatic substances.With reference to the provisions of the flammable gas and toxic gas detection alarm design specification SH3063-1999 [16], the effective coverage horizontal plane radius of the flammable gas monitoring device is 5m indoors and 10m outdoors. Therefore, the detection radius of the system electronic nose is set to 5m, which is used as the sensing radius of the electronic nose in the storage layout.

Analysis of different kinds of fruits
The data at last 5 minutes were selected from the measured data to do the average processing. Finally, the trend of the four kinds of fruit's samples in the 120 hours is obtained. In the experiment,we take the set of data every 24 hours, and draw the sensors responses lines charts for each group of samples. As shown in Figure 6. As it can be seen from the figure that with the increasing of time in storage, the most obvious beings were the MQ-3, MQ-135, MQ-136, and MQ-138 of these four sensors, the other four sensors did not respond clearly enough. With storage time increased, the degree of corruption increased. The sugar content and protein decomposed to produce alcohol, hydrogen sulfide and ammonia, which is consistent with the physiological process of fruit's samples. According to the responses data of each sensor, the differences of the four kinds of fruits in the initial storage period are small. With the extension of storage time, the corruption process of different fruits had obvious differentiation, also the contents of the characteristic gases have been distinctive apparently.
The changing trend of Fuji apple in the storage process is shown in Figure 6. The value of MQ-138 reached to the maximum value at the third day, and then the content decreased continuously while contents of MQ-3, MQ-135, and MQ-136 were increasing. It shows that there is an inflection point of aroma content in apple during the process of corruption, which is obviously different from the other three kinds of fruits. At the same time, it is also observed that apple samples apparently rotted and darkened on the third day.
According to the results of the experiment, it could be noticed that the speed of corruption of different type of fruits were distinct.Significant differences and distinction was observed by the electronic nose, among them, the pitaya had the fastest rate of corruption, followed by kiwifruit, Fuji apples and snow pear at the same speed. The sensors of the MQ-138, MQ-135, MQ-3, and MQ-136 all showed obvious responses to the four fruits, while the sensors MQ-4, MQ-6, MQ-7, and MQ-8 showed weak responses, indicating that these four types of characteristic gases have lower concentrations in the storage simulation environment. Therefore, for the detection of warehousing fruit, the early stage of fruit corruption can only monitor whether corruption occurs. As time goes by, the corruption characteristics of each fruit are gradually obvious, and the types can be effectively distinguished.

Using PCA to analyze the degree of fruits decay
The PCA was performed on 10 sets of data. The four principal components obtained from the eight sensors measured data are shown in table 2. The total contribution ratio of the first two principal components of each group of data exceeds 90%, so the first and second principal components could characterize the raw data. Figure 7 displays the first two principal components. It could be seen from the figure that the use of PCA can classify fruits into fresh and corrupted grades. In the early stages of fruit's storage, the differences between varieties of fruits were relatively small. With the extension of the storage time, the difference in the corruption of these fruits had become more apparent, which were consistent with the trend reflected by the previous test data.  The rectangular stereoscopic warehouse shape rule, although it is a three-dimensional space deployment problem, can be simplified compared to other complex shape warehouses. Therefore, a node deployment scheme based on 3D meshing is proposed for its characteristics.
Assume that the rectangular stereoscopic warehouse with its length, width, and height are L, W, and H respectively and the detection radius of the electronic nose is r. Divide it into small cubes with side length a , as shown in Figure9,so as long as r and a satisfied the following conditions: (2) Then, deploying the nodes at the center of these cubes, we can achieve complete coverage of the entire warehouse, as shown in Figure 8.

Conclusion
In this paper, the electronic nose system based on LabVIEW was used. Eight MQ series metal oxide gas sensors were selected. The collected fruit's detection data could be displayed and stored in real time. The interface was friendly and easy to operate. Meeting the purpose of simple, rapid and inexpensive detection of fruit's freshness, and could be widely used in such fields as fruit's storage. The four species of white heart pitaya, Zhaozhou snow pear, "Cuiyu" kiwifruit and Fuji apple were tested. The results show that the responses of the electronic nose changed with the freshness of the samples, and there were significant differences on the decay rate of different types of fruits. The PCA was used to reduce the dimensionality and cluster analysis of the original data. The analysis results showed that the four fruits could be classified into two levels of freshness and corruption according to the storage time, confirming the feasibility of this system and providing a reference for further use of the electronic nose for fruit quality detection. What's more, the deployment of the nodes of the electronic nose in the rectangular stereoscopic warehouse is studied. The electronic nose node deployment program was proposed for the unique characteristics of the most widely used rectangular warehouse.