# Development of Localization Module for Various Smart Devices Platforms

Ondrej Krejcar

► To cite this version:

Ondrej Krejcar. Development of Localization Module for Various Smart Devices Platforms. Networking Workshops (NETWORKING), May 2012, Prague, Czech Republic. pp.133-138, 10.1007/978-3-642-30039-4_17. hal-01533575

HAL Id: hal-01533575

https://inria.hal.science/hal-01533575

Submitted on 6 Jun 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Development of Localization Module for Various Smart Devices Platforms

Ondrej Krejcar¹

¹ University of Hradec Kralove, FIM, Department of Information Technologies, Rokitanskeho 62, Hradec Kralove, 500 03, Czech Republic
Ondrej.Krejcar@ASJournal.eu

**Abstract.** This paper deals with the localization module extension for various platform to support locating in the interior. Any mobile devices (vehicles) can be equipped with a GPS module for location, but in areas with high density in the building interior or city centers a location using GPS is not suitable due to insufficient signal. The solution for these sites can be seen in use of existing WiFi infrastructure. The result of described paper is software module for mobile device. This localization module communicates with the WiFi module for position evaluation of mobile device based on maps and signal strengths of visible WiFi APs.

**Keywords:** WiFi; localization; multilateration; Gaussian filter; vector map

## 1 Introduction

Modern digital world where we live is Smarter and Smarter, whereas information systems (including mobile devices) are more sophisticated, complex and Smarter. Operation systems are nicer, smoother and can predict user needs what means "Smarter" [9].

Current modern mobile phones are recognized as smart devices so they are called "Smart Phones" (Classic design of mobile phones is going to side track). There are several different operation systems existing for Smartphone devices as Windows Mobile, Apple iPhone iOS, Google Android, etc. However each one is trying to implement as much Smart capabilities as possible.

By the term mobile device we understand in this paper not only mobile device known as Smart Phone, but all kind of mobile devices as vehicles, robots, etc. These mobile devices are now used for various tasks from basic types (e.g. car now carry a wide variety of activities, from washing) through the sophisticated ones (e.g. automatic machining of materials) to an intelligent robot machines for separate survey and or collection of environmental samples. The mass deployment is now mainly in areas of human activities that are stereotyped and are relatively easy to replace by automate, or vice versa, in areas that are inaccessible to humans, eventually dangerous or other reason.
In particular, advances in computer technology and machine perception now makes it possible to construct mobile devices that does not operate stereotype on the basis of a predetermined procedure, but on the basis of interaction with the environment through sensors. These devices are then characterized by some degree of "intelligence" and are capable of sensing data based on a certain level of deciding on further action. The basic problem of autonomous mobile devices is their unique location in space. These devices can be equipped with an array of sensors that enable it to perform various kinds of transformations based on sensors measurement (which provide a position in space).

We can use odometry or different types of distance measurement by ultrasonic or laser sensors. These relative localization methods are unfortunately inaccurate (e.g. accumulation error) and often they cannot determine the position (space symmetry, the same corridor in different floors, etc.). As a solution for such cases an absolute positioning methods can be used.

A prototype of mobile exploration vehicle was developed for testing purposes [5]. The vehicle use a number of sensors for orientation in the 3D space. To determine the absolute position in space, vehicle also use a standard localization based on the GPS module to determine the absolute position in space. Location is based on Multilateration. For correct and accurate location in 2D space it is needed to get a line of sight with at least 3 satellites and a sufficient signal. Civilian GPS uses the frequency of 1575.42 MHz (UHF). The use of this technology is unfortunately limited to the above-mentioned line of sight [1]. To locate in these areas is offering the use of WiFi, or some other technology of signal transmitting [7]. The aim of this work is to develop a universal SW localization module which allows localization of various kinds of mobile devices in the interior just using known WiFi network architecture and known WiFi AP position in 3D space.

## 2 Problem Definition

Wireless localization can be deployed with greater or lesser success in virtually every situation where we have a greater number of broadcast stations, which can be distinguished from each other and determine their distance [6]. Resolution stations can be either based on agent based access with using different transmission channels, carrier frequency, or by a unique identifier (e.g. MAC address) [8].

Location in case of GSM is not sufficiently accurate for its refinement, although it could be used fingerprints, but for this application it is not appropriate.

GPS is already used in the vehicle, but not usable in buildings. Galileo will encounter the same problem, and then again this solution is not applicable.

