Rssi-based Algorithm for Indoor Localization

Wireless node localization is one of the key technologies for wireless sensor networks. Outdoor localization can use GPS, AGPS (Assisted Global Positioning System) [6], but in buildings like supermarkets and underground parking, the accuracy of GPS and even AGPS will be greatly reduced. Since Indoor localization requests higher accuracy, using GPS or AGPS for indoor localization is not feasible in the current view. RSSI-based trilateral localization algorithm, due to its low cost, no additional hardware support, and easy-understanding, it becomes the mainstream localization algorithm in wireless sensor networks. With the development of wireless sensor networks and smart devices, the number of WIFI access point in these buildings is increasing, as long as a mobile smart device can detect three or three more known WIFI hotspots' positions, it would be relatively easy to realize self-localization (Usually WIFI access points locations are fixed). The key problem is that the RSSI value is relatively vulnerable to the influence of the physical environment , causing large calculation error in RSSI-based localization algorithm. The paper proposes an improved RSSI-based algorithm, the experimental results show that compared with original RSSI-based localization algorithms the algorithm improves the localization accuracy and reduces the deviation.


Introduction
More than 80% information is related to spatial location, and modern people spend about 80% -90% time of their whole life indoors.Now along with the popularization of information and communication technology, people's demands for indoor location information are growing.In some public places, such as shopping malls, airports, exhibition halls, office buildings, warehouses, underground parking, prisons, military training bases, people need precise location information.Precise indoor location information can be used to achieve efficient management of the available space and inventory substances; can help police, firefighters, soldiers, medical staff to complete specific tasks; smart spaces and pervasive computing are also inseparable from the location-based services.So currently, indoor localization is a hot research with broad application prospects [9].
Compared with outdoor localization, the difficulty of indoor localization lies in that indoor maps pay more attention to small areas, large-scale, high precision and subtly display of the internal elements [7].
Along with the rapid development of wireless networks and smart phones, the number of WIFI access points increase dramatically and most WIFI access points' locations are fixed.This phenomenon suggests a new direction for indoor localization research in wireless sensor network.
Existing wireless localization algorithms require either special hardware support or complex computing, which consuming valuable battery resources greatly, especially comes to smart phones or sensors.The contribution of this paper is that it proposed a new algorithm，which increase the indoor localization accuracy without any additional hardware support or increasing the computational complexity.

Indoor Localization Technologies
There are many wireless localization technologies and solutions.The commonly used localization techniques include infrared, ultrasonic, radio frequency signal, Bluetooth, and Ultra-Wideband, WIFI, etc. [8], but they are not suitable for indoor localization.Infrared is only suitable for short-distance transmission, and could easily be influenced by fluorescent lamp or the light in the room, there are limitations on the localization accuracy; ultrasonic, Bluetooth and Ultra-Wideband require special equipment, the cost is too high, hence they are not widely used; RF signal does not have communication capability, and is not easy to be integrated into other systems.
At present, more and more indoor WIFI access points are open and free.The most widely used localization technology is using WIFI.

Localization Algorithms
Wireless localization algorithms can be roughly divided into two categories [2], Range-based and Range-free localization algorithms.Range-based localization algorithms mainly include RSSI-based trilateral localization algorithm, arrival angle algorithm (AOA), arrival time algorithm (TOA) and time difference of arrival (TDOA) algorithm.TOA requires precise clock synchronization; TDOA node is equipped with ultrasonic transmitters and receivers; AOA needs antenna array or microphone arrays.These three algorithms' localization accuracy is high, however with high hardware requirements.
Range-free localization algorithm mainly includes centroid algorithm, DV-hop algorithm, MDS-MAP algorithm and convex programming.Range-free algorithms mainly use the geometric relationship between neighboring nodes to estimate localization.They have low hardware requirements, but the localization accuracy is too low for indoor environment.
Because of its simple, easy-understanding and low cost, RSSI-based trilateral localization algorithm has a wide range of applications.

Wireless Signal Propagation Loss Models
In this paper we use the mainstream logarithmic distance path loss model, i.e., log model.The propagation model points out that whether in indoor or outdoor channel, the average received signal power decreases with the logarithm of distance.This model has been widely used.For any T-R distance, the path loss is expressed as: In the above formula, 0 represents near earth reference distance, is the signal strength at distance 0 and d  is the signal attenuation factor and its value is between 2 to 6 in different environments.

Trilateral Localization
Assume there are n anchor nodes, and the location of the unknown node is ( , )  x y , ' i is the estimated distance between the unknown node and the anchor node x y obtained by using the log-model and repre-sents the real distance.Then The difference between the real distance and the estimated distance is expressed as  cannot be zero, the solution of acquiring the best estimated location is to use the least squares algorithm to make From (3) we can get n formulas as follows: ( 1,2,... ) Use the prior n-1 formulas minus the formula respectively; we can get n-1 new formulas: then we obtain the following equation: Usually i in b is unknown, but i composed of can be estimated by the model mentioned before, so The more beacon nodes there are, the higher localization accuracy we get, but the greater the cost.In real cases, three anchor nodes are enough to locate an unknown node, so we take n = 3. Figure 1 shows the trilateral localization algorithm.

The Improved Algorithm
In this paper, a new algorithm is proposed through combining the original RSSI-based localization algorithm and signal propagation characteristics mentioned in [1].The experimental results confirmed that the proposed algorithm does improve the localization accuracy.

