CH4, C2H6, and CO2 Multi-Gas Sensing Based on Portable Mid-Infrared Spectroscopy and PCA-BP Algorithm

A multi-gas sensing system was developed based on the detection principle of the non-dispersive infrared (NDIR) method, which used a broad-spectra light source, a tunable Fabry–Pérot (FP) filter detector, and a flexible low-loss infrared waveguide as an absorption cell. CH4, C2H6, and CO2 gases were detected by the system. The concentration of CO2 could be detected directly, and the concentrations of CH4 and C2H6 were detected using a PCA-BP neural network algorithm because of the interference of CH4 and C2H6. The detection limits were achieved to be 2.59 ppm, 926 ppb, and 114 ppb for CH4, C2H6, and CO2 with an averaging time of 429 s, 462 s, and 297 s, respectively. The root mean square error of prediction (RMSEP) of CH4 and C2H6 were 10.97 ppm and 2.00 ppm, respectively. The proposed system and method take full advantage of the multi-component gas measurement capability of the mid-infrared broadband source and achieve a compromise between performance and system cost.


Introduction
Multi-gas detection plays an important role in many areas, such as medical diagnosis, industrial application, environmental atmospheric monitoring, and fire alarm systems in coal mines [1][2][3]. So far, the most widely used techniques in infrared spectroscopy for multi-gas detection are the tunable diode laser absorption spectroscopy (TDLAS) and non-dispersive infrared (NDIR) detection system. TDLAS has the advantages of high precision, high sensitivity, and good selectivity. Zou et al. reported a near-infrared dual-gas sensing system for methane (CH 4 ) and ethane (C 2 H 6 ) based on a distributed feedback (DFB) diode laser in the near-infrared region, and the detection limits were about 23.53 ppb for CH 4 and 146.4 ppb for C 2 H 6 in 200 s [4]. However, the cost of TDLAS is high and its tunable spectral range is narrow, which means that it can only be used for one type of gas or multiple gases with adjacent absorption lines. Multiple lasers are necessary if TDLAS is used for multi-gas detection in a wide spectral range, which caused system complexity and increased costs. Xi et al. developed a near-infrared dual-gas sensor system for CH 4 and C 2 H 6 using two DFB diode lasers, and the detection limits were about 78 ppb for CH 4 and 190 ppb for C 2 H 6 in 0.8 s [5]. Piotr Jaworski et al. realized a dual-gas sensor for the detection of carbon dioxide (CO 2 ) and CH 4 in the near-and mid-infrared regions using a DFB diode laser and a custom-made MIR laser based on a difference frequency generation phenomenon, and it reached a detection limit down to 24 ppb for CH 4 and 144 ppm for CO 2 [6].
NDIR has the advantages of a simple system, low cost, wide detection range, and moderate sensitivity. Hence, it is widely used for multi-gas detection, and has been used to measure the concentration of more than 100 types of gases. However, NDIR has the disadvantage of a low resolution, so there is always the problem of interference in multi-gas detection. To solve the problem, optical filters and the concentration inversion models are always applied in the NDIR. Xu et al. developed a NDIR multi-gas detection system consisting of a single broadband light source and four-channel pyroelectric detector to analyse CO 2 , carbon monoxide (CO), and propane (C 3 H 8 ), and it was observed that the full-scale error of the sensor changed less than 3.5%, the detection repeatability error was lower than 4.5%, and the detection stability was less than 2.7% [7]. Liu et al. proposed a NDIR-system-based four-channel thermoelectricity detector to analyse CO and CO 2 , and the detector's data processor has 3% accuracy and stability [8]. Dong et al. developed a multi-gas sensor system that used a single broadband light source and three pyroelectric detectors by use of the time division multiplexing (TDM) technique, and the detection limits were about 2.96, 4.54, and 2.84 ppm for CO, CO 2 , and CH 4 , respectively [9].
In this paper, CH 4 , C 2 H 6 , CO 2 , and their mixtures were detected. CO 2 is the most abundant greenhouse gas. CH 4 is one of the most important greenhouse gases, contributing 25 times more to global warming than CO 2 in 100 years [10][11][12]. C 2 H 6 is another important greenhouse gas that damages the ozone layer [13,14]. In addition to CH 4 and C 2 H 6 being two characteristic gases for monitoring transformer status in dissolved gas analysis (DGA), they are also the first and second largest components of natural gas [15][16][17].
A miniaturized NDIR sensing system was established. A blackbody radiation broadspectra light source and a tunable Fabry-Pérot (FP) filter detector were used [18,19]. The detection wavelength range can be controlled by adjusting the driving voltage of the FP interferometer. A homemade flexible waveguide was used as the gas absorption cell which could improve the portability of the system [20,21]. The sensing system attained high performances because of the long optical path and low loss of the flexible waveguide. Multi-gas detection always has the problem of interference in the spectrum. Intelligent learning methods can solve this problem and have achieved good results [22][23][24][25][26]. Hence, we used principal component analysis (PCA) and the back propagation (BP) neural network to correct the interference of multi-gas detection, and improved the detection performance of the system. A simulation-aid training method is also proposed in this paper to reduce the time cost. In both hardware and software considerations, the system proposed in this paper achieves a compromise between performances and system cost.

