Implementing and Comparison between Two Algorithms to Make a Decision in a Wireless Sensors Network

The clinical presentation of acute CO poisoning and hydrocarbon gas (Butane CAS 106-97-8) varies depending on terrain, humidity, temperature, duration of exposure and the concentration of gas toxic: From then consciousness disorders (100 ppm or 15%) rapidly limiting miners to ambient air and under oxygen until sudden coma (300 ppm or 45%) required hospitalization monitoring unit, if not the result in few minutes it’s death in the poisoning site [1]. Leakage of the filling butane gas in the plant and very close to the latter position at the Faculty and under gas detection project. Has met a set of sensors to warn of possible leak, which can affect students, teachers and staff of the institution. Therefore, this document describes the implementation of two methods: the first is Average filter and the second as Cusum algorithm, to make a warning decision swished a signal given by the wireless sensors [9] [14-15]. Which installed in the inner side of Faculty of Science and Technology in Errachidia. Keywords—Wireless Network; Sensors; Stationary; Filter; CUSUM; Average; Arduino; Butane


A. Background
This work falls within the framework of a project of gas leak detection of propane from a company that is close to the Faculty of Sciences and Techniques Errachidia.As a result the interaction of gas temperature and humidity may causes damage and infection to students, teachers and staff of the institution [3][4][5][6][7].
The minors consciousness disorders (drowsiness, lethargy, confusion) and behavioral disorders evoke a toxic neurotropic and require monitoring unit because they can evolve rapidly a toxic coma Fig (1).A signal with stationary ruptures or not fast-matter is a step in the treatment or the probabilistic diagnosis, to the other random of real signals appearance of several sensors and merged for a decision.This approach considers that the signal is a succession of homogeneous segments of constant or slowly varying features, separated by sharp transitions where the signal characteristics change rapidly.A non-stationary transition or fast rupture is a short signal from the observation period it is necessary to decide in which interval a transition occurs: Hypothesis 1 or hypothesis 2 [16][17].This amount assumes that the observed signal is stationary or non-stationary.Those techniques are used in telecommunications, radar, sonar signals and in biomedical treatments and they are manifested as powerful tools to interpret signals.

B. Overview
The idea is to compare two signal-processing techniques from several sensors.One is based on the cumulative sum algorithm CUSUM [18] the other one is based on the use of averaging filter-rolling average.Many researchers have worked on the decision-making based on pressing ie tool.www.ijacsa.thesai.orgHowever, the optimal algorithm is what gives the average value and standard deviation parameters describing the rupture with much precision avoiding as possible a false alarm [10].
The first break detection approach is based on the use of digital filters average to estimate the mean and variance.Indeed, it is based on the moving average over an observation window and beyond a certain threshold before.
The second approach is based on the CUSUM algorithm often used for making decision in many phenomena to following failure detection signals [11].In this work, we have treatments signals from gas sensors, temperature and humidity...?

A. Approach based on Filters Average:
This method is based on the variance's estimation of the moment first order sliding [11][12].The main feature of this filter is his nonlinearity, which is an outputs value close to zero in the stationary signal, and in the presence of a rupture represents a high amplitude response.The figure below fig. 2 shows the block diagram of the filter used.

. Average estimator followed by variance estimator
The algorithm of this first approach presented as followed The impulse response h1 (t) satisfied: Where H1 (f) is the Fourier transform of h1 (t).The output of this filter is given by: Where 1 h (t) is an estimator of average value  .The variance is given by:  is the variance of the input process.It is proposed to estimate this variance of ˆ(t)  on a time horizon: Where h is impulse response of a linear filter and invariant.
For not involving average in (4) one requires the normalization condition: The goal is to choose filters 1 h (t) and 2 h (t) as for a stationary input x(t) ,  assumes a substantially constant value.

Made filters 1 h and 2
h minimize (3) and are given by: Where 1 T denotes the filter length and rect(t) the normalized rect angular function.is defined in the same manner 2 h the impulse response of the second filter that minimizes noise by: For validate the performance of this filter experimentally and break detection power by implementing it on an embedded system basic Arduino board, for melting of stationary signals from various sensors in real time.Next, we examine these signals representing the random and stationary physical quantities such as propane gas, Temperature or humidity simultaneously.

B. Approach based on CUSUM algorithm:
To Supposed the abrupt change to be known.The unknowns to be determined are: The occurrence of an abrupt change between n t0  and k tk  .
The value of the possible change time nc t .
The approach followed here is to develop an algorithm in order to detect the signal sample after sample.However, at each new sample, one of the two previous hypotheses 0 H or 1 H has first to be decoded.In this case, a change can be detected ( 1 H decided), the change is here which is approximated by an estimator nc t .
The log-likelihood ratio [Kay 98] is used.It is defined by: Lh  (else 0 H ), where h is threshold set by user.