Localization with RFID requires the installation of a large number of readers, and is useful for monitoring product, but not for "continuous" localization.

Bluetooth and ZigBee achieve similar localization features such as WiFi and are quite commonly used in industry. However, in general the extension is not sufficient and would be pre-installed in the planned deployment destination of the vehicle. It is not acceptable, and for this reason will be selected a WiFi, which can be used today almost ubiquitous infrastructure.
# 3 New Solution

For the actual location it is especially important to recalculate the value of the RSSI of WiFi signal on the distance from the transmitter [2]. Because the signal is burdened by losses, needs to be filtered before processing. Filtration is carried out with Gaussian filter and calculates the actual position with multilateration [3]. For barrier-free environment, where we expect a smooth sloping curve, can be used to predict losses spread basic empirical model. By modifying the basic empirical model a Lost-Path model can be obtained, which further expands upon the relationship of the antenna gain, loss and slow the spread of losses. Lost-path model is used further as the basis for localization model [4].

# 4 Implementation

Localization module for the vehicle is the main part of this work. It is written in C++. For debugging under Windows, the application is platform independent, although the target device is based on Linux. The emphasis is on code portability and re-usability. Classes that are not directly related to location core are written in the form of components, independent of other classes and have been tested and tuned separately. The properties of C++ are used and concept of event-driven application is used. In application exist outside the main thread another 4, so taking the effort to stay as long as possible in sleep, that location did not take much of needed computing power for other processes in the vehicle.

## 4.1 Principles of Operation

The application has two primary inputs and 1 output. The input is the address to the WiFi module and the second input is path to the file with a map. The output is the approximate position with tolerances. When application is started, the map file is loaded into memory and immediately closed. It can be further used by other processes of the vehicle. We created also a parallel thread which periodically reads the information of visible APs and store it to list of pairs MAC address and RSSI values. The list of pairs is forwarded to the process that the steam expands by information from the map. This information is a coordinates, antenna gain, path loss and propagation exponent. If any of this information is missing, the default value is used. You can also enter the following and that least some influence of the environment. Couples who do not have information in the map are removed.

The next stage is to record RSSI history and Gaussian filtering RSSI. The result of this step is a list of AP items, which have position, filtered RSSI value and other necessary data to calculate multilateration. Multilateration first sorts the items according to signal strength and then remove items with a very weak signal. These APs are typically far and the signal is strongly affected by the fraud and bring it calculation error, which is too large. In addition, they can be after the Frances break. It is left to only a certain maximum number of items that the calculation did not last
too long. Matrix H and B are created from the remaining items. The calculation is
then performed using the multilateration formula listed above. The application is built
on several basic encapsulated classes which are separated by interfaces. For
communication between them and between the individual threads are used events.
Application architecture demonstrates the diagram of components [Fig. 1].

<figure><img src="image_2.png" /><figcaption>**Fig. 1.** UML diagram of application components.</figcaption></figure>

**WiFiLocator** - Application is based on the class **WiFiLocator**. When application is started, instances of classes **GaussianLocationEngine**, **MapLoaderMAP** and **ScanSourceAP** are created. **ScanSourceAP** - The class takes care of communication with the WiFi module. After its launch, the module is switched to AT mode and initializes. **MapLoaderMAP** – it cares about reading and parsing the map. The output is a list (vector) of AP descriptors. **GaussianLocationEngine** - The actual positioning engine. After the engine is called, Gaussian filter is started, and then calculation of locating with multilateration.

**5 Testing of Developed Solution**

Test of Gaussian filter influence is based on data from measurements with HP iPAQ
hx4700. AP was used as the ZyXEL P660HW-T3 device. The [Fig. 2] shows the
unfiltered samples and filtered samples with Gaussian filter with different sizes and
sigma parameter of kernel.
<figure><img src="image_3.png" /><figcaption>Fig. 2. Application of Gaussian filter to the measured data.</figcaption></figure>

Simulations showed the assumption that with increasing size and scattering kernel it is a greater suppression of fast losses, but with the growing size of the kernel the system response is worse. The kernel size of 20 is seen that the suppression of leakage is not fast enough, while at 200 the other hand, system response is too slow. As a pretty good compromise it seems to be size of kernel as one hundredth. With this size and zero variance a time delay decrease to half of the size, i.e. 50 samples. This finding implies the need to lay claim to the fastest possible scanning the surroundings and thus the sampling RSSI [10].

## 5.1 Localization accuracy