Sensing System Design
The schematic diagram of the sensing system is shown in Figure 1, which is generally divided into three modules: gas dilution module, optical sensing module, and control module. In the optical sensing module, a broadband thermal light source (Axetris, EMIRS200, Sarnen, Switzerland) was chosen as the infrared light source. Its emission spectrum range is 2~14 µm, which covers the absorption band of CH 4 (3.2~3.6 µm), C 2 H 6 (3.2~3.6 µm), and CO 2 (4.2~4.4 µm). A tunable Fabry-Pérot filter detector (Infratech, LFP-3144(C)-337, Dresden, Germany) was used as the detector with a tuning wavelength range from 3.1 to 4.4 µm. The wavelength resolution of the FP detector is low, which is about 60 nm. The hollow waveguide (HWG) can simultaneously serve as a transmission medium and gas absorption cell for mid-infrared gas sensing. It has the advantages of low loss, small volume, flexibility, and fast response [27]. A polycarbonate base tube was chosen for HWG to achieve flexibility. A silver iodide and silver (AgI/Ag) were inner-coated to achieve low loss for the HWG at the target wavelength. Figure 2a shows that the HWG has good flexibility and can be bent into the small size substrate, which improved the portability of the system. The length and inner diameter of the HWG applied in this work are 100 cm and 3.5 mm, respectively. Figure 2b shows the measured loss spectrum of the 100 cm length AgI/Ag waveguide by the FTIR. Low-loss property in the wavelength band from 3.1 to 4.4 µm was attained. The peak around 4.3 µm is the absorption of CO 2 in the air. The HWG was directly connected with the light source and detector by 3D printed waveguide splices without any focal lenses. The control module was mainly composed of the personal computer and the controller board (Infratech, FPI-EvalKit, Dresden, Germany). The con-troller board was connected through the computer to set the driving current of the light source and the measurement step of the FP filter detector, and receive the signal detected by the detector. The measurement wavelength step set in this work was 20 nm and 66 data points were collected over the wavelength range of 1300 nm. The time scanning across the whole spectrum was about 33 s. The gas dilution module was composed of three mass flow controllers (HORIBA, S600-BR222, Shanghai, China, with a 1% uncertainty) and a gas mixing pipe. The flow rate of each mass flow controller was set by computer to get different concentrations of mixture gas. The standard gases used in this work were high-purity nitrogen (N 2 ≥ 99.999%, H 2 O ≤ 3 ppm, CO 2 ≤ 1 ppm, Chemical Center of Fudan University, Shanghai, China), standard 3040 ppm CH 4 gas (Air Liquid, Shanghai, China), standard 311 ppm CH 4 gas (Air Liquid, Shanghai, China), standard 3040 ppm C 2 H 6 gas (Air Liquid, Shanghai, China), and standard 100 ppm CO 2 gas (Air Liquid, Shanghai, China).
Sensors 2023, 23, 1413 3 air. The HWG was directly connected with the light source and detector by 3D pri waveguide splices without any focal lenses. The control module was mainly compose the personal computer and the controller board (Infratech, FPI-EvalKit, Dresden, many). The controller board was connected through the computer to set the driving rent of the light source and the measurement step of the FP filter detector, and receive signal detected by the detector. The measurement wavelength step set in this work 20 nm and 66 data points were collected over the wavelength range of 1300 nm. The scanning across the whole spectrum was about 33 s. The gas dilution module was c posed of three mass flow controllers (HORIBA, S600-BR222, Shanghai, China, with a uncertainty) and a gas mixing pipe. The flow rate of each mass flow controller was se computer to get different concentrations of mixture gas. The standard gases used in work were high-purity nitrogen (N2 ≥ 99.999%, H2O ≤ 3 ppm, CO2 ≤ 1 ppm, Chem Center of Fudan University, Shanghai, China), standard 3040 ppm CH4 gas (Air Liq Shanghai, China), standard 311 ppm CH4 gas (Air Liquid, Shanghai, China), stand 3040 ppm C2H6 gas (Air Liquid, Shanghai, China), and standard 100 ppm CO2 gas Liquid, Shanghai, China).

