ANN-based signal conditioning and its hardware implementation of a nanostructured porous silicon relative humidity sensor

ANN-based signal conditioning and its hardware implementation of a nanostructured porous silicon relative humidity sensor

Sensors and Actuators B 120 (2006) 130–141 ANN-based signal conditioning and its hardware implementation of a nanostructured porous silicon relative ...

806KB Sizes 14 Downloads 190 Views

Sensors and Actuators B 120 (2006) 130–141

ANN-based signal conditioning and its hardware implementation of a nanostructured porous silicon relative humidity sensor T. Islam 1 , S. Ghosh, H. Saha ∗ IC Design and Fabrication Center, Department of E.T.C.E., Jadavpur University, Kolkata 700032, West Bengal, India Received 25 August 2005; received in revised form 31 January 2006; accepted 1 February 2006 Available online 29 March 2006

Abstract Porous silicon (PS) is a potential candidate for developing a low cost smart relative humidity sensor, but its main limitation is that the response is a nonlinear function of humidity, suffering from hysteresis and drift due to aging. The present work proposes novel ANN-based signal conditioning to compensate the nonlinearity and hysteresis errors of a PS humidity sensor by using a soft computing technique based on an adaptive linear (ADALINE) neural network. The proposed network is simple to implement and requires less hardware elements. The ANN model is implemented in hardware using a microcontroller (AT89C51) to make the sensor output be direct digital readout. Minimum calibrating data points necessary for developing the model for compensating the errors are also established. Experimental and simulation studies show that nonlinearity is reduced to 2.7% from its initial 13% while the hysteresis error is reduced to 3% from its initial 16% value for a typical PS humidity sensor. The outputs of a hardware-implemented circuit follow the results of simulation. The proposed signal conditioning can be extended for other sensors with and without hysteresis. © 2006 Elsevier B.V. All rights reserved. Keywords: Humidity sensing; Porous silicon sensor (PS); Nonlinearity and hysteresis error; Compensation of errors using ANN; Hardware implementation of ANN model using microcontroller

1. Introduction Humidity measurement is one of the important tasks in many industrial processes for manufacturing of products such as textiles, food, paper, semiconductors and petrochemical. Recently, it has been introduced into our daily life to make our living and working environments comfortable. To fulfill the needs of humidity sensing, low cost, mass producible and durable humidity sensors have been developed using different sensing materials like ceramic, aluminium oxide, polymer and porous silicon [1–3]. Both conductive as well as capacitive type humidity sensors have been developed. But the capacitive type humidity sensor is preferred because of its inherent immunity to surface contaminants caused by its exposure to dust and exhaust gases like NO2 , CO2 , etc. [4], and its relatively much lower temperature dependence [5]. In addition, its effective dielectric ∗

Corresponding author. Tel.: +91 33 24146217; fax: +91 33 24146217. E-mail addresses: [email protected] (T. Islam), [email protected] (S. Ghosh), [email protected] (H. Saha). 1 On leave from Electrical Engineering Department, J.M.I., New Delhi 110025, India. 0925-4005/$ – see front matter © 2006 Elsevier B.V. All rights reserved. doi:10.1016/j.snb.2006.02.001

constant changes significantly due to adsorption, diffusion and subsequent condensation of water vapor into water (very large dielectric constant ∼80), leading to a larger change in its capacitance value as compared to the change of conductance of a PS humidity sensor [2]. Recently, nanostructured porous silicon (PS) material has been established as a potential sensing material due to its many useful properties such as large surface to volume ratio (typically > 500 m2 /cm3 ), controlled nanoporous structure, CMOS compatibility for integration of sensor and signal processing units for smart sensor application and mass productivity [2,3,6]. Several gas, vapor, humidity, ppm level moisture and pressure sensors are developed using a PS sensing layer with controlled pore morphology [6–8]. The main interest in porous silicon sensors is that the morphology and hence sensitivity and selectivity to water vapor can easily be controlled by the formation parameters for the PS layer, such as current density, HF concentration and etching time [6]. However, a practical PS sensor exhibits nonidealities such as offset, nonlinearity and hysteresis in addition to the drift due to environmental effects. For humidity sensing application higher sensitivity is reported with low doped p-silicon having pore sizes in the range of 20–100 nm [9] and porosity in the range of 60–80% [6].

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

