Non-Line of Sight LoRa –Based Localization using RSSI-Kalman-Filter and Trilateration

This research builds a Localization System using Long Range (LoRa) Network. This research also analyzes the performance of the positioning method in the Low-Power Wide-Area Network (LPWAN). LPWAN technology is radio-based communication that low power usage and wide area coverage. The method that analyzes in this research is the combination of the Received Signal Strength Indicator (RSSI) with the Trilateration Method. This research also filtered the RSSI value using the Kalman filter method for smoothing data. The localization system traditionally based on Global Positioning System (GPS) device. However, GPS technology not working well in Non-lineof-sight (NLOS) like an indoor location or mountain area. The other way to implement the localization system is by using LoRa technology. This technology used radio frequency to communicate with each other node. The radio frequency has a measurement value in the form of signal strength. These parameters, when combined with the trilateration method, can be used as a localization system. After implementation and testing, the system can work well compared with the GPS system for localization. RMSE is used to calculate error position on these methods, the result from three methods used, the value from RSSI with Kalman filter have a close result to actual position, then value GPS follows with close result from Kalman filter, and the last one is RSSI without Kalman filter.

other node that closest distance and help end node to forward data called by Base Station (BS) [7]. The LoRa network have some configuration in physical layer, there are Carrier Frequency (CF) for setting the radio frequency from LoRa, Spreading Factor (SF) for determining the number of chirps used to represent a symbol, Bandwidth (BW) for representing the amount of frequency when transmitting, Coding Rate (CR) for handle packet error rate [8], [9].
One feature in radio-based communication is can be used as a localization system. The localization system usually using GPS to get the latitude and longitude from objects to mark its position on earth [10], [11]. GPS has some drawbacks when detecting the location in the NLOS environment. First, The GPS not working well in indoor location because the satellite signal will block by building material like brick, metal, stone or wood [12], [13]. Second, The GPS considers the mountains or hilly area to be a noise because the contour of the area is bumpy so the GPS is difficult to get signal from satellite [14]. Based on the problem, this research uses other technology to implement a localization system that supports for NLOS environment.
This research will use LoRa to build a localization system. LoRa is based on radio frequency, the radio signal from LoRa has a Received Signal Strength Indicator (RSSI) as signal strength parameter [15], [16]. The parameter can be used to determine the position of the object when it enters the LoRa network. The advantage used of LoRa for the localization system is a wide range of area coverage and low power usage. The other advantage is LoRa is cheap and easy for use because of no requiring additional processing power [17]. The popular method for localization system based on radio frequency is RSSI, but this method needs an algorithm to process RSSI data into a location of objects [18]. Trilateration can process RSSI values that have been converted into distances to be processed into coordinates of objects. This algorithm needs a three-point coordinate of BS from LoRa [19]. Each BS from LoRa has a radius, so it can be described as a circle. Trilateration is calculated as the intersection point of the three circles from LoRa BS to determine the (x,y) coordinate from the object. The determination of the position of an object using three BS of LoRa can be seen in Fig 1.

II. LITERATURE REVIEW
The research proposed a new RSSI-based localization method using LoRa Network. The research proposed a localization method for the noisy outdoor environment. The research proposed a new algorithm for improving the localization method in noisy outdoor environments.
The other research about the LoRa-based localization method using RSSI and trilateration. The research experiment in an area without obstacle and other inference. The research also comparing the localization method using GPS [20]. The last research about localization in the LoRa network using the RSSI method and combine with some algorithm. The research comparing algorithms that combining with RSSI. The algorithm that compared is trilateration, min-max, and maximum likelihood. The experiment is in indoor and outdoor environments [21]. Using mobile device communication and not using an embedded system that makes noise manipulation already performed on the device, while the beacon node still uses an access point that has noise correction that resembles a mobile device W. Bulten, A. C. V et al [22] Using enhanced Kalman filter to reduces spikes data.
Tested on indoor area and number of noises created from one source, made the data already fixed on several point tested.
From table 1 can concluded on the previous research that focus on Trilateration and using Kalman filter, few of researches didn't merge the result from Trilateration and Kalman filter which have an accuracy based on some method, and the technology used on previous research didn't use LoRa as main device to test, previous research also tested on indoor area which have few noises factor different from this research that tested on outdoor area that have a large of number noises factor such as trees, building, and much more.
On this research based on the other research, there is no filter for the RSSI noise during the process with the trilateration algorithm as a localization method. This research conduct to filter RSSI using Kalman filter before processing with a trilateration algorithm, and this research will show high accuracy localization by merging these methods on NLOS area using LoRa.
This study uses the calculation of Root Mean Square Error (RMSE) to validate output from Kalman filter and Trilateration method, validation is done to ensure that the results of this mixed method it is produce high accuracy and low error between predictive positions to actual positions rather than GPS position localization on NLOS environment [23].