Principle
The basic principle of the gas sensor is the Beer-Lambert law: air. The HWG was directly connected with the light source and detector by 3D printed waveguide splices without any focal lenses. The control module was mainly composed of the personal computer and the controller board (Infratech, FPI-EvalKit, Dresden, Germany). The controller board was connected through the computer to set the driving current of the light source and the measurement step of the FP filter detector, and receive the signal detected by the detector. The measurement wavelength step set in this work was 20 nm and 66 data points were collected over the wavelength range of 1300 nm. The time scanning across the whole spectrum was about 33 s. The gas dilution module was composed of three mass flow controllers (HORIBA, S600-BR222, Shanghai, China, with a 1% uncertainty) and a gas mixing pipe. The flow rate of each mass flow controller was set by computer to get different concentrations of mixture gas. The standard gases used in this work were high-purity nitrogen (N2 ≥ 99.999%, H2O ≤ 3 ppm, CO2 ≤ 1 ppm, Chemical Center of Fudan University, Shanghai, China), standard 3040 ppm CH4 gas (Air Liquid, Shanghai, China), standard 311 ppm CH4 gas (Air Liquid, Shanghai, China), standard 3040 ppm C2H6 gas (Air Liquid, Shanghai, China), and standard 100 ppm CO2 gas (Air Liquid, Shanghai, China).

Principle
The basic principle of the gas sensor is the Beer-Lambert law:

Principle
The basic principle of the gas sensor is the Beer-Lambert law: where v is the frequency of incident infrared light (cm −1 ), A is the absorbance (dB), I 0 is the intensity of incident light, I t is the intensity of transmitted light, K is the absorption cross-section (cm 2 /molecule), L is the optical path length (cm), and C is the concentration of gas (molecule/cm 3 ). Figure 3 shows the absorption spectra of three single-gas samples and their mixture sample measured by the established sensing system. CH 4 and C 2 H 6 have great interference in the wavelength range of 3.2~3.6 µm, and CO 2 has little interference with the other two gases. Hence, CO 2 can be detected directly around the 4.3 µm wavelength. The absorption spectra of CH 4 and C 2 H 6 are highly overlapping and cannot be detected directly, so a nonlinear fitting algorithm must be used to correct the interference of CH 4 and C 2 H 6 . In this paper, the PCA-BP neural network algorithm was used to obtain the concentrations of the two gases from the interference mixed gas absorption spectra.
where v is the frequency of incident infrared light (cm −1 ), A is the absorbance (dB), I0 is the intensity of incident light, I is the intensity of transmitted light, K is the absorption crosssection (cm 2 /molecule), L is the optical path length (cm), and C is the concentration of gas (molecule/cm 3 ). Figure 3 shows the absorption spectra of three single-gas samples and their mixture sample measured by the established sensing system. CH4 and C2H6 have great interference in the wavelength range of 3.2~3.6 μm, and CO2 has little interference with the other two gases. Hence, CO2 can be detected directly around the 4.3 μm wavelength. The absorption spectra of CH4 and C2H6 are highly overlapping and cannot be detected directly, so a nonlinear fitting algorithm must be used to correct the interference of CH4 and C2H6. In this paper, the PCA-BP neural network algorithm was used to obtain the concentrations of the two gases from the interference mixed gas absorption spectra. According to the Beer-Lambert law, when the scattering and the influence of the system are not considered, the absorbance A is proportional to the concentration C. Therefore, the concentration C can be calculated from the absorption spectra directly. In the interference mixed gas spectra, the absorbance A of the spectra is not linear to the concentrations of CH4 and C2H6. This is because the components of the mixture sample have the interaction and the instrument has background noise. The BP neural network can approximate some nonlinear relation functions well, so it was applied to obtain the relationship between absorbance A and concentrations of CH4 and C2H6. However, the number of data points for absorption A is too large, which leads to the long training time. Therefore, PCA was used to reduce the dimensions of absorbance A.
PCA is a dimensionality reduction method, which aims to replace many variables with fewer variables and can reflect most of the information of the original many variables.
For the sample Xn×p with p variables and n data, the covariance matrix Σp×p can be calculated. According to the covariance matrix, p eigenvalues can be calculated and sorted from large to small λ1, λ2… λP, p eigenvectors can also be calculated and sorted from large to small T1, T2… Tp. Then, the ith principal component Yi is as follows: According to the Beer-Lambert law, when the scattering and the influence of the system are not considered, the absorbance A is proportional to the concentration C. Therefore, the concentration C can be calculated from the absorption spectra directly. In the interference mixed gas spectra, the absorbance A of the spectra is not linear to the concentrations of CH 4 and C 2 H 6 . This is because the components of the mixture sample have the interaction and the instrument has background noise. The BP neural network can approximate some nonlinear relation functions well, so it was applied to obtain the relationship between absorbance A and concentrations of CH 4 and C 2 H 6 . However, the number of data points for absorption A is too large, which leads to the long training time. Therefore, PCA was used to reduce the dimensions of absorbance A.
PCA is a dimensionality reduction method, which aims to replace many variables with fewer variables and can reflect most of the information of the original many variables.
For the sample X n×p with p variables and n data, the covariance matrix Σ p×p can be calculated. According to the covariance matrix, p eigenvalues can be calculated and sorted from large to small λ 1 , λ 2 . . . λ P , p eigenvectors can also be calculated and sorted from large to small T 1 , T 2 . . . T p . Then, the ith principal component Y i is as follows: There are p variables in the original sample, and the number of variables will be greatly reduced after principal component analysis. The number of principal components shall be selected according to the principal component contribution rate and cumulative contribution rate. The contribution rate of the kth principal component is as follows: Generally, the greater the contribution rate of the principal component, the more information about the original data is saved. The cumulative contribution rate of the first m principal components of the sample is as follows: The cumulative contribution rate is the standard to judge the number of selected principal components, and also reflects the retention of original information by these principal components.
BP neural network is a neural network model trained by error back propagation. It can realize any nonlinear mapping, so it is very suitable for solving the nonlinear absorption effect of multi-gas. BP neural network includes input layer, hidden layer, and output layer, as shown in Figure 4. The calculation process of the BP neural network is forward, from the input layer to the hidden layer and then to the output layer. If the results of the output layer cannot reach the expected value, then error calculation and parameter correction will be carried out. This step is performed through reverse propagation to minimize the error of the output results, so as to obtain the trained BP neural network model. There are p variables in the original sample, and the number of variables will be greatly reduced after principal component analysis. The number of principal components shall be selected according to the principal component contribution rate and cumulative contribution rate. The contribution rate of the kth principal component is as follows: Generally, the greater the contribution rate of the principal component, the more information about the original data is saved. The cumulative contribution rate of the first m principal components of the sample is as follows: The cumulative contribution rate is the standard to judge the number of selected principal components, and also reflects the retention of original information by these principal components.
BP neural network is a neural network model trained by error back propagation. It can realize any nonlinear mapping, so it is very suitable for solving the nonlinear absorption effect of multi-gas. BP neural network includes input layer, hidden layer, and output layer, as shown in Figure 4. The calculation process of the BP neural network is forward, from the input layer to the hidden layer and then to the output layer. If the results of the output layer cannot reach the expected value, then error calculation and parameter correction will be carried out. This step is performed through reverse propagation to minimize the error of the output results, so as to obtain the trained BP neural network model. Let input X have k variables x1, x2… xk, so the number of input layer nodes is k. Let the weight matrix be W, and the offset value be B. The nonlinear mapping is realized through the excitation function. The excitation function used in this paper is the sigmoid function, as shown in Equation (5): The output value O of the neural network node is shown in Equation (6): In the process of error back propagation, the Levenberg-Marquardt algorithm is used to update the weight matrix and offset value of the hidden layer and output layer, so as to achieve the trained BP neural network model. Let input X have k variables x 1 , x 2 . . . x k , so the number of input layer nodes is k. Let the weight matrix be W, and the offset value be B. The nonlinear mapping is realized through the excitation function. The excitation function used in this paper is the sigmoid function, as shown in Equation (5): The output value O of the neural network node is shown in Equation (6): In the process of error back propagation, the Levenberg-Marquardt algorithm is used to update the weight matrix and offset value of the hidden layer and output layer, so as to achieve the trained BP neural network model.

Performance of the Sensor for Single Gas
The performance of the system for single gas detection was evaluated by introducing three single gases at different concentrations into the system, respectively. As shown in  Figure 5a, the concentration of CO 2 varied from 0 ppm to 50 ppm using the gas dilution module. The absorption peak areas over the spectral range of 4.2~4.4 µm were recorded. Each absorption spectrum was measured five times and the average value of the absorption spectrum was used. The absorbance area is linear to the CO 2 concentrations, as shown in Figure 5b. The linear relationship is expressed by Equation (7) with the R square value of 0.9982, as follows: with A and c denoting the CO 2 absorbance area and the CO 2 concentration, respectively.