To verify the accuracy, the scheme has been formulated with 4 transmitter (AP). Each transmitter remote from each other about 50 m. The transmitters emit a signal, the attenuation of the load of 10% error with normal distribution on the side of distance. Despite these transmitters were planned route, which passed by a localized point and it did with 10,000 scans. Gaussian filter kernel size is 100 and dispersion 50. The situation demonstrates [Fig. 3]. The black dashed line is the actual trajectory. The blue trajectory is localized and gray points indicate the location, which represent locations without filter.

## 6 Conclusions

In this paper a development of localization module has been described. This module solves the problem with absolute localization inside buildings. It is a compact and scalable solution with a median accuracy of 3 meters in tested environment. As a source for location data of surrounding APs an extended vector of mobile device map
were used. WiFi module which was connected by serial port allows scanning the
surrounding visible WiFi AP. The result is the location information including
estimated errors. Further direction of this project can be seen in implementation of
Monte Carlo localization method, otherwise known as particle filter. This method
should itself allow more accurate positioning of WiFi, but also to introduce other
information from the sensors to form a single, redundant, robust and above all precise
positioning mechanism [10], [11].

**Acknowledgement** This work was supported by „SMEW – Smart Environments at Workplaces“, Grant Agency of the Czech Republic, GACR P403/10/1310. We also acknowledge support from student Ales Kurecka in development of testing module and in several technical problems they grown during the development phase.

References

1. Brida P., Machaj J., Duha J., A Novel Optimizing Algorithm for DV based Positioning Methods in ad hoc Networks, ELEKTRONIKA IR ELEKTROTECHNIKA, No. 1(97), pp. 33–38. ISSN 1392-1215. (2010)

2. Brida, P., Machaj, J., Benikovsky J., Duha, J., An Experimental Evaluation of AGA Algorithm for RSS Positioning in GSM Networks, ELEKTRONIKA IR ELEKTROTECHNIKA, No. 8(104), pp. 113-118, ISSN 1392-1215. (2010)

3. Chilamkurti, N., Zeadally, S., Jamalipour, S. and Das, S.K., “Enabling Wireless Technologies for Green Pervasive Computing,” In EURASIP Journal on Wireless Communications and Networking, vol. 2009, Article ID 230912, 2 pages. (2009)

4. Chilamkurti, N., Zeadally, S. and Mentiplay, F., "Green Networking for Major Components of Information Communication Technology Systems," In EURASIP Journal on Wireless Communications and Networking, vol. 2009, Article ID 656785, 7 pages. (2009)

5. Kotzian, J., Konecny, J., Krejcar, O., User Perspective Adaptation Enhancement Using Autonomous Mobile Devices. In 3rd Asian Conference on Intelligent Information and Database Systems, ACIIDS 2011, April 20-22, 2011 Daegu, Korea. LNCS Vol. 6592. pp. 462-471. Springer-Verlag, Berlin, Heidelberg. DOI 10.1007/978-3-642-20042-7_47. (2011)

6. Krejcar, O. Problem Solving of Low Data Throughput on Mobile Devices by Artefacts Prebuffering, in EURASIP Journal on Wireless Communications and Networking. – Hindawi, Vol. 2009, Article ID 802523 - 8 pages. DOI 10.1155/2009/802523. (2009)

7. Liou, CY., Cheng, WC., “Manifold construction by local neighborhood preservation”, In Springer LNCS, Volume 4985, 14th International Conference on Neural Information Processing (ICONIP 2007) Kitakyushu, Japan, Non 13-16, 2007, pp. 683-692. (2007)

8. Juszczyszyn, K., Nguyen, NT., Kolaczek, G., Grzech, A., Pieczynska, A., Katarzyniak, R., “Agent-based approach for distributed intrusion detection system design”, LECTURE NOTES IN COMPUTER SCIENCE, Vol. 3993, pp. 224-231. (2006)

9. Mikulecky P., Remarks on Ubiquitous Intelligent Supportive Spaces, 15th American Conference on Applied Mathematics/International Conference on Computational and Information Science, Univ Houston, Houston, TX, pp. 523-528, (2009)

10. Brida, P., Duha, J., Krasnovsky, M., “On the accuracy of weighted proximity based localization in wireless sensor networks”, In IFIP, Volume 245, Personal Wireless Communications, pp. 423-432. (2007)

11. Vybiral, D., Augustynek, M., Penhaker, M., “Devices for Position Detection”, In Journal of Vibroengineering, vol. 13, Issue 3. pp. 531–535, (2011)