III. RESEARCH METHOD
This research begins with the introduction section that explains about identify the problem from the traditional localization system in a wide area and NLOS environment. The introduction section also explains the alternative system that can implement the localization systems. Then the literature review section explained and comparing this research with research that has been done. After identifying the problem, in the research methods section, this research study more detailed about the method used in the localization system using radio frequency that suitable for LoRa technology. In the next step, in the result and discussion section, this research implements the LoRa technology with the localization method based on radio frequency. The section also explains the testing scenario and testing result for performance evaluation of implementation localization method in LoRa network.

A. Localization Techniques
This research will use the RSSI method to determine the position of the object. Usually, the RSSI value of the radio signal in LoRa has a noise that must be filtered. The noise is caused by obstacles, consequently the LoRa signal to be disturbed. In the NLOS environment, the obstacle will be very numerous and very disturbing signals from LoRa. This research will use the Kalman filter method to filter the noise from RSSI value in LoRa [24].
To address the noise problem a Kalman Filter is applied to filter signal strength measurements. The Kalman filter works by estimating the ideal RSSI value on a radio signal by using the previous RSSI value model, the general form of the transition model is like equation 1 [22].
where x is RRSI value that combination from in matrix transformation A. is input control and ϵ is noise value. In this research, device will stop in 10 second in particular moment, in the moment the value will ignore and set as a matrix identity, finally a simple model is formed in the equation 2.
The equation 2 is applied to estimate how much needs to be normalized from noise at the RSSI value.
Each BS will spread the radio signal to scan the coverage range. When the object (node with radiofrequency) enter into coverage range from BS, the object will convert RSSI from each BS to distance value in a meter. After filter RSSI data with the Kalman filter, then the RSSI value will convert to distance. The equation in equation 3 explains how to convert from RSSI to distance.
Where d is distance between base station and end node in meter, then A is the signal strength which is received from reference nodes (end node) at the distance in dBm, RSSI is RSSI value in dBm, and the last n is constant and the value depends on the environmental factor, this research used default value of 2.
After each distance from BS is calculated by the end node, the location of the object can determine, but just by distance. Figure 1 is an example of how the RSSI can determine the location of the object by convert RSSI to distance. The next step is to calculate the distance using a trilateration algorithm to detail the position from the object. This algorithm is commonly used to determine the position based on the distance between transmitter and receiver. This algorithm is very suitable for the RSSI method because we can calculate the distance between the transmitter (base station) and receiver (end node) using RSSI. This algorithm is a geometry-based algorithm. Equation 4 explains about trilateration algorithm for calculate position using RSSI.
Where di is distance between base station and end node in meter and i is ID from base station. Then xi is base station X axis coordinate and i is ID from base station. After that yi is base station Y axis coordinate and i is ID from base station. And finally, x and y are actual coordinate from object (end node) which will be computed.
This research will use three base stations to determine the position of the object. The iteration from equation 4 will repeat three times for three different base stations. Based on Fig 1 and equation 4, this research has three equations for three circles. The equation can see in equation 5, 6, 7.
The solution from determine the X and Y position from the object become equation 15 and 16.
The localization technique method based on RSSI and trilateration used equation 15 and 16 to compute the position from an object in LoRa Network for the localization system.

A. System testing environment.
This research used Dragino LoRa Arduino shield for BS to detect an object. The object is equipped with a LoRa Sx1276 module with a 915 Mhz frequency configuration and uses ESP32 microcontroller. The gateway from each node using the Dragino LoRa raspberry hat. The gateway also used as the main BS and the task is getting all data from each other BS to process the data. The antenna from LoRa in each node (BS, Gateway, End Node) used 3 dBi. The power resource for each node and end node (except gateway) used 9V battery, the gateway used 12V adaptor power resource. Then during the trip, the base station receives a signal from the end node which will then be forwarded to the gateway. Because some of the data have a bad condition because of the noises, then applying Kalman Filter is needed to normalize the data. After being filtered, the data will become a parameter to Trilateration to predict the exact location of end node position.
The Spreading factor (SF) configuration from LoRa used SF 9 and the frequency is 915 Mhz. This configuration was chosen because it has a good packet delivery ratio for distances of 240 meters, has a low packet error rate for distances of 240 meters, and has an RSSI mean value not more than -95.16 dBm for distances of 240 meters. The 240 meters distance represented the maximum distance between each base station in our trial area. The GPS used in this research for comparison data is getting from mobile phone GPS data. The specification is Samsung type A10 with operating system Android version 9 and GPS version 10.34.3.

B. Experiment environment and Location Overview
The testing area is located at Telkom University, Bandung, Indonesia (-6.976532, 107.630788). The arrangement of all BS will be arranged as shown in