Performance of the Sensor for Single Gas
The performance of the system for single gas detection was evaluated by introducing three single gases at different concentrations into the system, respectively. As shown in Figure 5a, the concentration of CO2 varied from 0 ppm to 50 ppm using the gas dilution module. The absorption peak areas over the spectral range of 4.2~4.4 µ m were recorded. Each absorption spectrum was measured five times and the average value of the absorption spectrum was used. The absorbance area is linear to the CO2 concentrations, as shown in Figure 5b. The linear relationship is expressed by Equation (7) with the R square value of 0.9982, as follows: with A and c denoting the CO2 absorbance area and the CO2 concentration, respectively. Then, the CO2 sample with a concentration of 0 ppm was injected into the HWG to observe the stability of the whole system. 317 sets of data were collected in 3 h. Allan variance analysis was applied to evaluate the detection limit of the system, as shown in Figure 5c. The Allan deviation for CO2 detection is 114 ppb at an averaging time of 297 s.
Using the same experimental approach, the absorption spectra measured for different concentrations of CH4 (with CH4 concentration varying from 0 ppm to 217.7 ppm, the variation interval was 31.1 ppm) are shown in Figure 6a. Figure 6b shows the linear fitting between absorbance area and CH4 concentrations. The R square value is 0.9976 and the fitting function is expressed as follows: As shown in Figure 6c, the Allan deviation for CH4 detection is 2.59 ppm at an averaging time of 429 s. Then, the CO 2 sample with a concentration of 0 ppm was injected into the HWG to observe the stability of the whole system. 317 sets of data were collected in 3 h. Allan variance analysis was applied to evaluate the detection limit of the system, as shown in Figure 5c. The Allan deviation for CO 2 detection is 114 ppb at an averaging time of 297 s.
Using the same experimental approach, the absorption spectra measured for different concentrations of CH 4 (with CH 4 concentration varying from 0 ppm to 217.7 ppm, the variation interval was 31.1 ppm) are shown in Figure 6a. Figure 6b shows the linear fitting between absorbance area and CH 4 concentrations. The R square value is 0.9976 and the fitting function is expressed as follows: The absorption spectra measured for different concentrations of C2H6 (with C2H6 concentration varying from 0 ppm to 1216 ppm, the variation interval was 152 ppm) are shown in Figure 7a. Figure 7b shows the linear fitting between absorbance area and C2H6 concentrations. The R square value is 0.9996 and the fitting function is expressed as follows: 2 6 = 0.0145 * 2 6 + 0.1800 (9) As shown in Figure 6c, the Allan deviation for CH 4 detection is 2.59 ppm at an averaging time of 429 s. The absorption spectra measured for different concentrations of C 2 H 6 (with C 2 H 6 concentration varying from 0 ppm to 1216 ppm, the variation interval was 152 ppm) are shown in Figure 7a. Figure 7b shows the linear fitting between absorbance area and C 2 H 6 concentrations. The R square value is 0.9996 and the fitting function is expressed as follows: The absorption spectra measured for different concentrations of C2H6 (with C2H6 concentration varying from 0 ppm to 1216 ppm, the variation interval was 152 ppm) are shown in Figure 7a. Figure 7b shows the linear fitting between absorbance area and C2H6 concentrations. The R square value is 0.9996 and the fitting function is expressed as follows: 2 6 = 0.0145 * 2 6 + 0.1800 (9) As shown in Figure 7c, the Allan deviation for C2H6 detection is 926 ppb at an averaging time of 462 s. The result shows that the low-cost NDIR system, based a commercial infrared light source and a FP detector, achieves ppb-level and ppm-level gas detection. It has excellent gas sensing performance. Therefore, it has the advantages of high accuracy of TDLAS and low cost of NDIR.

Performance of the Sensor with Measured Mixed Gases
A PCA-BP neural network algorithm was used to solve the interference of CH4 and C2H6. It needs absorption spectra of mixed gases samples for training. In this paper, the concentration of CH4 was set from 0 to 1824 ppm and the concentration of C2H6 was set from 0 to 912 ppm, respectively. In total, there were 49 different concentration groups of mixed gas samples measured. Figure 8a shows the specific concentration distribution of each mixed sample. The absorption spectra of different concentrations of mixed gases are shown in Figure 8b. As shown in Figure 7c, the Allan deviation for C 2 H 6 detection is 926 ppb at an averaging time of 462 s.
The result shows that the low-cost NDIR system, based a commercial infrared light source and a FP detector, achieves ppb-level and ppm-level gas detection. It has excellent gas sensing performance. Therefore, it has the advantages of high accuracy of TDLAS and low cost of NDIR.