A. The operating model
In this project, the simulation and implementation are on Arduino Mega type, the acquisition of several random signals from sensors and, applying filters initially for the detection of abrupt change threshold that gave good results since it detects breakage and filters the signal at the same time.Each signal is able to determine the break after treatment threshold, the mean and variance were in normal state i.e. before the break and after the break.All results are reported in graphs of real signal random nature.near processing, by these two algorithms implemented on the embedded system called Arduino device and it calculates the deferred statistical parameters determined experimentally on table below.These data has been measured every minute they reached different sensors installed outdoor of the laboratory, they represented respectively, the humidity moisture sensor, the gas sensor and the temperature sensor.In these measurements of the humidity signal was almost constant, while the temperature signal was around 29 °C and had a break near 8 mn up to 10 minutes this rupture is very pronounced for gas signal on Fig 3 .Also on this graph, a rupture of the gas signal appears.This means that there is a leak gas period corresponding to a phase of discharging and charging on the factory, which is located near the lab.

B. The Experimental Equipment
The Equipment used in this project are embedded system type Arduino Mega card, three sensors for temperature, gas and humidity simultaneously of types: LM35, MQ6 and DHT11.a laptop, Breadboards, RF module and Jumper wires figure 4.
The signal from sensors goes to Arduino card for the processing [19][20], then the results pass through an USB serial port to the laptop.These data is exploited by Matlab software program to plot the result for showing alarms [8].

C. Experimental Results
The results given by the two processing algorithms implemented on the card are

1) Average filter:
The Given results at the output of the first filter using the following parameters ( 14) are The observations of the two windows have been carefully selected in order to get the best results.The humidity signal varies little and has a slight variation around the mean value especially at night.www.ijacsa.thesai.orgFig. 6.The fusion processing signals using the filtering operation Figure 6 shows the signal merged in solid lines and the various breaks threshold marked by dotted lines.In the signal of gas leakage representative rupture threshold is preponderant is always lasts about two days.

2) CUSUM Algorithms:
The Implementation of this second algorithm gives the following results for the same data as in TABLE I.
The output of CUSUM Algorithm is:  Figure 10 shows the rupture positions and the corresponding time duration.Note here that the second algorithms determine the breaking point is the threshold of the gas leak in the amplitude and time.

Fig. 1 .
Fig.1.Symptoms of CO poisoning according to exposure and concentration HBCO[2] positive value close to zero.For an input having a mean change,  has a transition and 2 ˆ(t)   locally increases, Operate the variation of 2 ˆ(t)   indicating a poor local estimate of  , to highlight the searched transition responsible for this state of affairs.

Fig. 3 .
Fig. 3.The randomize original signals captured from different sensors

Fig. 4 .
Fig. 4. Experimental Equipment (a-Two of second level Node b-principal level Node)

Fig. 5 .Figure 5
Fig. 5. Three randomize signals from different sensers bedore treatment by average filtering Figure 5 shows the signals detected by the various sensors.the gas sensor is clearly shown by a rupture between 0.7 and 1,2mn about two days.this range represents the gas leak period during the charging and discharging of the stock at the gas factory.This takes about two days ( 1g 240ppm  ) before

Fig. 7 .
Fig. 7.The derivative of fusional signal with thresholds for the average filter

Figure 7
Figure7shows the derivative of the merged signal where repetitive peaks with an average around zero mark thresholds of the overall signal.

Fig. 8 .
Fig. 8. Fusional signal with thresholds for many ruptures after average filter processing Figure 8 shows the different extracts statistical parameters of the merged global signal.

Fig. 9 .
Fig. 9.The result fusional signal after CUSUM algorithm processing Figure 9 characterizes the rupture of the signal after processing by the CUSUM algorithm.After derivation of the signal 9, the gas leakage protester breaking point is very clear is predominant.

Fig. 10 .
Fig. 10.The derivative of fusional signal with thresholds for the CUSUM algorithm

Algorithm 1: Average filter
compare these experimental results found with those based on the CUSUM algorithm by comparing the statistical values.Where   x of   xn.The randomly feature of the signal can contain one or many abrupt occurring at the time.nc t This threshold is modeled by www.ijacsa.thesai.org

TABLE II .
DIFFERENT EXPERIMENTAL PARAMETERS EXTRACTED USING THE AVERAGE FILTER

TABLE III .
DIFFERENT EXPERIMENTAL PARAMETERS EXTRACTED USING THE CUSUM ALGORITHM