C. Testing Result
The test measured in this study is accuracy for distance determination in the localization method. The accuracy of the method proposed for localization will be compared with GPS. The first step for the testing mechanism is to make an object travel plan using Google My Maps. The object travel plan will form a path for testing the movement of the object. The path from an object travel plan can see in fig 3.
In Fig 3, the orange point is the start point and the brown point is the finish point from an object travel plan. The yellow line is the object moving path from start point to finish point. The length of the object's movement path (yellow line) is 397 meters. The object is equipped with LoRa and GPS, then the object will travel from orange point to brown point based on the direction of the object's movement path (yellow line). Along the path of object movement, there is some stopping point that dotted by a red point. The stop point is used to get stable GPS (latitude and longitude) and LoRa (RSSI) data. The object will stop at a stopping point with approximately 5-10 seconds. After getting all data from GPS and LoRa, then all the data will be converted into a path. All produced paths will issue a distance value. The distance value from all produced path can see in Table 1.  TABLE II  PATH DISTANCE DATA  The distance from Table 2 shows that the distance from the path created with LoRa Kalman filter close to the actual distance. This means LoRa with Kalman filter can make a better object path for tracking in the localization system. The visualization from a path created with the Kalman filter can see in figure 3. The path from an object moving in figure 3 represented with red line. The path is created using LoRa RSSI that filtered with Kalman filter and processing using the trilateration method. The blue point in figure 3 is the position from BS, the BS position is the same with a blue point in fig 3. Based on figure 3, RSSI that filtered with Kalman filter and process using the trilateration method can know positioning from the object and can make tracking path from the object. This means LoRa is suitable for the localization system because it knows the tracking path from the object. The graph in the fig 4 is the data entries from the end node, then received to the nodes, then the data is collected to the gateway, after that the RSSI graph data without the Kalman filter has messy value because of the environment that caused noises as showed at fig 3, while RSSI value using Kalman filter more tidy and normalized data, it is used Kalman filter to reduce the possibility of data that has multiple data or unstable RSSI values in the payload data of a particular node.
The other testing measures the error value from latitude and longitude data from GPS, RSSI-LoRa without Kalman filter, and RSSI-LoRa with Kalman filter compared with latitude and longitude data from Google My Maps application. The error measurement will measure with equation 17.
Where Err is error value from latitude or longitude data in percentage (%). rv is the reference value from latitude or longitude data. This research used Google My Maps as reference data. mv is the measurement value from latitude or longitude data. This research used GPS and X, Y data from LoRa with kalman filter and without kalman filter that already convert to latitude and longitude data.
Before comparing latitude and longitude data, the X,Y position from the object that process with trilateration based on RSSI-LoRa without Kalman filter data and RSSI-LoRa with Kalman filter data must be converted to latitude and longitude format. The equation for convert X,Y position to latitude and longitude GPS data using the equation in equation 18-20.
where ( + ℎ) is the radius from the earth, ϕcos is latitude value and λ is longitude value, Z value just to be valued from earth pole, and e is value of previous distance of X and Y.  Table 2 shows the results of the error value using equation 17, by using equation 17, the latitude and longitude error position were calculated based on the real latitude and longitude. From the result of table 2 is concluded that the difference in position points between GPS, RSSI and Kalman filter, and without the Kalman filter to the actual position, the value of each method has a significant result due to the output generated by Trilateration and the environment from the test area.
The result from latitude and longitude data from every stop point in fig 3 is the GPS data has an average latitude error value of 0.00046376% and an average longitude error value of 0.588279%. The RSSI without Kalman filter has an average latitude error value of 0.00049753% and an average longitude error value of 0.00006712%. The RSSI with Kalman filter has an average latitude error value of 0.00022758% and an average longitude error value of 0.000035%. Based on these data it can be concluded that the latitude and longitude errors in RSSI using Kalman filters are less than GPS and RSSI without Kalman filters, and as the result of the trilateration can be seen at fig 5 where the green dots are predicted position based on the result from trilateration and Kalman Filter.

V. CONCLUSION
This research succeeded in applying the localization system for NLOS environment using combination of the filtered using Kalman Filter, RSSI method and trilateration method in LoRa Network on NLOS area. This research also proof that LoRa is suitable for localization system in NLOS environment, with the condition as showed at fig 3 that all areas covered by LoRa network signal. The RSSI value that filter using Kalman filter method can improve the path for an object. The value from RMSE method also showed that RSSI using Kalman filter have a better result than other methods which have the minimum error from the actual positioning as shown at fig 6. And the distance from the path created by RSSI filtered using the Kalman filter to be close to the actual distance with error value is 5.0%. The distance path that created using non-filtered RSSI have an error value 22.9% when compared with actual distance. The worst results are shown by the distance from the path made by GPS with error value is 27.2%. Which the result showed that this research have higher accuracy than previous research with same method but without merging trilateration and Kalman filter.

VI. DATA AND COMPUTER PROGRAM AVAILABILITY
The resource link for code and data from this research is accessible on the following internet address https://github.com/wianoski/geolocation-using-rssi-with-Trilateration-and-kalman-filter.
ACKNOWLEDGMENT Thank you to the Internet of Things Studio, Telkom University which has become a place for researchers to develop this journal research. Hopefully, this research can make a major contribution to the advancement of technology in Indonesia