Design and FPGA Implementation of Intelligent Fault Detection in Smart Wireless Sensor Networks

In this paper, both the design and hardware of Fault Detection (FD) in Wireless Sensor Network (WSN) was implemented using FPGA NI myRIO kit, wireless temperature sensors network with small size, low cost, and low power consumption. Work data processing was performed using pattern recognition methods to detect residual generation. LabVIEW software environment was employed for system performance. In this paper. The design of the hardware circuit NI myRIO kit received temperature from the sensors. The examined system showed an ability to monitor and track any fault or fire that may occur; based on the results, if collected data is exceeded predetermined threshold, then the system is responding, a direct connection is using WIFI to process this data by LabVIEW.


INTRODUCTION
Wireless Sensor Networks (WSNs) are a set of independent sensors, which are linked via wireless channels.These devices are designed to contract with information from the surrounding environment.They are intended to do a specific task [1].For collecting data in inimical environments, the sensor can easily be deployed, and by using the wireless network, they can track the situation and stay connected to the network.This technology has many applications, including surveillance such as vehicle monitoring, collection of various environmental data, as well as military applications, tracking and monitoring of bodily functions, diseases, and other applications [2].
Furthermore, the sensor, as an electronic device is prone to fail.WSNs inclined to different failures that could be arranged as follow [3]: • Software • Hardware • Communication Hardware failure might occur because of an issue in sensor hardware: power, sensing, processing, or location.However, software failure could happen due to an issue in sensor programs.Communication failures could occur because of issues in the sensor transceiver.Faults in WSNs could be as well classified based on data sent by the sensors [3], such as; • Offset fault: when a constant is added to expect value that could happen due to sensing unity bad calibration.
• Gain fault: occur when the sensed data is unlike the anticipation.
• Stuck-at fault: occurs when the difference of sensed data sequence is equal to zero.
• Out of bounds: occur when sensed data values are out of bounds.Numerous different errors could happen continuously and at the same time over some time in the sensed data, like data aggregation fault, calibration error, etc. Battery failure is well one of the significant reasons for fault [3].This failure could lead to sensor malfunction.Due to the great global damage caused by fire, many companies big or small around the world make use of monitoring systems that deliver the data required to monitor buildings and warehouses to detect fire and stop it as soon as possible.Whereas for the common of those remarks, the established analytical reference approaches continue to be utilized, reduction led to a growth in generation prominence of low-cost devices.Such devices are also lighter, smaller, with low power consumption.An increase in the spatial density of the measurements was attained.Although they are not a direct substitute for reference devices, they are a complementary information source on early fire detection [4,5].
The results presented in this work investigate pattern recognition of residual generation for temperature sensors.Remarkably, it is typically required to put on data processing methods in the usage of devices with NTC temperature sensors.The key utilized pattern recognition methods in fire detection were summarized in many articles in recent years [6][7][8].Thus, in this work, an affordable system was developed for temperature measurement.Through this article, the architecture of the system is described.And, the following contributions are listed: • Design and development of a wireless temperature sensor network for an affordable fire detection system with low power consumption and small size.
• Use of artificial neural networks for processing the gathered data.
• Use LabVIEW software to design and implement pattern recognition to detect residual generation.

RELATED WORKS
The proposed methods of WSNs fault detection are either distributed, centralized or hybrid.This is based on statics and machine learning.In the past decade, WSN networks have been widely used and due to their importance in our daily life, it has become necessary to know the design of WSN networks and to conduct a lot of research effectively on WSN networks [9,10].
In 2016, K. Muheden et al. [11] suggested using a wireless home system by designing a hardware electronic circuit that would allow the user to use a notification method by notifying each user connected to the network.Arduino device which was programmed with Android Studio takes received temperature, humidity, gas, and flame signals via the sensors.An alarm message is sent to mobile phone users when data that exceeded a predetermined threshold is detected, as it is detected by collecting this data and through this data, the possibility of a fault or a fire is monitored and followed up.In 2017, Mahmood F. Mosleh and Duaa S. Talib [12] Proposed the design and implementation of hardware an active and flexible WSN depending on ZigBee protocol and Arduino for communication and control, respectively.The designed hardware network building contains three sensors (temperature, lighting, and gas); this network has been adopted as a sample of sensors.To obtain a target building for effective coverage, a multi-hopeful network was tried for an extended and wide area and for the flexibility of the proposed network to respond to the user's desire and based on his request to obtain information at any time possible.In 2018, Escola Politecnica [13].proposed a model that provides flexible routing through software-defined networks (SDN) that supports communication patterns in wireless networks (WSN), although it is not easy to apply this model, especially in the application of security services.Current SDN-based approaches for WSN developed over time, addressing resource-constrained necessities.Though, they do not integrate security services into their design and implementation.In 2019, R. Kamath and M. Balachandra [14] proposed a wireless system to monitor harmful weeds in the rice crop.This system adopts a wireless sensor network, and by using the Raspberry Pi-Kit, and using Bluetooth 4.0 technology, the data is sent to the main station through the visual sensor nodes, and then the data is sent to the remote station by IEEE 802.11 a/b/g/n and to operate the sensor nodes and the main station uses a battery solar cells.
• Model-based.The model-based method for fault diagnosis in dynamic procedures has received high attention, both in research and in an actual application.Figure 1 illustrates the general fault diagnosis system model-based structure, including two key phases: Residual generation: Its goal is to produce signal residual, representative a fault.Decision Creating: The residual signals are surveyed for the probability of fault and a decision statute is then utilized to delimit if a fault is detected.
The model-based fault diagnosis approaches are normally built on linear system models.For nonlinear dynamic systems, fault diagnosis issue usually studied in two phases: 1-Model is linearized around the operating point.2-Some methods are utilized to produce signal-residual, parameter estimation, observers, parity relations [18].
Thus, in this paper, the model-based method is used to deal with fault diagnosis.The strategy is to obtain an artificial neural network model and then from this diagnostic signal-residual is produced by comparing estimated and measured output.

