# Wireless Sensor Networks for Smart Homes:
## 4 Performance Assessment  
### Model Development  
Several assessments have been conducted to compare the proposed method with another similar in the literature. The method of [PERSON] et al. [46] has been taken into account. In the wireless network, both the FPC, FFD, and RFD nodes are provided with a micro-controller and a wireless module IEEE 802.15.4 compliant. The values used in the simulations have been deduced from the following devices:  
* 16 bit MCU--Microchip PIC24F family (PIC24 FJ256 GB108) [59];
* MRF24J40 MB Radio Frequency Transceiver IEEE 802.15.4 2.4 GHz [60]. The simulations have been administered with a model built in Simulink/Matlab pictured in Figure 5. The main aim of this model is to simulate the procedure between a coordinator and a sensor. Precisely, the _Sensor Node_ block accomplishes the battery waste of the RFD node. The _sleeping_time_, the transmission power (\(TXPower\)) and the power in receiving (\(RXPower\)) are earned as inputs of this block through a feedback loop system. This block returns two output variables (\(Th/Wl\) and \(battery\_level\)) that are employed as input variables by the FLC. It is useful to remark that the actions of the micro-controller and a joined sensor have a low impact on battery consumption. Their power demand is evaluated at \(50-mA\) (\(MC_{PC}\)). This value has been measured in an electronic board distinguished by the PIC24 FJ256 GB108 micro-controller and a DS18B20 [61] sensor. Therefore, the energy waste is related to the working state of the device. When the device is sleeping, the battery consumption is 50 mA + 5 mA (5 mA is the power consumption of the IEEE 802.15.4 module in sleeping mode, obtained from the datasheet [60]). Contrarily, when the device is transmitting, the transmission power profoundly influences energy consumption. The battery loss trend is evaluated concerning the sleeping time through the Simulink/StateFlow environment. This tool practices flow charts and finite state machines to describe the evolution of a system. The Chart \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Rule**} & **Antecedent** & **Antecedent** & **Consequent** \\  & **(\(Th/Wl\))** & **(\(battery\_level\))** & **(\(sleeping\_time\))** \\ \hline
1 & Low & Low & Medium \\
2 & Low & Medium & Low \\
3 & Low & High & Low \\
4 & Medium & Low & Medium \\
5 & Medium & High & Low \\
6 & Medium & Medium & Medium \\
7 & High & Low & High \\
8 & High & Medium & High \\
9 & High & High & High \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Inference rules. Figure 5: Simulation model developed in Matlab/Simulink. section, created in Simulink/StateFlow, related to the operation of the battery loss, is pictured in Figure 6.  
Considering a 10.8 V lithium-ion battery in the performance evaluation, the maximum level of the battery when it is completely energized is 3100 mAh (\(FullBattery\)), while the comparable digital value, acquired through a 10-bit AD Converter, is 1024 (\(MaxDV\)). It is significant to perceive that when the device is in sleeping mode, the power consumption is largely due to the micro-controller and the sensor since the radio frequency transceiver consumption is negligible, as shown also in [43; 62; 63; 64; 65]. In this case, the consumption is 0.0046 bit/s. The following relation determines this value:  
\[SleepMode_{consumption}=\frac{MC_{PC}\cdot MaxDV}{FullBattery} \tag{4}\]  
where the number of seconds in an hour is 3600. By employing the Equation (4) the power consumption of each device in sleeping mode is:  
\[SleepMode_{consumption}=\frac{50\times 1024}{3100\times 3600}=0.0046 \tag{5}\]  
In case of maximum transmission power (0 dB) the radio frequency transceiver consumption is 130 mA [60]. As shown in Figure 5 the _TXPower_ value is obtained as follows:  
\[TransmissionMode_{consumption}=\frac{130\times 1024}{3100\times 3600}=0.0119 \tag{6}\]  
The evolution of StateFlow is established to 1 second. In the transmission mode, the system is unmistakably in his _ActiveState_, so able to receive.