Modified weighted centroid algorithm for indoor and outdoor positioning using wireless sensors network

Positioning, either outdoor or indoor, has been one of the most attractive fields for researchers to study and they apply different approaches in order to allocate a moving object. Some positioning approaches use Received Signal Strength (RSSI) in order to determine the location such as Fingerprinting, and Weighted Centroid Localization (WCL). On the other hand, some approaches use signal travelling time such as Time of Arrival (TOA) and Time Difference of Arrival (TDOA). However, the accuracy is still low due to the effect of RSSI to moving objects. This paper shows how to allocate a blind node in a wireless sensor network (WSN) using the proposed WCL approach and shows how the enhancement of the algorithm made better accuracy with mean square error, MSE, of 64.5 cm for indoor positioning and 123.0 cm for outdoor positioning. One of previous WCL approaches reached accuracy with an error of as low as 15.0 cm but in simulation, and others used different approaches with MSE of 80.0 cm and another as high as 2.6 m.


Introduction
*Most researchers manipulate RSSI for positioning. Other techniques like TOA or TDOA are studied by some researchers however their approaches are hard to be implemented practically and done mostly in simulation. Even though RSSI is less accurate but it is the most applicable to be implemented in real environment due to the implementation difficulties that time-related techniques require such as time synchronization between network nodes (Henniges, 2012). This paper uses RSSI for positioning in WSN which is using Zigbee technology and there are other approaches that use WiFi technology for indoor positioning as in Alshami et al. (2014Alshami et al. ( , 2017. Using RSSI for positioning in WSN is also the main approach for most researchers but researchers should take in mind that RSSI readings in WSN is not as strong and accurate in other technologies due to the low bandwidth that WSN has, so RSSI might still be efficient enough for positioning in WSN as long this point is taken in consideration. Not just horizontal distances could affect RSSI measurements; also vertical distances could affect the readings. Habaebi et al. (2014) had some experiments on RSSI in WSN and in their results found that RSSI measurements in indoor environment for 3D positioning at 1 m show the best results, whereas the 1.6m height was the worst. They concluded that external factors could affect RSSI measurements such as the obstacles between the receiver and the transmitter, such as people moving around and the antenna of both of them (Alshami et al., 2016). Approaches that used RSSI are different and the goal of each is to minimize the MSE as low as possible. Chen et al. (2012) reached and MSE of 2.6 m and back in that time it was good, and the researchers continued enhancing the accuracy and that is why we can notice that recent approaches reaches an MSE less than 1.0 m as we can find with Baccar and Bouallegue (2016).
As most of many other positioning algorithms, WCL uses RSSI in order to calculate estimated position. The principle of the traditional centroid localization algorithm is that if a blind node is in the range of a reference node then it has to be in its range forming a circle which its center is the coordinates of that reference node. And if the blind node is in the range of more than one reference nod then it has to be forming a circle with each one and by that a potential position are is created within the intersection of all formed circles. WCL, as with Wang and Zheng (2014), works the same way but enhanced by the idea of having a weight for each reference node. This weight reflects the contribution of each reference node to the localization process. Its basic fundamental is to use the relation between the RSSI value and how it got affected by the distance between the blind node and the reference node. Assuming the RSSI of each reference node as a radius of a circle centered by the coordinates of the reference node and the blind node.

Positioning
Many positioning approached uses different technologies. For a big scale outdoor positioning GPS is the optimal choice but for indoor positioning many methods could be used such as WiFi, as in Alshami et al. (2017) which used fingerprinting to estimate positions or WSN which this paper is implementing using the work flow shown in Fig. 1. In general, most of these approaches use reference nodes in order to estimate the position of a blind node. In this paper, a minimum of four nodes should be used three as reference nodes and one as the blind node to be positioned. The technique used is called trilateration which calculate the position of a blind node by estimating its location from each reference node. As RSSI could indicate the distance between the reference node and the blind node, all RSSI values for each reference node will be used as weight in our WCL algorithm.

WCL algorithm
The idea of WCL algorithm is based on the relation between the RSSI of a blind node to each reference node and the distance between it and each of them. RSSI values increases by the increase in distance and that could be considered as a good factor to calculate the weight that affect the distance calculation between the blind node and each one of the reference nodes. According to Wang and Zheng (2014), the weight could be calculated from the following: { = 1 * 1 + 2 * 2 + 3 * 3 +⋯+ * 1 + 2 + 3 +⋯ = 1 * 1 + 2 * 2 + 3 * 3 +⋯+ * 1 + 2 + 3 +⋯ (1) = 1 + 2 + 3 +⋯+ (2) ∈ (1,2,3, … , ) where i is the reference node number, w is the calculated weight. As RSSI increases by distance, applying (1) will lead to decrease the actual contribution of the nearest reference node to the blind node in the localization process and at the same time increase the contribution of the farthest one and in order to reflex that then the actual weight could be as the following: Because RSSI value does not start from 0 and because reference points should be in higher location of the surrounding to avoid obstacles as much as possible, experimental results show that RSSI value is in the range of [47][48][49][50][51][52], so a reasonable estimated value M that normalize the RSSI values should be taken in consideration in order to get better accuracy. In this experiment M is estimated by 50. So, applying that on (3) then w would be as the following: As w is the weight that will be used to estimate the coordinates, then the weight of each reference node most be a fraction of the total weight of all reference nodes, but as (4) is actually an inverted ratio then each wi will not be a fraction of total summation of wi for all i in [1 -n] any more. In order to solve this, simply, we can just calculate the ratio of each wi to the total summation of all of them and the result will be the new value of the weight as in the following: where wii is the final calculated weight for all reference nodes with coordinates (xi, yi), i is the number of each reference node. Applying (5) on (1) will give us the estimated (x,y) for the blind node and this algorithm should be implemented by the java application that shows the layout map with the estimated position of the blind node.

Results and analysis
The algorithm was implemented for a predetermined position in an indoor environment using normal WCL algorithm as in (3) (4), and with shifted and inverted weight as in (5). Finally, and to check other possible approaches, the inverted weight was implemented without shifting. Fig. 2 shows that normal WCL makes good result but with the lowest accuracy and the shifted inverted weight is the best accuracy of them.

Fig. 2: Different approaches of WCL
After making sure that inverted shifted weight approach is the best to be use, the experiment was conducted for indoor environment and the calculated result were as in Table 1. From the results in Table 1 and using the known equation to calculate accuracy as explained in Ou et al. (2015), the accuracy formula to estimate Mean Square Error, MSE, is: Then MSE would equal 67.5cm. Applying the same approach for outdoor environment the results were as in Table 2.
By applying (6) from the above results, we found that the accuracy MSE for positioning in outdoor environment would be 123.0 cm which is also a very good result for positioning in wireless sensors networks using WCL.