Performance of the Sensor with Measured Mixed Gases
A PCA-BP neural network algorithm was used to solve the interference of CH 4 and C 2 H 6 . It needs absorption spectra of mixed gases samples for training. In this paper, the concentration of CH 4 was set from 0 to 1824 ppm and the concentration of C 2 H 6 was set from 0 to 912 ppm, respectively. In total, there were 49 different concentration groups of mixed gas samples measured. Figure 8a shows the specific concentration distribution of each mixed sample. The absorption spectra of different concentrations of mixed gases are shown in Figure 8b.
There were 66 spectra data points over the whole wavelength range from 3.1~4.4 µm. Because the absorption band of CO 2 was from 4.2~4.4 µm, the spectra data range of 3.2~4.0 µm was chosen for the PCA-BP neural network algorithm, which comprised 41 spectral data points. Then, the spectral data points were processed with dimensionality reduction using the PCA algorithm. The contribution rates of the first four principal components are 99.4376%, 0.5598%, 0.0016%, and 0.0003%, respectively, which are more than 99.99% in total. Therefore, the first four principal components are selected to replace the original 41 spectral data points.
After dimension reduction, BP neural network training was carried out. This paper used a three-layer BP neural network. The input was four nodes, that was, four principal component components, and the output was two nodes, that was, the concentrations of CH 4 and C 2 H 6 . Four hidden layer nodes were selected, the Levenberg-Marquardt algorithm was used for model error training iteration, and the Sigmoid function was used as excitation function. In order to verify the model, leave-one-out cross-validation was used to train and test the 49 groups of measured spectral data, and the validation results are shown in Figure 9. The root mean square error of calibration (RMSEC) and the root mean square error of prediction (RMSEP) were used as the main evaluation indexes of model accuracy for fitting and predicting. The smaller RMSEC value means the higher fitting accuracy of the model, and the smaller RMSEP value means the higher predicted accuracy of the model.
where n is the number of samples of the training set, m is the sample of the verification set, C i is the real measured concentrations of the samples, and C i is the predicted concentrations of the samples. There were 66 spectra data points over the whole wavelength range from 3.1~4.4 µ m. Because the absorption band of CO2 was from 4.2~4.4 µ m, the spectra data range of 3.2~4.0 µ m was chosen for the PCA-BP neural network algorithm, which comprised 41 spectral data points. Then, the spectral data points were processed with dimensionality reduction using the PCA algorithm. The contribution rates of the first four principal components are 99.4376%, 0.5598%, 0.0016%, and 0.0003%, respectively, which are more than 99.99% in total. Therefore, the first four principal components are selected to replace the original 41 spectral data points.
After dimension reduction, BP neural network training was carried out. This paper used a three-layer BP neural network. The input was four nodes, that was, four principal component components, and the output was two nodes, that was, the concentrations of CH4 and C2H6. Four hidden layer nodes were selected, the Levenberg-Marquardt algorithm was used for model error training iteration, and the Sigmoid function was used as excitation function. In order to verify the model, leave-one-out cross-validation was used to train and test the 49 groups of measured spectral data, and the validation results are shown in Figure 9. The root mean square error of calibration (RMSEC) and the root mean square error of prediction (RMSEP) were used as the main evaluation indexes of model accuracy for fitting and predicting. The smaller RMSEC value means the higher fitting accuracy of the model, and the smaller RMSEP value means the higher predicted accuracy of the model.
where n is the number of samples of the training set, m is the sample of the verification set, Ci is the real measured concentrations of the samples, and Ci′ is the predicted concentrations of the samples. The RMSEC of CH4 was 1.42 ppm and the RMSEC of C2H6 was 0.26 ppm. The RMSEP of CH4 was 10.97 ppm, and that of C2H6 was 2.00 ppm. It could be seen that the PCA-BP neural network algorithm can be well applied in this system to solve the problem of CH4 and C2H6 interference.

Simulation-Aid Training
Although using the PCA-BP neural network algorithm could effectively solve the problem of CH4 and C2H6 interference, it needs to measure a large number of samples for training to obtain a great neural network. To improve efficiency, this paper attempted to use a large number of simulation samples for aid training. In addition, the simulation samples are established on a small number of measured samples.
First, the absorption line intensity and other parameters of CH4 and C2H6 were down- The RMSEC of CH 4 was 1.42 ppm and the RMSEC of C 2 H 6 was 0.26 ppm. The RMSEP of CH 4 was 10.97 ppm, and that of C 2 H 6 was 2.00 ppm. It could be seen that the PCA-BP neural network algorithm can be well applied in this system to solve the problem of CH 4 and C 2 H 6 interference.