PROPOSED MODEL-BASED FAULT DIAGNOSIS
Changes in the system performance, as a result of external inputs, out of specified tolerance bounds will be considered as "faults"; thus, the fault analysis system will detect and localize the fault, not only identify the existence of a fault but also which portion of the system causes it.The resulting difference (signal) generated from the comparison of estimated and measured output is named residuals (r).The residual must be zero when normal state and logically must splay from zero when a fault happens in the system; thus, this property of the residual (r) is employed to determine whether or not faults happen in the system.The main benefit of the model-based method is that no extra hardware is required to achieve fault detection and identification algorithm; since analytical redundancy utilizes a mathematical.The model of the system is that this method is identified as a "model-based approach".The residual should fulfill these events as in Eq. (1); The residual (r) is sensitive to a definite set of faults.In this sense, a needed thing of the residual (r) is to be insensitive or robust to parametric differences in an area of nominal values specifically; those parametric differences must not be confused with a fault.

PROPOSED SYSTEM DESIGN
The system consists of two parts; Hardware which is; NI MYRIO Kit and negative temperature coefficients (NTC) sensors.While the software used LabVIEW to implement the monitoring software.

I. NI myRIO
The National Instrument myRIO-1900, as shown in Figure 2, is a reconfiguration device that could be utilized to implement control for different systems.It has numerous features that fit this research.Table I

II. NTC Sensor
Thermistors are elements for temperature sensing consist of a semiconductor material that has been sintered to show variations in resistance proportional to variations in temperature [20].10kΩ NTC sensors used for this work to detect faults that might happen during their operation, four NTC sensors are utilized.myRIO will measure the voltage in the point between a known resistor and thermistor.The voltage divider is calculated from Eq. ( 2): In terms of thermistor circuit voltage divider, the equation variables are: V_out = Voltage between known resistor and thermistor V_in=V_cc R_1= know a resistor value R_2= Thermistor resistance This equation could be simplified and rearranged to find R_2, the thermistor resistance is calculated from Eq. ( 3): When the equation of Steinhart is used to translate resistance to temperature is described in Equation ( 4) is using following equation [21]: -----------------------------

SYSTEM IMPLEMENTATION
The final assembly of the system hardware is shown in Figure 6, where the myRIO kit is connected to the PC through Wi-Fi and four NTC are connected to myRIO kit analog ports.

RESULTS AND DISCUSSION
To test system's functionality, different scenarios have been applied.Figure 7, presents the normal operation temperature sensors in real-time with no error detected by comparing the residual of each sensor with the set thresholds.

I. Short Circuit Scenario
When a short circuit occurs to sensor two, the residual graph shows how the system is detecting this abnormal behavior of the sensor, as shown in Figure 8 and Figure 9.

II. Open Circuit Scenario
When an open circuit happened to sensor two, the residual graph shows negative amplitude, as shown in Figure 10.

III. Fire Scenario
As the proposed system is intended to be used as sensor fault and fire detection another scenario has been employed to test the system's ability to detect fire by the temperature measurement of the surrounding environment.Figure 11, shows the system response to temperature increase, which will trigger a fire alarm when the thresholds surpass 75 o C. The proposed work has successfully employed the pattern recognition algorithm to detect sensors residual generation in case of different faults presents in the system as well as used to detect fire hazard.Table II compares the obtained results with the most related and up-to-date researches in this field.

CONCLUSION
In this paper, a network of wireless temperature sensors targeted to the fire and fault detection analysis was presented.The main module to make the entire system communicate wirelessly is the myRIO kit.A compact scale, low power consumption, and low-cost architecture have been developed to achieve the desired goal.Four temperature sensors are attached to the myRIO kit.The kit is responsible for capturing and processing data to send it to a laptop via Wi-Fi, which uses a neural algorithm to perform pattern recognition to detect any residual data generated from the sensors.The residual data will be the main pattern recognition for sensor output to predict the status of the surrounding environment and sensors.The technology was developed to be used in fire and fault detection applications.

Figure 2 :
Figure 2: NI my RIO device

Figure 7 :
Figure 7: Normal operation of the fault detecting system