Multi-temperature and Humidity Data Fusion Algorithm Based on Kalman Filter

In order to save system energy, enhance data-gathering accuracy and improve data-gathering efficiency in the temperature and humidity monitoring system based on wireless sensor networks, Multi-temperature and Humidity Data Fusion Algorithm based on Kalman Filter (MHDFA-KF) is proposed. In temperature and humidity sensor nodes, measured data are gathered and sent to sink node. In sink nodes, weighted fusion algorithm is used to fuse the received data and the fused data are sent to base station. In base station, Kalman filtering algorithm is used to filter the received data from sink nodes or sensor nodes. The time update equations and measurement update equations are used to iteratively calculate state variables and error covariance. Finally, the true value of temperature and humidity is obtained. The experimental results show that MHDFA-KF algorithm filters the data Gaussian noise, reduces the data measured error and obtain the true value. Under certain conditions, MHDFA-KF algorithm can be applied in temperature and humidity monitoring system based on wireless sensor networks. It has certain value.


INTRODUCTION
Temperature and humidity are two very important physical parameters.Their monitoring systems are widely used in industrial control system, storage system, et al.Therefore, it is significant to develop temperature and humidity monitoring system which has low cost and high reliability.Normally, a large number of cables are laid between the monitoring site and control room to realize temperature and humidity monitoring and automatic control in target area.But it brings the problem of portability and is not conductive to large-scale application in the existing industrial production.Moreover, traditional temperature and humidity monitoring systems use the roisters and humidity sensitive capacitors (Liang, 2005).These traditional analog temperature and humidity sensors generally need to design signal conditioning circuits and use sophisticated calibration and standard process.Therefore, the measured accuracy as well as linearity, repeatability and interchangeability cannot be guaranteed.Those sensors are only suitable for those occasions which have several measured points and acquire low precision.In order to overcome the shortcomings of existing technology, Wireless Sensor Network (WSN) technology and digital sensor SHT11 are used for a temperature and humidity monitoring system.The system based on wireless sensor network is high accuracy and stability, low cost and will have a certain application value.
However, temperature and humidity monitoring system based on wireless sensor network has limited resources such as battery energy, processing ability and storage capacity and communication bandwidth.Noise often exists in information during the gathering process.And if sink nodes transmit each sensor node's data, communication bandwidth and network energy will be wasteful, information gathering efficiency will be low.Therefore, Data Fusion (DF) technology is used in the data gathering process in wireless sensor network to avoid those problems above.DF processes the multidata and multi-information to obtain the combination data which are effective and meet clients' requirements.DF can increase the measured dimension and reliability, improve fault tolerance, system reliability and maintainability; it can increase accuracy, extend the space and time accuracy, promote spatial resolution and the environmental adaptability; it can improve detection performance, increase the effectiveness of response, reduce the performance requirements of a single sensor, enhance the speed of information processing; it can reduce the cost of information gathering.In short, DF technology saves entire network energy, improves the accuracy and efficiency of data-gathering and plays an important role in wireless sensor networks (Yick et al., 2008).
At present, the research on Data fusion with Kalman filter in wireless sensor network has got some achievements.Xie et al. (2010) proposes area temperature system monitoring and computing algorithm based on adaptive fuzzy logic in wireless sensor networks.It uses both average and adaptive fuzzy logic algorithms for computing temperature in a monitored area.Its simplicity and accuracy are better than the standard Manadni fuzzy logic method.Chen (2011) proposes an algorithm of mobile sensors data fusion tracking for wireless sensor networks.The algorithm implements the simple approach with an adaptive filter (Kalman filter), establishes a variable structured model and suggests a multiple sensor fusion algorithm.Kuzu et al. (2009) introduces a multipurpose wireless sensor network platform for education and research.The WSN platform is designed with state-ofthe-art multiple sensor modules such as temperature and sound sensors and can support a variety of research and education projects in sensor/data fusion and target tracking algorithms.Ribeiro and Giannakis (2005) proposes distributed Kalman filter based on severely quantized WSN data for distributed tracking applications.Shi et al. (2009) uses the pseudomeasurement technology and Kalman filter with correlated noise and proposes unified out-of-sequence measurements fusion algorithm for WSN.Wang et al. (2012) and Lin et al. (2009) use Kalman filter to research on target tracking.Liu et al. (2009) proposes a rough and precision association mixing FCM algorithm with Kalman filter for multi-target tracking.Its correct association rate of track increases to 98.3 from 86.7% compare with traditional method.A lot of Data Fusion algorithms based on Kalman filter are applied to target tracking and autonomous navigation.They are not suitable for the fusion of temperature and humidity data.Moreover, those corresponding formulas are so complicated.They are difficult to apply in wireless sensor networks which have limited resources.Therefore, this study proposes a Multi-temperature and Humidity Data Fusion Algorithm based on Kalman Filter (MHDFA-KF).It has good performance on temperature and humidity monitoring system based on wireless sensor network.It can save the network energy and improve the accuracy of data-gathering.