Widening the pore size in the PS structure by changing the formation parameters, the characteristics of the sensor like response time, nonlinearity and hysteresis can be improved to some extent but the larger pores affect the sensitivity of the sensor [10]. Secondly, by integrating a resistive heater around the sensing layer might solve the hysteresis problem partly, but the heating element will change the long-term stability of the sensor due to irreversible changes in capacitance and resistance of the PS sensor [1,11]. Further, commercial bulk production of humidity sensors would invariably lead to a wide range of porosity and pore size distributions with associated variation in the hysteresis and nonlinearity errors. Thus, a compensation technique based on soft computing is a more desirable option from the point of view of large-scale usage. In the signal conditioning approach, in addition to the correction of the common sources of errors like zero offset, interference to parasitic earth capacitance, fluctuation of input reference signal compensation for nonlinearity and hysteresis of the PS sensor can be realized by the hardware/software co-design. The signal processing technique for the error compensation can be either analog compensation or digital compensation or based on different soft computing techniques. Soft computing differs from conventional (hard) computing in that, unlike hard computing, it is tolerant of imprecision, uncertainty and partial truth to achieve tractability, robustness and low solution cost. The principal constituents of soft computing are fuzzy logic, neural network theory and probabilistic reasoning, genetic algorithms and chaos theory. Analog compensations are based on changing the actual analog signal transfer function by using digitally programmable arrays of resistors or capacitors. The disadvantages of the analog techniques are circuit complexity, limited resolution and lack of flexibility. Moreover, they have limited capabilities to handle nonlinearity and cross sensitivity problems [12,13]. Recently, piecewise linearization technique is employed to compensate the nonlinearity of a PS humidity sensor [2]. Because of their programmability, digital techniques utilize a microcontroller or field programming gate array (FPGA) chip to provide an accurate and flexible means for sensor response linearization and hysteresis error compensation and its subsequent integration of sensor and signal processing unit into the same chip. Here the correction factors for both an increase and a decrease in relative humidity (RH) are stored in the memory of the chip. These factors are then added or subtracted with the actual output to get the desired output. But the digital techniques have the limitation in case of recalibration, where either full rewriting of the lookup table and/or modification of the decoding function is needed [14,15]. Another widely used approach is software–hardware compensation where a compensating algorithm is developed by using software and it is finally hardware implemented by using a microcontroller/FPGA chip [14,15]. In the present paper, we propose an artificial neural network (ANN) based software technique to compensate the nonlinearity and the hysteresis errors of the PS sensor with an object to develop a humidity sensor using PS as a sensing material. To compensate the errors, a membrane type sensor structure having interdigitated contact electrodes on the top of the porous layer has been fabricated. Novel phase detection electronics has

131

been utilized to find the phase angle change of the predominantly capacitive PS sensor with the variation of the percentage relative humidity [16]. A low frequency sinusoidal signal is allowed to pass through the PS sensor. The phase angle changes due to changes in capacitance on adsorption of water vapor are compared with the initial signal using a comparator and an XOR gate. The output of the XOR gate is low pass filtered to obtain a DC voltage. The detection circuit compensates the initial voltage output under dry condition and the sensitivity due to the effect of parasitic earth capacitance. The temperature dependence is small compared to the dielectric sensitivity and thus has been neglected. A sensor model using an adaptive linear neural network was developed first with a view to compensate these errors and to verify the sensor signal processing design. The main advantage of the ANN approach for error compensation is that one need not to have full knowledge of the physics of the sensor. The behavior of the sensor is captured by measurements of input and output responses. An iterative procedure is applied over the measured data in order to get an expression utilized for error compensation. But for the physical model-based compensation, the main difficulty is the requirement of details of physics of the sensor influencing its behaviors which are not available always. The modeling of the sensor has been reported elsewhere [17]. ANN-based software techniques have been established as an effective means for compensating nonlinearity, temperature and hysteresis for humidity, pressure and temperature sensors [14–19]. However, an integrated ANN-based scheme incorporating hysteresis and nonlinearity compensations of nanocrystalline porous siliconbased humidity sensors have not been reported so far. Implementation of such scheme using a microcontroller chip along with the PS sensor leads to an integrated humidity sensor with highly sensitive, linearized and hysteresis compensated outputs. A suitable logic scheme for hardware implementation of the models using a microcontroller has also been developed. Studies have been made to establish the minimum calibrating data points required to obtain the desired accuracy in compensating both the errors. The simulation studies establish what will be the minimum experimental data points for accurately training the neural network [15]. 2. Experimental 2.1. Fabrication of PS sensor The porous silicon humidity sensor was fabricated on a p-type silicon wafer (2.5 cm × 2.5 cm × 0.5 mm), with 1 0 0 orientations and a resistivity of 1–2  cm by standard electrochemical etching in a HF-based electrolyte. The silicon wafer was first alkali polished in a 20% NaOH solution at 80 ◦ C. Then after acid cleaning in a 1:1 H2 O2 and H2 SO4 solution, the sample was cleaned in 10% HF solution. A special cell was utilized for the formation of the PS sensor. The cell had two separate chambers, one for a HF:CH3 OH electrolyte and other for a KCl solution. The silicon wafer acted as a seal between the front and rear side of the wafer. The front side was in contact with the HF solution and rear side was in contact with the KCl solution.

132

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

Fig. 1. Photograph of the PS sensor.

