# Context-Aware Wireless Sensor Networks for Smart Building Energy Management System
## 4 Proposed EMS for SEEB
### WSN Network Packet Delivery Evaluation
#### 4.5.3 Signal Power Test and Distance Measurement  
In this step, we first measured the RSSI (Remote Signal Strength Indicator) (Figures 7 and 8) and then compared it to the actual distance between each pair of the ten nodes in the WSN network. The distance obtained based on the RSSI value does not match the real distance due to the indoor environment's multipath characteristics. However, these values helped to estimate the distance to distribute nodes in a way that maintains the network's connectivity. Table 6 shows the result of the RSSI measurement. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Node Location** & **Full Mesh Topology** & **Cluster Tree Topology** \\ \hline Room010 & 7.42 kbps & 8.39 kbps \\ \hline Room014 & 6.53 kbps & 7.67 kbps \\ \hline Room016 & 6.85 kbps & 7.9 kbps \\ \hline Room015 & 4.38 kbps & 5.38 kbps \\ \hline Room003 & 3.21 kbps & 4.35 kbps \\ \hline Room002 & 2.33 kbps & 3.51 kbps \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Throughput test of sensor nodes in different topologies. Figure 6: Packet arrival rate using the different gateways under full mesh topology and cluster tree mesh topology. The values obtained in Table 6 shows that the RSSI goes down as the distance between the pair of nodes becomes higher. Among the different localization techniques, we have range-based methods \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline  & & & & & & & & & & \\ \hline Room 002 & & -71 & -90 & -92 & -92 & -89 & -88 & -83 & -75 & -93 \\ \hline \multirow{2}{*}{Room 002} & & -71 & -90 & -92 & -92 & -89 & -88 & -83 & -75 & -93 \\ \cline{2-10}  & & -92 & -93 & -94 & -91 & -86 & -81 & -73 & -92 \\ \hline \multirow{2}{*}{Room 003} & & -92 & -93 & -94 & -91 & -86 & -81 & -73 & -92 \\ \cline{2-10}  & & -78 & -83 & -81 & -75 & -59 & -67 & -55 \\ \hline \multirow{2}{*}{Room 010} & & & -78 & -83 & -81 & -75 & -64 & -67 & -55 \\ \cline{2-10}  & & & -69 & -71 & -66 & -73 & -85 & -75 \\ \hline \multirow{2}{*}{Room 014} & & & -69 & -71 & -66 & -73 & -85 & -75 \\ \cline{2-10}  & & & & -72 & -76 & -75 & -88 & -85 \\ \hline \multirow{2}{*}{Room 015} & & & & & -69 & -72 & -82 & -73 \\ \cline{2-10}  & & & & & -69 & -72 & -82 & -73 \\ \hline \multirow{2}{*}{Room 016} & & & & & -53 & -57 & -70 \\ \cline{2-10}  & & & & & -53 & -57 & -70 \\ \hline \multirow{2}{*}{Router 1} & & & & & & -53 & -57 & -70 \\ \cline{2-10}  & & Remote RSSI & & & & -55 & -60 \\ \hline \multirow{2}{*}{Router 2} & & Local RSSI & & & & -55 & -60 \\ \cline{2-10}  & & & & & & -76 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: RSSI measurements between each pair of WSN nodes. Figure 8: Local and remote Remote Signal Strength Indicator (RSSI) of WSN nodes. Figure 7: Link quality between WSN nodes. such that Angle Of Arrival (AOA), Time Of Arrival (TOA), Time Difference Of Arrival (TDOA), and Remote Signal Strength Indicator (\(RSSI\)). \[D_{k}=10(A^{kRSSI}\!/10^{*}n_{k}) \tag{1}\]  
In \(RSSI\), the signal propagation can be used to calculate the distance between a transmitter and a receiver using Equation (1). In an indoor environment, signals are subject to attenuation and multipath. This attenuation creates a power loss during the transmission. The distance using \(RSSI\) value is complicated because of the attenuation, which is not a linear function in an indoor environment. For this reason, the parameter \(n\) in Equation (1) varies from 1 to 6 depending on the environmental conditions. For this reason, the \(RSSI\) model takes into consideration the fade margin. As a result, Equation (1) [19] can be leveraged in order to calculate the distance. We repeated the \(RSSI\) measurements several times for accurate data, where \(k\) is the number of repetitions to get a realistic distance based on different \(RSSI\) measured values. \(RSSI\) is the value measured by the receiving node. \(D\) is the distance between the two nodes, while \(n\) is the environmental conditions. \(A\) is the absolute value of \(RSSI\) for a distance of 1 m. The manufacturer of the node provides this absolute value.