MULTI-TEMPERATURE AND HUMIDITY DATA FUSION ALGORITHM
This algorithm uses weighted fusion algorithm to fuse the data from sensors, then uses Kalman filtering algorithm to filter the fused data and obtain the true values.The specific algorithm is as follows: Weighted fusion algorithm: This algorithm weights and fuses a lot of data from multiple sensors.It is applies for the same type of sensors to detect target.It weights and averages the redundant information of multiple sensors and its results are the fused values (Cui and Zuo, 2009).If N sensors detect the same target for k steps, then: where, Z j (k) : Gathering value of j-th sensor at step k R j (k) : Kalman filter is essentially a mathematical tool used to estimate some process state (controlled or noncontrolled).Its goal is to minimize the estimation error variance.The filter is effective in the following aspects: it supports past state, present state and even future state; the filter is available even without the accurate model; each estimation of Wiener filter directly needs all data, but Kalman filter uses recursive calculation with the last iteration data and makes it very attractive in practical applications (Kalman, 1960).
There are two reasons to select the Kalman filter in the temperature and humidity monitoring system.Firstly, the typical temperature and humidity gathering process can be modeled as a Gaussian noise process.Secondly, the system needs an efficient online filtering algorithm.Kalman filter can be used to reduce error sum of squares in the data measurement.In this system, the sensor nodes gather the temperature and humidity measured data and use Kalman filter to filter the data and estimate the state of measured target (temperature, humidity or the change rate).Here, Kalman filter regards the gathering data of sensors as process measured values.
Assuming that the temperature and humidity of target has uniform change within a relatively short period time, the temperature and humidity estimation problem can be described as filtering problem in the state space.The mathematical model and measured model of target are as follows (Welch and Bishop, 2006): Therefore, the two-dimensional model of target state measured equations is described as follows: where,  T : Sampling time Z k : The fused gathering values of temperature or humidity at step k Measured noise v k and process noise w k are mutually independent.Hence, time update equations of Kalman filter are as follows: where, where, H = [1 0] : Measured matrix K k : Kalman gain at step k Node design: At present, temperature and humidity sensor SHT11 of Scnsirion corporation in Switzerland is simple in configuration, low power consumption, high precision and easy to read.Hence, SHT11 is chose as temperature and humidity sensor in sensor node.STC12LE4052AD microcontroller chip has 256 bytes data memory RAM, 4K bytes flash program memory.Because of its simple operation, low cost, writing and erasing program directly through serial port, STC12LE4052AD chip is used as the node microcontroller.There are many data transmission modules of wireless sensor networks in the market.Among those modules, module SZ05 of Shanghai Shunzhou Technology Company uses Zigbee technology, has easy data transmission, simple operation and supports multiple data transmission modes.Hence, module SZ05 is chose as WSN modules.The hardware diagram of sensor node, sink node and base station are shown as follows: As shown in Fig. 3, sink node is consisted of WSN module SZ05, microcontroller STC12LE4052AD and 9V battery.
As shown in Fig. 4, base station is consisted of WSN module SZ05, serial port and 5V, 1A power.

Algorithm implementation:
The proposed MHDFA-KF is a data fusion algorithm of temperature and humidity.Each sensor node measures temperature and humidity data and transmits them to sink node or base station.Sink nodes fuse the data with weighted fusion algorithm and transmit them to base station.Base station uses Kalman filter to get the true measured value.The specific implementation steps are as follows: Step 1: When network starts, each temperature and humidity sensor node gathers data and transmits them to sink node or base station.
Step 2: Sink nodes receive the data from sensor nodes, calculate the noise variance of each sensor node and fuse the data with weighted fusion algorithm.Finally, they transmit the fused data to base station.The hardware structure is similar as base station, so only the material object picture of base station is given.As shown in Fig. 6, base station has SZ05 module, STC12LE4052AD chi, power interface, serial port.Base station communicates with computer with serial port.
Simulation data and parameters choice: Simulation data of MHDFA-KF algorithm are gathered with four temperature and humidity sensor nodes during one day from 12:00 am to next 12:00 am in next day.Those data are processed to obtain the true observed values.The algorithm parameters are as follows: sampling time T  is 0.05, target noise Q k is [0.0001 0; 0 0], measured noise variance R k is Gaussian white noise variance.