Rear side ohmic contact was been done by screen-printing of silver aluminium paste and its subsequent heating at 700 ◦ C for 45 s. The anodization of the sample was done with formation parameters of current density of 10 mA/cm2 , HF concentration of 48% and etching time of 7 min, respectively. The formation cell was PC interfaced with a data acquisition system card to precisely control the current density and etching time. The porosity of the PS sample was measured by gravimetric technique and was approximately 60%. The dimensions of silicon nanocrystals were in the range of ∼3–5 nm and thickness of the PS film was around 6–7 ␮m. Top co-planar interdigited parallel plate metal contacts were fabricated by screen printing of silver paste on the top of the PS layer. Spacing between the two interdigitated contact electrodes was 0.5 mm and dimension of each electrode was 4 mm × 2.5 mm. The contacts were thermally heated at 500 ◦ C for 40 s in inert N2 atmosphere to restrict the formation of oxide [20]. Further details of the formation of the PS sensor and its performance with variation of porosity and pore morphology are reported elsewhere [6]. Fig. 1 shows the photograph of the actual PS humidity sensor. 2.2. Sensor testing To stabilize the performance of the PS sensor, the freshly anodized sample was cleaned in deionized water immediately after anodization and then the sample was oxidized in a boiling H2 O2 solution for 5 min. The sensor was then cleaned thoroughly in deionized water again and was kept at normal atmosphere for several days. Initial oxidation in H2 O2 and subsequently storing in room temperature RH will stabilize the PS layer to a great extent [21]. Experiments were performed to obtain the response of the humidity sensor to the variation of percentage relative humidity. Fig. 2 shows the photograph of the experimental setup. Both the PS and standard humidity sensor (model QC 24ACC) were placed inside a vapor chamber of volume 2000 cm3 . Relative humidity of the chamber was monitored by the standard humidity sensor. The procedures were (a) the test moisture was injected into the chamber and exposed to the sensor, (b) the initial humidity was adjusted at 10% RH by the standard sensor, (c) the concentration of water vapor was

Fig. 2. Photograph of the experimental setup for humidity measurement.

increased from 10 to 95% RH gradually and the output voltage was measured, (d) RH was reduced gradually back to 10% and output voltage was again noted down and (e) the change of predominantly capacitive impedance of the PS sensor was detected by phase detection circuit. In the detection circuit, a reference sinusoidal signal of relatively low frequency (1 kHz) was allowed to pass through the PS sensor exposed to a certain RH level. Low frequency was used to improve the capacitive sensitivity and to reduce the role of parasitic components of capacitance arising from different junctions in the PS layer. It is also established that at low frequency the change in impedance with RH is predominantly capacitive [6,20]. The phase angle of the reference signal was shifted depending on the capacitive impedance of the sensor. The phase-shifted signal was compared with the input reference signal by using a comparator and an XOR gate. The output of the XOR gate was a pulse whose width was varied according to the RH in the chamber. The output of the XOR gate was low pass filtered for the dc voltage output. The detail working of the detection electronics circuit for converting the change in capacitive impedance in terms of voltage output was reported elsewhere [16]. At each measurement, sensors were allowed to reach equilibrium condition and then observation was noted. The response of the sensor for the variation of humidity from 10 to 95% and again from 95 to 10% is

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

Fig. 3. Plot of the response of the porous silicon humidity sensor with the variation of humidity (formation parameters: J = 10.5 mA/cm2 , HF = 48%, T = 7 min, working temperature = 33 ◦ C, frequency = 1 kHz).

shown in Fig. 3. The response of the sensor showed a nonlinear behavior as a function of RH. Further, it can be seen that sensitivities of the sensor both for increasing and decreasing order of %RH are different. This may be due to the fact that the rate of adsorption and desorption are not same. However, the output of the sensor was also affected by the morphology of the PS structure. To study the role of post-oxidation of the freshly prepared sensing layer on the stability, repeatability and aging of the sensor, the PS sensor after boiling in H2 O2 was kept in storage media like ambient air for several days. The transient response of the oxidized sensor was then studied experimentally for water at saturated vapor pressure (10–98% RH) for several consecutive cycles and the result is shown in Fig. 4. Desorption of water vapor during transient response was done by vacuum pump. The initial lower baseline shift of the response may be due to incomplete dynamic equilibrium of adsorption and desorption. If the sensor is allowed to desorb for a little more time then baseline shift may be eliminated. Otherwise, the offset adjustable resistance of the phase detection circuit reported in [16] needs to be finely tuned to take care of any minor shift in the baseline of the sensor reproducibility.

133

Fig. 5. Response and recovery time of the PS humidity sensor (frequency = 1 kHz).

Experiments were also performed to determine the response time of the sensor and the results are shown in Fig. 5. For response time determination the RH level in the chamber was suddenly increased to 90% of its maximum value and for recovery time determination the RH level was decreased suddenly to 10% of its maximum value. It is shown in Fig. 5 that the sensor reached its maximum RH within a few seconds but took another few seconds (∼10 s) to reach a stable value. Conversely, during evacuation the vapor concentration in the chamber decreased and the sensor took around 40 s to reach 10% of its maximum value. The sensitivity (S) of the sensor is defined as: S=

V0(90%) − V0(10%) , V0(10%)

where V0(90%) and V0(10%) are the voltage outputs at 90 and 10% RH of its maximum humidity, respectively. A very recent work investigated the interfering effect of NO2 gas on the sensitivity of the PS humidity sensor. It was observed that the sensitivity of NO2 gas in comparison to humidity was negligible [4]. Most of the works on gas sensing using the PS sensor are based on the conductivity change, but for the capacitive PS sensor where dielectric constant of the vapor plays an important role the interfering effect of NO2 gas will be negligible. Thus, there may be some sensitivity of capacitive humidity sensors to the adsorption of NO2 gas, but it should not have any major effect on the results reported in the present work. 2.3. Temperature dependence of the sensor

Fig. 4. Transient response of sensor for several humid (water) running cycles (frequency = 1 kHz).

