Quartz crystal microbalance based electronic nose system implemented on Field Programmable Gate Array

Nowadays, an electronic nose becomes an important tool for detecting gas. The electronic nose consists of gas sensor array combined with neural networks to recognize patterns of the sensor array. Currently, the implementation of the neural network on the electronic nose systems still use personal computer so that less flexible or not portable. This paper discusses the electronic nose system implemented in a Field Programmable Gate Array (FPGA). The sensor array consists of eight Quartz Crystal Microbalance (QCM) coated with chemical materials. The eight channel-frequency counter is used to measure the frequency change of the sensor due to the presence of gas adsorbed to the surfaces. The bipolar sigmoid activation function used in the neuron model is approximated by a second order equation. The experimental result showed that the electronic nose system could recognize all the types of gas with 92% success rate.


Introduction
The electronic nose system has been widely applied in broad variety of fields, such as for monitoring coffee quality [1], plant disease diagnosis [2], fruit classification [3] and air monitoring [4]. This system consists of a sensor array combined with pattern recognition algorithm to identify the gas. Currently, electronic nose systems still use computers [5], which are less flexible and are not portable.
In recent years, there have been studied several gas sensors with different working principles, such as electro-chemical sensors [6], metal oxide semiconductor sensors [7,8], ratio metric fluorescence sensors [9], fiber optic sensors [10,11], and Quartz Crystal Microbalance (QCM) [12,13]. Compared with other gas sensors, QCM sensors are simple, cheap, small, and high sensitive to the weight of molecules.
Field Programmable Gate Array (FPGA) has recently expanded the structure with the presence of digital signal processing [14,15]. FPGA technology makes it easy to reconfigurable, reprogrammable with low cost advantages, and easy to integrate [16]. In many applications, FPGA can be used in implementing pattern recognition algorithms, such as SOM-Hebb . In this study, we have implemented electronic nose on FPGA using polymer coated QCM sensor array. Some of the gases used as sample material are kerosene, gasoline, ammonia, and ethanol. The second order function model is used as an activation function in the neural network pattern recognition.

Research Method
Quartz resonator sensor has high sensitivity to the gas molecules adsorbed to the electrodes shown in Figure 1. This will change the oscillation frequency of the quartz resonator, defined as (1): where Δf is the observed frequency shift (Hz), Δm is the mass change per unit area (g/cm 2 ), ρ is the crystal density, v is the velocity of acoustic wave propagation in quartz crystal, A is the surface area (cm 2 ). By using a time delay of one second, it allows to measure the frequency change with a resolution of 1 Hz. The frequency counter block can be constructed from several flip-flop circuits, such as D, RS, or JK Flip-flops. In VHDL code, frequency counter is designed with 24 bits using behaviour architecture.
The neural network architecture used in this study consists of three layers shown in Figure 3. This network consists of 8 nodes in the input layer, 10 neurons in the hidden layer, and 2 neurons in the output layer. Generally, the supervised neural network algorithms are using MLP with back propagation learning method. The hidden neuron is expressed by: the neuron output is expressed by: Xilinx ISE software is used in synthesis and compilation of VHDL code. Selection of data types affects the compilation performance. The compilation process will have many problems when the (2) and (3) where, β and θ are used to adjust the slope and gain of non-linear functions. The equation can be written as: to approximate the sigmoid equation, we get θ = 1/L 2 and β = 2/L, with L = 4 and then a slightly modify the equation to be: An integer type is suggested in this design to approach floating-point operation. Therefore, all numbers need to be changed in the form of integer values with multiplying by 1024, which the steps can be written as: a. Normalization of the inputs x 1 , x 2 , ... the VHDL code for the LCD driver follows the LCD vendor's instructions. Hitachi LCD is used on this system with the two 4-bit operations of data transfer. In order to connect to the Input/Output ports of the FPGA, the result of the each block must be converted into a standard logic vector type.

Results and Analysis
The electronic nose system has been implemented on Spartan 3E XC3S1600E-5FG320 starter kit board.The FPGA module consists of two RS232 ports, a VGA port, 2x16 LCD, 10/100 Ethernet PHY, a 40 pin Hirose FX2 connector, 29,504 flip flops, 29.504 LUTs, 32M x 16 DDR SDRAM and thirty-six of multiplier 18x18.Prior to applying in the real system, the frequency counter is simulated on Xilinx ISE Software. The measurement of the frequency counter hardware is performed for 8-channels. The experimental result shows that this counter unit has an inter-channel cross talk of 0.0002%.The more channels there will be more interference between channels. In previous study, it was only used 2-channels with precision and stability of 1 Hz with TCXO oscillator [28]. Figure 4 (a) shows a comparison between the actual bipolar sigmoid and the second order functions; while Figure 4 (b) shows the bipolar sigmoidmultiplied by 1000 and the second order multiplied by 1024. The average error for the second order and the modified second order are 1.7% and 2.4%, respectively, as shown in Figure 4 (c). The results of the implementation of the second order function indicate that the number of Slices is 143, the number of 4 inputs of LUTs is 274, and the number of IOBs is 10. The summary of device utilization is still greater at 27%, and 31% for slices and LUTs, respectively, due to the implementation of LCD drivers. However, the use of 84% of IOBs is less than previous study using fixed-point arithmetic simulated in ModelSim [29].
if ( z net < 0 and z net > -4000) then z<= (532*z net + (72*z net *z net )/1024)/1024; elsif (z net < -4000) then z<= -1024; elsif (z net >= 0 and z net < 4000) then z<= (532*z net -(72*z net *z net )/1024)/1024; else z<= 1024; end if;  For data analysis, this system requires a computer to display the response of each sensor in real time shown in Figure 5. Figure 6 shows the patterns of the sensor array for any gases with different concentrations. The results of this experiment indicate the similarity of sensor pattern under varied gas concentration. Each gas provides a typical pattern of sensor response. These response patterns are then used as inputs on the neural network to recognize the type of gas.  Figure 5. The time response of QCM sensors exposed to ammonia vapor The training phase of the neural network is performed on a computer using backpropagation algorithm. For the iterations of 100,000 epochs, the network has a Mean Square Error (MSE) of 0.00005. The weights of the training phase are entered into the FPGA. The overall use of components in Slice of Flip Flop is 71% of 29,040; 4 inputs LUT is 68% of 29,040; Multiplier 18x18 is 75% of 36; and buffermultiplex is 41% of 24. In the testing phase, the neural network is introduced with forty data sets for all types of gases. The experimental result shows that the neural network has an average identification rate of 92% as shown in Table 1.

Conclusion
The electronic nose system based on a QCM sensor array and neural network pattern recognition has been constructed and implemented on the XC3S1600e FPGA board. The bipolar sigmoid activation function used in the neuron model is approximated by a second orderfunctionwith an error rate of 2.4%. The overall design of the system requires the use of slices and LUTs of 71%, and 68%, respectively. The results of the experiment indicate the similarity of sensor pattern to varied gas concentration. Each gas provides a typical pattern of sensor response. The neural network could recognize all the gases tested in the experiments with an identification rate of 92%.The use of the counter circuits in this experiment requires a sampling time of 1 second. To increase the respond time, a reciprocal frequency counter will be developed in this electronic nose system. The graphical LCD will be implemented to display the data in detail.