Serial data analysis:
As shown in Fig. 7, computer receives data from base station through serial port.
Where, 14 represents data packet header; 000001, 000002 and 000003 represent addresses of sink nodes; the first data following address are gathering temperature, such as 19.4; the second are gathering humidity, such as 68.5.

SIMULATION RESULTS
One date' temperature data is taken for example to analyze the algorithm efficiency.As shown in Fig. 8, sink nodes fused the data from 4 sensor nodes with weighted fusion algorithm, which greatly reduces the amount of data transmission.The fused temperature data are consistent with daily temperature's change regularity: maximum temperature of each day is general not at 12:00 am but around 2:00 pm, then the temperature decreases as time goes on and reaches minimum at late-night, then rises as time goes on.However, fused temperature data have noise.The data curve fluctuates frequently and has many glitches.

CONCLUSION
In order to solve the problems such as various types of noise in information gathering, bandwidth and energy waste in network communication, information gathering efficiency, this study proposes a multitemperature and humidity data fusion algorithm based on Kalman filter.Multi-temperature and humidity data fusion algorithm (data weighted fusion algorithm and Kalman filter algorithm) is elaborated.Then the hardware platform solution of MHDFA-KF algorithm including base stations, sink nodes and sensor nodes is introduced.Finally, effectiveness of MHDFA-KF algorithm is analyzed based on fused data of temperature and humidity from experimental hardware platform.
MHDFA-KF algorithm can be applied to the temperature and humidity monitoring system based on wireless sensor networks.It has certain value.Therefore, the further research work is to popularize MHDFA-KF algorithm to other systems based on wireless sensor networks.
) where, x k : Posteriori state estimate vector at step k f() : State transition matrix w k : Target noise at step k Q k : Noise variance matrix of target model at step k z k : Actual measured value h() : Measured matrix v k : Measured noise at step k R k : Variance matrix of measured noise at step k x k = [S k V k ] T where S k : The temperature or humidity data at step k V k : The change rate of temperature or humidity at step k

Step 3 :
Base station receives the fused data of sink nodes and some sensor nodes, uses time update equations of Kalman filter to calculate the priori estimate state estimate vector ˆk x and priori estimate error covariance ˆk P at step k.Step 4: Base station uses measurement update equations of Kalman filter to calculate the Kalman gain K k , posteriori state estimate vector x k and posteriori estimate error covariance P k at step k.Step 5: Base station repeats step 3 and 4 to obtain the true value of temperature and humidity.At last, after the above steps, the true value of temperature and humidity are obtained.The pseudo code of sink node is as follows: Initializing variables including k  While (1)  Receive the temperature and humidity data of sensor nodes and put them into buffer Calculate E j (k)  Calculate R j (k)  Calculate Z (k) with Eq. (1)  Transmit Z (k) to base station  k = k + 1  EndThe pseudo code of base station is as follows: Initializing variables including k  While (1)  Receive Z k from sink node  Calculate ˆkx and ˆk P with time update Eq. (7) and (8)  Calculate K k , x k and P k with time update Eq. (9)-(11)  k = k + 1  End Algorithm simulation: Handware platform: As shown in Fig. 5, in the experiment, four sensor nodes are used.Each sensor nodes has 9V battery, power interface, STC12LE4052AD chip, SZ05 module and SHT11.

Fig. 7 :
Fig. 7: Serial data They all measure temperature and humidity data and transmit to sink nodes.The hardware structure is similar as base station, so only the material object picture of base station is given.As shown in Fig.6, base station has SZ05 module, STC12LE4052AD chi, power interface, serial port.Base station communicates with computer with serial port.

Fig. 8 :Fig. 10 :
Fig. 8: Fused temperature data of sink node Gathering value variance of j-th sensor at step k H j (k) : Noise variance matrix of j-th sensor at step k Z (k) : The fused value at step k H (k) : The fused variance matrix of noise at step k