Modeling and Analysis of Adaptive Temperature Compensation for Humidity Sensors
Abstract
:1. Introduction
2. Principle of Compensation
3. Adaptive Segmentation Based on Multiple Linear Regression
- The error curve of humidity sensor is linear at room temperature. So the initial temperature value is determined to be about 25 °C. The measured error of humidity sensor at the ambient temperature 25 °C is −6%–−1% when the humidity is 10%–90% RH.
- Read the previous temperature value and the next temperature value and their respective humidity values.
- Each time a set of temperature and corresponding humidity data are read, a regression is performed to obtain a coefficient of determination .
- If , return to step 2, if , get the segmentation points and .
- When the temperature interval of the linear interval is greater than 5 °C, that is, , the segmentation compensation will be performed according to Figure 3. If , the whole process will be compensated by GSA-BP. An adaptive segmentation flowchart based on multiple linear regression is shown in Figure 4.
4. Nonlinear Compensation Model
- Determine the topology structure of the BP neural network. The BP neural network is set to a three-layer network structure. The original measured value of temperature and humidity sensor are the network inputs, and the number of input nodes is 2. The number of hidden layer nodes is set to 7 according to the compensation effect. The output of the network is the humidity value after compensation, and the number of output nodes is 1. The number of optimized parameters of the genetic simulated annealing algorithm is determined as follows: .
- Initialize the genetic simulated annealing algorithm. The population size with weights and thresholds is 60; the maximum number of iterations MAXGEN is 2000; the crossover probability is 0.6; the mutation probability is 0.1; the initial temperature is 100; the end temperature is 0.99; the temperature cooling coefficient is 0.99.
- Initialize the weights and thresholds of the BP neural network and calculate fitness. The initial population of the genetic simulated annealing algorithm is generated by combining the initial weights and thresholds of the BP neural network initialization with the original measured values and temperature . Each individual in the genetic simulated annealing algorithm represents all the weights and threshold of a network, and the algorithm then calculates the fitness of each individual through a fitness function. The fitness function of this paper adopts the fitness stretching method, and the fitness of the i-th individual after improvement is calculated by Equation (18).Among these values, is the i-th individual fitness before improvement, . and are the initial temperature and the current temperature in the simulated annealing algorithm respectively, . is the current genetic evolution algebra, and is the population size. and are the standard humidity values expected and the humidity values actually obtained by the network of the i-th individual.
- The genetic simulated annealing algorithm finds individuals with optimal fitness based on a series of operations such as selection, crossover, mutation and annealing. Compare the current fitness and historical best fitness of each individual in the population. If the current value is better, the current value is the best value of the history, and save the individual as the best value of history, otherwise the best value will not change.
- The genetic simulated annealing algorithm obtains the optimal individual as the initial weight and threshold of the BP neural network. The optimized BP neural network is used to train the humidity data at different temperatures.
5. Experimental Results and Analysis
5.1. Performance Analysis of Optimized Compensation Algorithm GSA-BP
5.2. Segmentation Optimization Compensation Model
- Read the measured data set and interpolate it. The temperature points set in the experiment have some discreteness. So the continuous function is added on the basis of the discrete data and that the continuous curve passes all the given discrete data points. The interpolated data will be compensated for later.
- Read two groups of temperature and corresponding humidity in sequence from the temperature of 25 °C, use the binary linear regression function to regress the data after interpolation, and determine the regression effect according to the value of the criterion . When , the regression is stopped. The value of is 0.8468 when the experimental data stops returning. The temperature value at this time is the temperature segmentation points , , which are 22.36 and 29.98, respectively.
- Determine whether the interval of the temperature segmentation point is greater than 5. The experimental data satisfy this condition; therefore, segmentation compensation is made. The least squares method is used for linear fitting of the temperature range . Taking the straight line fitting effect of 30% RH as an example, the fitted straight line is: , where is the compensation value, and is the temperature value. When the value of measured humidity is 30% RH, input the value of temperature and obtain the corresponding humidity compensation value, then add the measured value to obtain the compensated value.
- Use GSA to optimize the weight and threshold of the BP neural network, train the neural network, and compensate the data in the nonlinear interval.
- The overall trend of the compensation effects of the three methods is the same. The compensation error used in reference 11 is large, and the error at the segmentation node significantly increased. The compensation effect of the method in this paper is relatively stable. In particular, the curve between 0 and 40 °C tends to be gentle and close to zero.
- The adaptive segmentation compensation method combines the simplicity and efficiency of the least squares method with the high precision of the GSA-BP neural network. The measurement error of humidity significantly improved over the entire temperature range. In the vicinity of the segmentation point (22.36 °C, 29.98 °C) obtained by the adaptive calculation, the compensation effect is particularly significant.
6. Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Weiwei, L.V.; Xiaohua, L.V.; Zuoyang, T.; Xiaohua, X.; Yong, X. Fault Analysis and Maintenance of DZZ Series of Automatic Weather Stations. Meteorol. Environ. Res. 2018, 9, 35–37. [Google Scholar]
- Hai, M.; Wen, F.; Wang, C.; Li, X.J. Capacitive humidity sensing properties of CdS/ZnO sesame-seed-candy structure grown on silicon nanoporous pillar array. J. Alloys Compd. 2017, 11, 94–98. [Google Scholar]
- Lob, V.; Geisler, T.; Brischwein, M.; Uhl, R.; Wolf, B. Humidity sensor using a single molecular transistor. J. Appl. Phys. 2015, 118, 135–171. [Google Scholar]
- Wang, D.F.; Lou, X.; Bao, A.; Yang, X.; Zhao, J. A temperature compensation methodology for piezoelectric based sensor devices. Appl. Phys. Lett. 2017, 111, 083502. [Google Scholar] [CrossRef]
- Ruirong, D.; Hongwei, Z.; Nan, S.; Bo, D.; Dengyue, W. Compensation and calibration of the high temperature and pressure downhole pressure sensor. Chin. J. Sci. Instrum. 2016, 43, 737–743. [Google Scholar]
- Hsieh, C.; Hung, C.; Li, Y. Investigation of a Pressure Sensor with Temperature Compensation Using Two Concentric Wheatstone-Bridge Circuits. Mod. Mech. Eng. 2013, 10, 104–113. [Google Scholar] [CrossRef]
- Zhou, G.; Zhao, Y.; Guo, F. A Smart High Accuracy Silicon Piezoresistive Pressure Sensor Temperature Compensation System. Sensors 2014, 4, 74–90. [Google Scholar] [CrossRef] [PubMed]
- Li, T.; Liang, S.; Hong, Y.; Pan, L. Simulation of Temperature Compensation of Pressure Sensor Based on PCA and Improved BP Neural Network. Adv. Mater. Res. 2014, 846–847, 513–516. [Google Scholar] [CrossRef]
- Li, Y.; Li, Y.; Li, F.; Zhao, B. The Research of Temperature Compensation for Thermopile Sensor Based on Improved PSO-BP Algorithm. Math. Probl. Eng. 2015, 3, 1–6. [Google Scholar] [CrossRef]
- Zhu, L.; Xie, B.; Xing, Y.; Chen, D.; Wang, J. A Resonant Pressure Sensor Capable of Temperature Compensation with Least Squares Support Vector Machine. Procedia Eng. 2016, 168, 1731–1734. [Google Scholar] [CrossRef]
- Jiwei, P.; Wenhua, L.V.; Hongyan, X.; Xiangjuan, W. Temperature compensation for humidity sensor based on improved GA-BP neural network. Chin. J. Sci. Instrum. 2013, 34, 153–160. [Google Scholar]
- Guo, M.; Xing, H.; Zhang, D.; Zhang, L. Temperature Compensation for Humidity Sensor Based on the AFSA-BP Neural Network. Instrum. Tech. Sens. 2017, 8, 6–10. [Google Scholar]
- Xing, H.Y.; Peng, J.W.; Lv, W.H. A fusion algorithm for humidity sensor temperature compensation. Chin. J. Sens. Actuators 2012, 25, 1711–1716. [Google Scholar]
- Kutner, M.; Nachtsheim, C.; Neter, J. Applied Linear Regression Models; McGraw-Hill/Irwin Education: New York, NY, USA, 2004. [Google Scholar]
- Dos Soares, T.S.; Mendes, D.; Rodrigues, T.R. Artificial neural networks and multiple linear regression model using principal components to estimate rainfall over South America. Nonlinear Process. Geophys. 2016, 23, 1317–1337. [Google Scholar]
- Xu, W.; Li, F.; Liu, F. Optimality and Recursive Algorithm of General Least Squares Estimator of Seemingly Unrelated Linear Regression Models. In Proceedings of the 2010 International Conference on Computational Intelligence and Software Engineering, Wuhan, China, 10–12 December 2010. [Google Scholar]
- Shidrokh, G.; Hassan, W.H.; Hossein, M.; Seyed, A.; Soleymani, A. MDP-Based Network Selection Scheme by Genetic Algorithm and Simulated Annealing for Vertical-Handover in Heterogeneous Wireless Networks. Wirel. Pers. Commun. 2017, 2, 399–436. [Google Scholar]
- Örkcü, H.H. Subset selection in multiple linear regression models: A hybrid of genetic and simulated annealing algorithms. Appl. Math. Comput. 2013, 5, 11018–11028. [Google Scholar]
- Wang, K.; Luo, X.; Shen, H.; Zhang, H. GSA-BP neural network model for back analysis of surrounding rock mechanical parameters and its application. Rock Soil Mech. 2016, 37, 631–638. [Google Scholar]
- Chen, X.; Ma, D. Mode Separation for Multimodal Ultrasonic Lamb Waves Using Dispersion Compensation and Independent Component Analysis of Forth-Order Cumulant. Appl. Sci. 2019, 9, 555. [Google Scholar] [CrossRef]
Environment Temperature (°C) | Standard Value of Relative Humidity (%RH) | Error of Different Methods of Compensation (%) | ||
---|---|---|---|---|
Reference 11 | Reference 13 | This Paper | ||
−19.68 | 11.79 | −0.34553 | −0.3857 | −0.2912 |
−14.98 | 11.56 | −0.25367 | −0.2678 | −0.2198 |
−9.65 | 11.15 | −0.24591 | −0.1783 | −0.1423 |
−4.78 | 9.26 | 0.0321 | −0.0026 | 0.0035 |
3.45 | 9.61 | 0.0056 | −0.0098 | 0.0102 |
20.01 | 23.55 | −0.1785 | 0.0728 | 0.0128 |
24.58 | 25.05 | −0.0148 | −0.0118 | 0.0021 |
29.98 | 25.95 | 0.04726 | 0.0248 | 0.0219 |
38.89 | 27.8 | 0.0147 | 0.0975 | 0.0175 |
51.21 | 29.25 | 0.0947 | 0.0752 | 0.0642 |
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Xu, W.; Feng, X.; Xing, H. Modeling and Analysis of Adaptive Temperature Compensation for Humidity Sensors. Electronics 2019, 8, 425. https://doi.org/10.3390/electronics8040425
Xu W, Feng X, Xing H. Modeling and Analysis of Adaptive Temperature Compensation for Humidity Sensors. Electronics. 2019; 8(4):425. https://doi.org/10.3390/electronics8040425
Chicago/Turabian StyleXu, Wei, Xiaoyu Feng, and Hongyan Xing. 2019. "Modeling and Analysis of Adaptive Temperature Compensation for Humidity Sensors" Electronics 8, no. 4: 425. https://doi.org/10.3390/electronics8040425
APA StyleXu, W., Feng, X., & Xing, H. (2019). Modeling and Analysis of Adaptive Temperature Compensation for Humidity Sensors. Electronics, 8(4), 425. https://doi.org/10.3390/electronics8040425