Simulation-Aid Training
Although using the PCA-BP neural network algorithm could effectively solve the problem of CH 4 and C 2 H 6 interference, it needs to measure a large number of samples for training to obtain a great neural network. To improve efficiency, this paper attempted to use a large number of simulation samples for aid training. In addition, the simulation samples are established on a small number of measured samples.
First, the absorption line intensity and other parameters of CH 4 and C 2 H 6 were downloaded from the Hitran database and converted into absorption cross-section data. After the optical path length was determined, the important parameters of simulation, such as window size, fineness, and divergence angle of light source, were inversely deduced from the measured absorption spectra of a known concentration gas. In this paper, the measured absorption spectra of CH 4 at 1824 ppm were selected as the reference to obtain the simulation parameters. The comparison between the simulated absorption spectra and the measured absorption spectra is shown in Figure 10a. Then, only the CH 4 concentration was changed to obtain the CH 4 simulated absorption spectra at different concentrations. The comparison between the simulated absorption spectra and the measured absorption spectra are shown in Figure 10b. The concentration variation range was 0~1824 ppm, and the variation interval was 304 ppm.
Using the same simulated approach, the comparison between the measured absorption spectra and the simulated absorption spectra of C 2 H 6 are shown in Figure 11. The concentration variation range was 0~912 ppm, and the variation interval was 152 ppm. The RMSEC of CH4 was 1.42 ppm and the RMSEC of C2H6 was 0.26 ppm. The RMSEP of CH4 was 10.97 ppm, and that of C2H6 was 2.00 ppm. It could be seen that the PCA-BP neural network algorithm can be well applied in this system to solve the problem of CH4 and C2H6 interference.