The sensitivity of the sensor to temperature is another major source of sensitivity drift for many sensors [8]. However, the effect of temperature for the conducting type PS humidity sensor is much pronounced than for the capacitive type humidity sensor [5]. To observe the effect of sensitivity due to temperature the capacitive PS humidity sensor was put inside a vapor chamber with temperature and RH control. Using silica gel, the humidity of the chamber was reduced to very low concentration, and then temperature of the chamber was set at different values. The sensor was allowed to remain at the prescribed temperature for approximately 3 h, and by using an HP-4284A LCR

134

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

linearity of a sensor can be expressed as: % Nonlinearity =

Fig. 6. Variation of the capacitance of the sensor with temperature (HP-4284A, frequency = 1 kHz).

meter, the change in capacitance of the sensor due to temperature was measured. Variation of the capacitance with temperature is shown in Fig. 6. The capacitance variation of the sensor in the working range of temperature from 0 to 50 ◦ C increased almost linearly and it was of the order of few hundreds pF, while the variation of capacitance with humidity was of the order of tens of nF. Thus the effect of temperature on the capacitive humidity was almost negligible [9]. 3. Linearization of PS sensor’s output The PS humidity sensor output is a nonlinear function of relative humidity, but it is preferable that the sensor output should be linear for direct digital readout and on the chip interface. This section proposes an ANN-based technique for linearizing the sensor characteristics of the PS humidity sensor. The actual sensor response as well as the desired linear approximated response for both increasing and decreasing humidity is shown in Fig. 7. Nonlinearity of the PS humidity sensor is defined as the maximum deviation of the actual sensor output from the straight-line relationship obtained joining two extreme points [22]. The non-

Fig. 7. Plot of actual and desired linear voltage outputs of the PS sensor for the various percentages humidity.

max(V − Vlin ) × 100 Vmax

(1)

where V is the voltage output of the sensor at a particular RH, Vlin the linear approximated sensor output at the same RH level and Vmax is the maximum voltage output for the maximum RH exposed to the sensor. The nonlinearity of the sensor output shown in Fig. 7 was determined by using the Eq. (1) and it was approximately 13%. The desired linear response of the sensor output is also shown in Fig. 7. However, if we compare the sensor output for a decrease in RH with its value in the linear curve, the maximum deviation of the sensor output for the decrease in RH is reduced. Thus, it is observed that if the sensor output for an increase in RH is approximately linearized, then the deviation of the sensor output for a decrease in RH is automatically reduced. However, further compensation is required for minimizing the hysteresis error to an acceptable level. For linearization of the sensor characteristics, the sensor output was connected in cascade with an ADALINE (adaptive linear) neural model. The input to the ADALINE network was the sensor voltage output for an increase in RH and desired output of the neural network was the approximate linear value. The desired linear approximation of the model can be given as: Vout = mRH + k

(2)

where Vout is the linear response of the sensor, m the slope, k is constant and again V = f(RH) and RH = f−1 (V), where V is the voltage output, which is a nonlinear function of humidity. From Eq. (2), the response of an ANN model can be represented in power series as: Vann =

k 

ci V i

(3)

i=0

where Vann is the actual output of the network and ci is the ith coefficient (weights of the network). The coefficients of the basis function represent the characteristics of the sensor for linear response. The task of the ADALINE model is to determine the coefficients ci such that the output of the model is approximately linear. The main idea of using ADALINE for determining the coefficients of the polynomial function is to perform functional expansion at the input layer for increasing the computational power of ANN. Here, instead of applying the sensor output V directly as a single input to the network, the multiple inputs obtained by expanding V as a polynomial function involving terms [1, V, V2 , . . ., Vn ] as applicable are utilized. By functional expansion, the output of the ANN network correctly represents a polynomial function and the ANN weights of the network are nothing but the coefficients of the polynomial function. This implies that with such type of input vector, the learning capability and efficiency of the neural network can be improved further [15,23]. Fig. 8(a) shows the schematic model and Fig. 8(b) shows the structure of the network. It is a simple single neuron network with a linear activation function. For an nth order model, inputs are [1, V, V2 , V3 , . . ., Vn ] and the connecting weights to the neu-

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

135

Fig. 8. (a) Schematic drawing of the sensor linearization network and (b) structure of the network.

ron are [W0 , W1 , W2 , . . ., Wn ]. The weighted sum of the inputs is the actual output of the network (which is an nth order polynomial function). The ANN weights are updated iteratively by a least mean square (LMS) algorithm by comparing the network output with desired voltage till the error goal is reached. Once the network is trained, the weights can estimate the output of the network. These weights of the network play an important role for obtaining the approximate linear output. 3.1. α-LMS algorithm The proposed ADALINE network used the Widrow–Hoff (LMS) learning algorithm based on the steepest descent procedure adjusting its weights and biases to minimize the mean squared error [15]. The idea is that during learning, new information must be injected into the network without losing the previous knowledge. The weight updating equation during training of ␣-LMS algorithm can be written as: Wk+1 = Wk + αεk

Xk |Xk |2

(4)

where the weight vector W and the normalized input vector X for the nth order polynomial function can be given as: W = [c0 , c1 , c2 , . . . , cn ]T T

X = [1, V, V 2 , . . . , V n ]