Algorithm Idea
In the original RSSI-based localization algorithm, when measuring the actual RSSI values of the beacon nodes, the error caused by the obstacles (i.e., when the device holder's back towards the WIFI node, the device holder is the obstacle) or the antenna direction will be persistently substituted into the formula involved in the operation, the error becomes greater with the accumulation.This is one of the main reasons of the big error in RSSI-based localization.[1] proposes that when a device holder stands with his back towards the WIFI access point, a sharp decline of the WIFI signal appears due to the blocking of body.In the paper, mobile device owners do 6 s  uniform motion while collecting data once per second and one revolution takes one minute.But in reality, this cannot be done in all circumstances.So we use built-in gyro sensor in smart phones to collect intensity value of the gyroscope while collecting WIFI signal.The rotated angle can be obtained by calculating the gyro sensor values, so that even if our rotation is non-uniform motion, the RSSI value and the rotated angle can be recorded within a shorter time.The observed signal strength profiles with user rotation are shown in Figures 2-4:    Figure 2 shows that the signal profile displays a clear low signal artifact when a user holds different phones.In Figure 3, we repeat the above experiments using different persons, with varying heights and weights.The same artifact consistently appears.In Figure 4, with different APs, the low signal artifact still comes across clearly in measurement results.This demonstrates that the low signal effect appears stably when the device holder's back faces the WIFI AP, the RSSI values will decline.Using gyroscope saves time, breaks the restrictions of the uniform motion, maintains the accuracy simultaneously (the average error is 5°to 15°).
In most cases, when the device holder faces the WIFI access point, the WIFI signal attenuation is minimal.If we can find the direction of facing the WIFI access point and use the RSSI value on this direction as the trilateral localization input, then the accuracy of the subsequent calculations to obtain the position will increase.[1,4,5] have proposed algorithms of looking for WIFI direction.[1] uses sliding window on the RSSI data, while [4] and [5] use RSSI gradient map.Finding WIFI access points make people get faster data transmission rate by shortening the distance to WIFI point, it can also be applied to rescue tasks.Here we combine it with original trilateral localization algorithm to get higher localization accuracy.It is a simple calculation algorithm without requiring any additional hardware support.Because gradient algorithm is more complex than the sliding window algorithm and for mobile devices the battery resource is limited, we decide to use the former.
Let the mobile device holder spins around to collect tetrad   represents the RSSI value of the WIFI access point.Use the sliding window to process the collected data to obtain the facing angle th j  th i    .In order not to increase the complexity of the algorithm, we take the average of the RSSI values in the interval   as the input of the trilateral local- ization algorithm. 1 The angle error calculated is between . (


To reduce the error as much as possible, we take β = 15.
Using formula (8) we can obtain i AveRSSI .Respectively, substitute the three values into the log model and get the distances of the mobile phone to the three WIFI APs.Then use the least square algorithm mentioned in section 3 to get the phone's position.The experimental results prove that this algorithm can obtain higher accuracy and less error than the original trilateral localization algorithm without any additional hardware support.

Experimental Environment Parameter Fitting
The signal propagation is susceptible to the influence of environmental factors, such that under different circumstances, the degree of signal attenuation differs [3].We reduce the location deviation caused by environmental factors by fitting out the initial model parameters complied with the current environment.
In the experiment, we took (m/km) and collected 20 groups of

 
  ) , then we can obtain the matrix equation (10) as follows: The problem of finding the initial value   0 PL d and attenuation factor  that applies to the current environment turns into computing the value of X that satisfy the formula (11), to minimize that the sum of the squares of the difference between the calculated function curve and the observed value, we get the following expressed as: The solution to the formula (11) is 1 ( ) 2) to gain the model that adjusts to the current environment.
Using the above algorithm, the initial parameters for the experimental environment we get is shown in the following Table 1.

Establish the Coordinate System
The size of the laboratory is about .Figure 5 shows the layout of the laboratory.There are three wireless routings deployed at three non-linear different places.Take the east as the positive direction of the x-axis, and the west-north of the laboratory as the origin.

Experiment Results
In Table 2, AFT which represents our algorithm, means AP Faced Trilateral.It shows the statistics positioning result of traditional trilateral and AFT, including the average positioning deviations and positioning deviations under the best and the worst circumstances.
Figure 6 shows the comparison of the positions calculated by using the proposed algorithm and the original algorithm respectively.It can be seen that the computed positions of the improved algorithm are distributed in a circle with a radius of 1m, (3.6, -3.3) as the origin, and the computed locations of the original algorithm are more dispersed.
Figure 7 shows the error comparison that obtained in the 20 tests between the two algorithms.It can be seen that in the vast majority of cases, the improved algorithm gained the higher accuracy than the original algorithm, and only in a particular case, the presence of the multipath effects in signal propagation, making the algorithm failed.

Conclusions
Although the experiment results show that the proposed algorithm in this paper raised the localization accuracy without increasing the complexity and cost, but the algorithm is still defective.First of all, people can only localize themselves where at least there are three WIFI access points around; second, the frequency of mining data can only adopt the minimum value between the gyroscope sampling rate and WIFI scan rate to ensure not collect useless data.Gyroscope is a short-time precision instrument, so the gyro accuracy cannot be fully utilized and cannot get more intensive WIFI access points' data.It will be the further research direction, and if these two problems can be solved, the indoor localization accuracy can be further improved.

Figure 2 .
Figure 2. Data from different phones.

Figure 4 .
Figure 4. Data from different WIFI Aps.

Figure 6 .
Figure 6.The location of the unknown node computed by these two algorithms.

Figure 7 .
Figure 7.Comparison of the computed deviation of the these two algorithms.