Simulation-Aid Training
Although using the PCA-BP neural network algorithm could effectively solve the problem of CH4 and C2H6 interference, it needs to measure a large number of samples for training to obtain a great neural network. To improve efficiency, this paper attempted to use a large number of simulation samples for aid training. In addition, the simulation samples are established on a small number of measured samples.
First, the absorption line intensity and other parameters of CH4 and C2H6 were downloaded from the Hitran database and converted into absorption cross-section data. After the optical path length was determined, the important parameters of simulation, such as window size, fineness, and divergence angle of light source, were inversely deduced from the measured absorption spectra of a known concentration gas. In this paper, the measured absorption spectra of CH4 at 1824 ppm were selected as the reference to obtain the simulation parameters. The comparison between the simulated absorption spectra and the measured absorption spectra is shown in Figure 10a. Then, only the CH4 concentration was changed to obtain the CH4 simulated absorption spectra at different concentrations. The comparison between the simulated absorption spectra and the measured absorption spectra are shown in Figure 10b. The concentration variation range was 0~1824 ppm, and the variation interval was 304 ppm.  Using the same simulated approach, the comparison between the measured absorption spectra and the simulated absorption spectra of C2H6 are shown in Figure 11. The concentration variation range was 0~912 ppm, and the variation interval was 152 ppm. Considering the interference of CH4 and C2H6, the mixed simulation absorption spectra data of CH4 and C2H6 cannot be directly obtained from the linear superposition of their single gas absorption spectra. The interference coefficient shall be introduced within the peak interference range of CH4 and C2H6, so the formula for calculating the mixed simulation absorption spectral data was as follows: ( ) = { ( 4 ( ) + 2 6 ( )) * (1 + ( )), 3.22 < < 3.62 4 ( ) + 2 6 ( ), Figure 11. Comparison of measured and simulated absorption spectra of C 2 H 6 at different concentrations.
Considering the interference of CH 4 and C 2 H 6 , the mixed simulation absorption spectra data of CH 4 and C 2 H 6 cannot be directly obtained from the linear superposition of their single gas absorption spectra. The interference coefficient shall be introduced within the peak interference range of CH 4 and C 2 H 6 , so the formula for calculating the mixed simulation absorption spectral data was as follows: where S(λ) was the interference coefficient which could be obtained from several measured mixed absorption spectra and the corresponding CH 4 -C 2 H 6 superimposed absorption spectra. The value was as follows: We compared the simulated mixed gas absorption spectra obtained according to Equation (12) with the measured mixed gas absorption spectra as shown in Figure 12. The simulated absorption spectra agreed well with the measured absorption spectra. In order to save time, we used simulated absorption spectra to aid in training. The 49 groups of simulated absorption spectra were used as the training set, and the 49 groups of measured mixed gas absorption spectra data were used as the test set. After dimension reduction by PCA and BP neural network training, the training results were shown in Figure 13. The RMSEP of CH4 was 34.99 ppm and the RMSEP of C2H6 was 3.53 ppm. It can be observed that the RMSEP is larger than that obtained by training with measured spectra data. This is because there is an error between the simulated absorption spectra and the measured absorption spectra. However, using simulated absorption spectra greatly reduced the time cost. Therefore, in some applications that do not require high accuracy, the simulated absorption spectra can be used to replace the measured ones for CH4-C2H6 BP neural network training. The trained neural network can be applied to mixed gas concentration detection, greatly saving time. The 49 groups of simulated absorption spectra were used as the training set, and the 49 groups of measured mixed gas absorption spectra data were used as the test set. After dimension reduction by PCA and BP neural network training, the training results were shown in Figure 13. The RMSEP of CH 4 was 34.99 ppm and the RMSEP of C 2 H 6 was 3.53 ppm. It can be observed that the RMSEP is larger than that obtained by training with measured spectra data. This is because there is an error between the simulated absorption spectra and the measured absorption spectra. However, using simulated absorption spectra greatly reduced the time cost. Therefore, in some applications that do not require high accuracy, the simulated absorption spectra can be used to replace the measured ones for CH 4 -C 2 H 6 BP neural network training. The trained neural network can be applied to mixed gas concentration detection, greatly saving time.
ppm. It can be observed that the RMSEP is larger than that obtained by training with measured spectra data. This is because there is an error between the simulated absorption spectra and the measured absorption spectra. However, using simulated absorption spectra greatly reduced the time cost. Therefore, in some applications that do not require high accuracy, the simulated absorption spectra can be used to replace the measured ones for CH4-C2H6 BP neural network training. The trained neural network can be applied to mixed gas concentration detection, greatly saving time. Then, a number of measured absorption spectra data were added into the 49 groups of simulated absorption spectra as the training set. Each training set was trained five times, and the training results are shown in Figure 14a,b. The RMSEP showed a downward trend with the increase in the number of measured spectra data, and between the Then, a number of measured absorption spectra data were added into the 49 groups of simulated absorption spectra as the training set. Each training set was trained five times, and the training results are shown in Figure 14a,b. The RMSEP showed a downward trend with the increase in the number of measured spectra data, and between the RMSEP obtained by training with only measured spectra data and only simulated spectra data.
Sensors 2023, 23, 1413 12 RMSEP obtained by training with only measured spectra data and only simulated spe data.

Conclusions
In this paper, we developed a CH4-C2H6-CO2 multi-gas sensing system using a N system. We first studied the detection limit of the system for single gas and found tha detection limit of CO2 was 114 ppb at an averaging time of 297 s, that of CH4 was 2.59 at an averaging time of 429 s, and that of C2H6 was 926 ppb at an averaging time of 4 Because the absorption spectra of CH4 and C2H6 are highly overlapped, the PCA-BP a rithm is used to obtain the concentrations of CH4 and C2H6 in the mixed gas. The RM of CH4 and C2H6 were 10.97 ppm and 2.00 ppm, respectively. Because the PCA-BP a rithm needs a lot of measured samples for training, it costs a lot of manpower and t Therefore, this paper proposed a simulation-aid training method, which attempted to a small number of measured samples to simulate a large number of simulation spectr aid-training. The RMSEP of CH4 and C2H6 were 34.99 ppm and 3.53 ppm when the si lated spectra data were used for training. The gas sensing system proposed in this paper used an infrared broad-spectrum source and an FP detector, and both of them are commercially available compon HWG served as the transmission medium and gas absorption cell simultaneously. It

Conclusions
In this paper, we developed a CH 4 -C 2 H 6 -CO 2 multi-gas sensing system using a NDIR system. We first studied the detection limit of the system for single gas and found that the detection limit of CO 2 was 114 ppb at an averaging time of 297 s, that of CH 4 was 2.59 ppm at an averaging time of 429 s, and that of C 2 H 6 was 926 ppb at an averaging time of 462 s. Because the absorption spectra of CH 4 and C 2 H 6 are highly overlapped, the PCA-BP algorithm is used to obtain the concentrations of CH 4 and C 2 H 6 in the mixed gas. The RMSEP of CH 4 and C 2 H 6 were 10.97 ppm and 2.00 ppm, respectively. Because the PCA-BP algorithm needs a lot of measured samples for training, it costs a lot of manpower and time. Therefore, this paper proposed a simulation-aid training method, which attempted to use a small number of measured samples to simulate a large number of simulation spectra for aid-training. The RMSEP of CH 4 and C 2 H 6 were 34.99 ppm and 3.53 ppm when the simulated spectra data were used for training. The gas sensing system proposed in this paper used an infrared broad-spectrum light source and an FP detector, and both of them are commercially available components. HWG served as the transmission medium and gas absorption cell simultaneously. It was directly coupled with the source and detector without any optical components. It greatly improves the stability and portability of the system. Owing to the low-loss property of the HWG, a longer optical path becomes possible, and the performance of the system is improved. The cost of the system is less than 1000 USD. Table 1 summaries the related research using infrared spectroscopy for multi-gas detection. Compared to the TDLAS system, the system in this work has the advantages of a low cost and simple structure. Compared to other NDIR systems, it has a higher accuracy and lower detection error.  Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author upon reasonable request.