(5)

where k is the iteration, Wk the weight vector at the kth iteration and Wk+1 is the updated weight vector at (k + 1)th iteration. The

error at kth iteration is given as: εk = Vk − WkT Xk

(6)

In Eq. (6), Vk is the desired output of the sensor and WkT Xk is the output of the network, α in Eq. (4) is the learning rate parameter, which is used to adjust the weights incrementally at each step of iteration of training. The value of α controls the stability and speed of convergence and is taken to any value within 0–1 [24,25]. 3.2. Simulation results Simulation studies have been carried out by writing the MATLAB code for the LMS algorithm. The order of the polynomial basis function was chosen heuristically. The input to the ANN was the sensor output voltage obtained experimentally for an increase in RH and linear approximate values were the desired output of the network. The desired linear output was obtained from a linear approximation obtained by joining two extreme calibration points of the sensor response curve. The equation of linear approximation can be given as Vdesired = 1.786 + 0.024 × RH. Data for training the network was obtained from the graph shown in Fig. 7. The input and output data points were normalized by dividing both input and output vectors by their respective maximum values. The initial weights were generated randomly within 0–1. The total data points were divided into two groups of training set and test data set. For a fixed iteration and fixed learning rate parameter, the network was trained by applying inputs nonlinearly and the root mean square error of the network was determined. The number of

136

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

Table 1 Second order sensor model (training epoch = 85,000, learning rate = 0.04) Network training data points

Trained weights

RMS error of network (%)

Nonlinearity of the sensor (%)

Nonlinearity of the sensor after linearization with AD ALINE network (%)

5

W0 = 0.4956 W1 = −0.460 W2 = 0.906

2.47

13.13

3.90

11

W0 = 0.619 W1 = −0.847 W2 = 1.185

1.98

13.13

3.36

14

W0 = 0.6036 W1 = −0.7875 W2 = 1.1335

1.90

13.13

2.80

17

W0 = 0.683 W1 = −1.025 W2 = 1.299

1.83

13.13

2.7

inputs depends on the order of the initial polynomial basis function. The root mean square error (rms) of the network can be written as:  rms =

N

1 (Vdesired − Vann )2 N

 × 100

(7)

i=1

where rms is the percentage root mean square error, Vdesired the normalized desired output, Vann the normalized ANN actual output and N is the total data points. When the minimum mean square error goal was reached, the network had been trained. The final weights of the trained network were used to estimate the network rms for the entire data points including the test data points. The test data were those, which were unknown to the network. It was found through the simulation studies that the second order basis function was sufficient for minimizing the nonlinearity of the sensor within acceptable values. The third order basis function would have led to slightly better accuracy but the computational time and complexity increase to a much greater extent for practical hardware realization which is difficult to be justified.

The training parameters were learning rate = 0.04 and total iteration cycles called epochs = 85,000. The final weights are shown in Table 1. Table 2 shows the results for a third order model. Fig. 9(a) shows the result of simulation for training data points and Fig. 9(b) shows the simulated output for full-scale data points which include data points in the test set. It is seen from the simulation results that the network output is almost equal to the sensor linearized output. It is also shown that the sensor hysteresis error is also minimized to an acceptable value. However, to predict the hysteresis, the sensor output for a decrease in RH will be first determined experimentally and then modeled by the ANN network. The model parameters will be stored in the memory and will be utilized to estimate the hysteresis. The ability to calibrate quickly during operation of the sensor was necessary to reduce the off-time of the sensor. Reducing the number of calibration points and then using the interpolation or LMS methods decrease the calibration time. The minimal set of calibration points depends on the nonlinearity of the sensor, the required accuracy and the computational processing load. Simulation studies were also carried out to understand the minimum requirements of the experimental data points to accurately linearize the sensor response. For this, simulation was repeated

Table 2 Third order sensor model (training epoch = 85,000, learning rate = 0.04) Network training data points

Trained weights

RMS error of network (%)

Nonlinearity of the sensor (%)

Nonlinearity of the sensor after linearization with ANN (%)

11

W0 = 0.533 W1 = −0.31 W2 = 0.189 W3 = 0.555

1.568

13.13

2.50

14

W0 = 0.526 W1 = −0.245 W2 = 0.063 W3 = 0.619

1.531

13.13

2.12

17

W0 = 0.477 W1 = −0.059 W2 = −0.157 W3 = 0.701

1.536

13.13

2.24

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

137

Fig. 9. Results of simulation of the nonlinearity compensating ADALINE network: (a) training data points and (b) full-scale data points.

with different data points for the fixed epoch and learning rate to determine the rms error, sensor nonlinearity and hysteresis error. The results are shown in Table 1. It is observed in the table that as the calibrating data points are increased for training the network, the performance of the network is also improved to a certain extent. Minimum five data points are sufficient to reduce the nonlinearity and hysteresis effect with acceptable errors of the sensor. Also the results of the third order model slightly improve performance of the network. In the third order model, the input vector for the ANN has an additional term of V3 and the weights vector has an additional term of W3 . The simulation results showed in Table 2 that using third order model the accuracy of the network was 2.25% which was little more than the results of the second order model.

racy and reliability. The idea of the hysteresis compensation by the ANN-based software technique is that a polynomial function can be developed to make the sensor output for a decrease in humidity almost close to the linear approximation. Since for both nonlinearity compensation in the forward direction and hysteresis compensation in the backward direction the desired output is the same, i.e. linear curve, hysteresis as well as nonlinearity in the backward direction can be compensated. A similar ADALINE structure shown in Fig. 8 was used to obtain a suitable polynomial function. For an nth order model inputs are expanded as 2 , . . . , V n ] and the connecting weights to the net[1, Vdec , Vdec dec work are [U0 , U1 , U2 , . . ., Un ]. The approximate output of the model can be represented by the nth order polynomial function as:

4. Hysteresis effect compensation using ANN model of the sensor

Vann =

This paper also proposes another ADALINE neural network for compensating the hysteresis error of the PS humidity sensor. The hysteresis is of important concern for most of the sensors for practical applications. It is a deviation of the sensor output at a specified point of the input signal when it is approached from the opposite direction. The percentage hysteresis for the sensor can be defined as [22]:

where Vann is the network output for a decrease in humidity, Vdec the sensor output for a decrease in RH, U is the coefficients of the function and k is the order of polynomial. Again weights were updated iteratively by an LMS algorithm as discussed in Section 3.1 by comparing the model output with the desired linear output till the error goal was reached. The weights were finally stored in the memory and used for evaluation of the model and direct use for hysteresis compensation. Simulation work was carried out by the MATLAB code. A second order polynomial function obtained heuristically was found suitable to minimize the hysteresis nonlinearity to 0.744% of its desired value for the entire range of humidity. The input and output data vector for training was obtained from Fig. 7. The training parameters were learning rate = 0.04 and epochs = 85,000. The final weights are the coefficients of the function, as shown in Table 3. Fig. 10(a) shows the result of simulation for training data points and Fig. 10(b) shows the simulated output for full-scale data points, which include data points in the test set. Table 4 shows the simulation results for the first order model. The simulation results closely follow the desired output to compensate the hysteresis of the sensor. Performances of the model for different training data points are also shown in Tables 3 and 4.

% Hysteresis =

max(V − Vdec ) × 100 Vmax

k 

i Ui Vdec

(9)

i−0

(8)

In the equation, V is the actual sensor output with an increase in RH, Vdec the sensor output for a decrease in RH and Vmax is the maximum sensor output. Typically, causes for hysteresis are frictions which are caused by the interaction with the pore walls during diffusion of water vapors through the pores and structural changes in the sensing material. In a study to observe the hysteresis effect of a carbonized PS relative humidity sensor, the typical maximum hysteresis error was approximately 30% [8]. A similar study was also made for the PS humidity sensor under present study and it was found experimentally that hysteresis error was approximately 16% as shown in Fig. 3. Compensation of the hysteresis error by software techniques provides better flexibility, accu-

138

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

Table 3 Second order sensor model (training epoch = 85,000, learning rate = 0.04) Network training data points

Trained weights

RMS error of network (%)

Hysteresis error of the sensor (%)

Hysteresis error of the sensor after linearization (%)

Hysteresis error with respect to increase order of output

W0 = .0858 W1 = 0.802 W2 = 0.14

1.54

16.64

2.73

3.60

11

W0 = −0.108 W1 = 1.359 W2 = −0.24

0.70

16.64

1.177

3.60

14

W0 = −0.112 W1 = 1.370 W2 = −0.244

0.71

16.64

1.408

3.40

17

W0 = −0.151 W1 = 1.472 W2 = −0.318

0.44

16.64

0.744

3.20

5

Fig. 10. Results of simulation of the hysteresis compensating ADALINE network: (a) training data points and (b) full-scale data points.

5. Hardware implementation of the models In order to make the complete embedded system cost effective and easy to display, the compensating polynomial functions were implemented by using a microcontroller. Hardware implementation of the complete scheme is shown in Fig. 11(a). It requires generation of different controlling signals. The controlling signals are required to understand whether the sensor output is an indication of relative humidity in forward or backward direction. It is shown in Fig. 3 that the sensor output in the forward direction is always more than that for the reverse direction. Also at the next measurement point, the sensor output is more than the previous value in the forward direction, but in

the reverse direction the sensor output is less than the previous output. For example, at any instant t1 , the input is RH1 , Vin1 is the sensor output in the forward direction, Vdec1 is the sensor output in the reverse direction. At next instant t2 , the input is RH2 , Vin2 is the output in the forward direction, Vdec2 is the output in the reverse direction. Then Vin2 (t2 ) > Vin1 (t1 ) > Vdec1 (t1 ) > Vdec2 (t2 ). In the circuit diagram in Fig. 11(b), the PS sensor senses the RH level and subsequently it is converted into a voltage signal by using a detection circuit. The second normalization is required because the weights of the compensating ANN models are determined with normalized input data. The output of the normalization block is converted into binary bit streams by using an analog to digital converter (ADC chip, ADC 0809), the

Table 4 First order sensor model (training epoch = 85,000, learning rate = 0.04) Network training data points

Trained weights

RMS error of network (%)

Hysteresis error of the sensor (%)

Hysteresis error of the sensor after linearization (%)

Hysteres error with respect to increase order of output

11

W0 = 0.0101 W1 = 1.0109

1.23

16.64

2.11

3.61

14

W0 = 0.0043 W1 = 1.0219

1.26

16.64

2.62

3.61

17

W0 = 0.0076 W1 = 1.0162

1.24

16.64

2.38

3.61

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

139

Fig. 11. (a) Schematic drawing of the hardware implementation of the ANN models, (b) circuit diagram of the signal conditioning (reference [14] for phase detection circuit) and (c) flow chart of the microcontroller operation.

output of ADC is applied to a microcontroller (␮C). The operation of the ␮C unit is given in the flow chart of Fig. 11(c). The weights of both nonlinearity and hysteresis compensating ANN models were stored in the memory of ␮C. Two look-up tables (LUT), one for nonlineraity compensation for an increase in RH and second for hysteresis compensation for a decrease in RH, were formed and stored in the memory. The LUT consisted of two values; the first column was the normalized actual input and the second column was the normalized output obtained from the polynomial equations (Eqs. (10) and (11)) stored in the memory. In the beginning of the measurement, a reset signal initialized the input and output ports of the ␮C. The output of normalization block was applied to the input port and compared with the stored previous input. If the present input is high, then the input data will address the corresponding desired output from the LUT for an increase in RH. The desired output was then denormalized and applied to DAC and subsequently the output of DAC was

applied to a digital panel meter (PM-129B) for direct digital display. If the data in the input port is less than the previous value then input will address the corresponding desired output from the LUT for a decrease in RH and subsequently DAC will be displayed by PM-129B. Once the measurement of data is completed, the present input data will be stored in the temporary memory of the ␮C and will be used for the next measurement. The next measurement will start after a time lag of 10 s. The weights corresponding to 17 data points training gave the minimum nonlinearity and hence were selected for implementation. The basis function for LUT for increase in RH is given as: Vout = 0.6036 − 0.7875 × V + 1.1335 × V 2

(10)

where Vout is the normalized approximated linear output voltage, V the normalized input voltage obtained from the output of the detection circuit in the forward direction and coefficients are the weights obtained from simulation studies. Similarly, the

140

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141

Fig. 12. Results of microcontroller implementation of error compensating models: (a) nonlinearity compensated output and (b) hysteresis compensated output.

Fig. 13. Photograph of the hardware implemented circuit.

basis function for the second LUT for hysteresis compensation is given as: Vout = −0.151 + 1.472 × V − 0.318 × V 2

(11)

where Vout is the normalized approximated linear output voltage in the reverse direction, V the normalized input voltage obtained from the output of the detection circuit in the reverse direction and coefficients are the weights obtained from the simulation studies (Table 3). The complete scheme was implemented by using an AT89C51 microcontroller. The results of the implementation are shown in Fig. 12. Fig. 13 shows the photograph of the hardware circuit. The results of the digital panel meter output followed the simulated results for both nonlinearity and hysteresis compensation. 6. Conclusions In this paper, we proposed a scheme based on a simple adaptive linear neural network (ADALINE) to compensate the sensor nonlinearity and hysteresis errors. The modeling technique can minimize the nonlinearity to 2.7% of its initial 13% value and the hysteresis error to 3% of its initial 16% value. It was observed

from simulation work that if the nonlinearity of the sensor was much higher than that reported in this paper, this ADALINE network might be incapable of minimizing the error to an acceptable level. However, this problem can be tackled if the entire dynamic range of the sensor is divided into small sections so that nonlinearity of each section remains less than 20%. Hence, by using the ADALINE network for each section, the nonlinearity can be reduced to an acceptable value. Multilayer perceptron neural network (MLP) with a nonlinear activation function in the hidden layer might improve the accuracy further. To keep the weights minimum and hardware implementation of the model as simple as possible, feed forward neural technique was avoided and the ␮C-based hardware implementation of the ADALINE models for nonlinearity and hysteresis compensation were adapted. For hardware implementation, the ANN weights for compensation obtained from the simulations work for both in increase and a decrease in RH were utilized by the microcontroller to display the compensated output. Initial compensation was been made for the porous silicon humidity sensor but the technique can be applied for other sensors. The effect of temperature was lower and neglected, but to develop an accurate system the temperature drift could also be considered and adequate signal processing circuits should be developed to compensate the temperature error. Acknowledgements The authors would like to thank AICTE, DST for providing financial support for performing this work. The authors would also like to thank Mr. A.K. Mandal, and Dr. U. Ganguly of IC Design and Fabrication Center, Jadavpur University for their help and cooperation. Thanks also to Dr. Amit Konar and Prof. S. Basu for their useful suggestions. References [1] Z.M. Rittersma, Recent achievements in miniaturized humidity sensors—a review of transduction techniques, Sens. Actuators A 96 (2002) 196–210.

T. Islam et al. / Sensors and Actuators B 120 (2006) 130–141 [2] J. Das, S. Dey, S.M. Hossain, Z.M. Rittersma, H. Saha, A hygrometer comprising a porous silicon humidity sensor with phase detection electronics, IEEE Sensors J. 3 (2003) 414–420. [3] George Marsh, Porous silicon a useful imperfection, Mater. Today (January) (2002) 36–41. [4] G. Di Francia, A. castaldo, E. Massera, I. Nasti, L. Quercia, I. Rea, A very sensitive porous silicon based humidity sensor, Sens. Actuators B 111–112 (2005) 135–139. [5] H. Shibata, M. Ito, M. Asakursa, K. Watanabe, A digital hygrometer using polymide film relative humidity sensor, IEEE Trans. Inst. Meas. 45 (1996) 564–569. [6] J. Das, S.M. Hossain, S. Chakraborty, H. Saha, Role of parasitic in humidity sensing by porous silicon, Sens. Actuators A 94 (2001) 44–52. [7] T. Islam, K.Kr. Mistry, K. Sengupta, H. Saha, Measurement of gas moisture in the ppm range by porous silicon (PS) and porous alumina sensor, Sens. Mater. 16 (2004) 345–356. [8] C. Pramanik, T. Islam, H. Saha, Temperature compensation of piezoresistive micromachined porous silicon pressure sensor by ANN, Microelec. Reliability 46 (2006) 343–351. [9] E.J. Connoly, G.M. O’ Halloram, H.T.M. Pham, P.M. Sarro, P.J. French, Comparison of porous silicon, porous polysilicon and porous silicon carbide as materials for humidity sensing applications, Sens. Actuators A 99 (2002) 25–30. [10] M. Bjorkqvist, J. Salonen, J. Paski, E. Laine, Characterization of thermally carbonized porous silicon humidity sensor, Sens. Actuators A 112 (2004) 244–247. [11] P. Furjes, A. Kovacs, Cs. Ducso, M. Adam, B. Muller, U. Mescheder, Porous silicon-based humidity sensor with interdigital electrodes and internal heaters, Sens. Actuators B 95 (2003) 140–144. [12] D.H. Sheingold, Nonlinear Circuits Handbook, Analog Devices, 1971, pp. 95–97. [13] K.F. Lyahou, G. Horn, J.H. Huising, A noniterative polynomial 2-D calibration method implemented in a microcontroller, IEEE Trans. Inst. Meas. 46 (1997) 752–757. [14] J.C. Patra, G. Panda, R. Baliarsingh, Artificial neural network-based nonlinearity estimation of pressure sensors, IEEE Trans. Inst. Meas. 43 (1994) 874–881. [15] S.A. Khan, D.T. Shahani, A.K. Agarwal, Sensor calibration and compensation using neural network, ISA Trans. 42 (July) (2003). [16] T. Islam, H. Saha, Hysteresis compensation of porous silicon relative humidity sensor using ANN technique, Sens. Actuators B 114 (2006) 334–343. [17] T. Islam, H. Saha, Modeling and simulation of porous silicon capacitive humidity sensor using ANN technique for smart sensor application, in:

[18]

[19]

[20] [21]

[22] [23]

[24] [25]

141

ISSS International Conference on Smart Materials, Structures and Systems, India, July 28–30, 2005, pp. 51–58. T. Islam, C. Pramanik, H. Saha, Modeling, simulation and temperature compensation of porous polysilicon capacitive humidity sensor using ANN technique, Microelectron. Reliability 45 (2005) 697–703. J.M. Dias Pereira, Postolache, P.M.B. Silva Girao, M. Gretu, Minimizing temperature drift errors of conditioning circuits using artificial neural nertworks, IEEE Trans. Inst. Meas. 49 (2000) 1122–1127. D.G. Yarkin, Impedance of humidity sensitive metal/porous silicon/n-Si structures, Sens. Actuators A 107 (2003) 1–6. S.M. Hossain, S. Chakraborty, S.K. Dutta, J. Das, H. Saha, Stability in photoluminescence of porous silicon, J. Lumin. 91 (2000) 195– 202. J. Fraden, Handbook of Modern Sensors, Physics: Design and Applications, Springer, 2003, pp. 20–21. A.P. Singh, S. Kumar, T.S. Kamal, Fitting transducer characteristics to measured data using a virtual curve tracer, Sens. Actuators A 111 (2004) 145–153. S. Haykin, Neural Networks, Maxwell Macmillan, Canada, 1994, pp. 128–133. H. Pao, Adaptive Pattern Recognition and Neural Networks, Addison Wesley, Reading, MA, 1989, pp. 100–110.

Biographies T. Islam received his MScEng degree in instrumentation and control system from Aligarh Muslim University in 1997. He is working as a lecturer in Electrical Engineering Department, Jamia Milia Islamia University, New Delhi, India. Presently he is pursuing his PhD in the IC Design and Fabrication Center, Department of Electronics and Telecommunication Engineering, Jadavpur University, Kolkata, India. His current research interests are development of sensors, sensor array, applications of neural networks and fuzzy logic for processing of sensor signals. S. Ghosh received his BE degree in electronics and telecommunication eng. from IETE, New Delhi. Presently he is working as technical assistant in the IC Design and Fabrication Center, Dept. of E.T.C.E., Jadavpur University, Kolkata. He is working in the field of embedded system. H. Saha received his MTech degree in radio physics and electronics in 1967 and PhD on solar cells and system in 1977. He is a professor in the Department of Electronics and Telecommunication Engineering and Coordinator of the IC Design and Fabrication Center, Jadavpur University. His present research interest covers Silicon solar cells, porous silicon-based devices, smart sensors and VLSI design.