1 Introduction

Ambient Assisted Living (AAL) is typically classified according to the targeted functional domain, and might include safety systems, medical devices, telemedicine platforms, assistive robots and many others [9]. Regardless of the assistive functionality or service provided, AAL technologies typically require the user position and/or identity to be known. While indoor localization (and mapping) of artificial systems (e.g. robots) is an already mature research field [4, 11, 13, 16], indoor user localization has started to attract a lot of interest in the AAL research community only in the last years, and it is still one of the open challenges to solve [29]. In 2011, the Evaluating AAL Systems through Competitive Benchmarking (EvAAL) was established, which aims at establishing benchmarks and evaluation metrics for comparing Ambient Assisted Living solutions [7]. Since then several localization solutions for AAL have been proposed, such as the RESIMA architecture for assisting people with sensory disability in indoor environments [2], and CARDEAGate for providing an inexpensive and scarcely intrusive way for user localization and identification [14].

Most of the times, however, localization systems for AAL applications are based on custom solutions, and thus are difficult to integrate with other systems and require an extensive calibration during the deployment phase [10]. In this work we focus our attention on indoor human localization based on the Internet of Things (IoT) paradigm, seen as the interconnection of devices within the existing internet infrastructure to offer advanced connectivity of devices, systems, and services. The proposed localization is thus performed without the use of ad hoc sensors, i.e., using wireless networks already installed at home, like those required by smart objects to operate. Among the available localization methods, those based on Received Signal Strength Indicator (RSSI) are probably the most suitable for localizing a person indoor, since they are low-cost, present low-complexity and exploit already existing networks without the use of further hardware. RSSI is an indicator which can be used in many applications, such as the implementation of message routing or self-healing strategies for sensor networks, the detection of obstacles crossing the radio-links and especially the localization of nodes. RSSI-based localization techniques rely on two different types of nodes: an Unknown Node (UN), which acts as a receiver and whose position has to be estimated, and Beacon Nodes (BNs), which act as transmitters and whose positions are known. Two types of localization schemes are mainly documented in the literature for RSSI-based localization [30]: fingerprinting [21, 32] and path loss model [1, 5, 6, 34]. The RSSI-fingerprinting algorithm consists in the calibration and online tracking processes. One of the main drawbacks of the RSSI based locating methodologies is the extensive calibration phase for building a fingerprint database. As an alternative, path loss models can effectively predict the signal strength [12, 17]. Existing prediction models may fall into two categories: the deterministic and empirical models [33]. The deterministic model is accurate and site-specific, but demands a heavy computational load, while the empirical approach can be easily computed but is less accurate. Once the distance of the UN from the nearest BNs has been calculated, then it is possible to estimate the UN position by using different estimation algorithms, such as Min-Max, Multilateration and Maximum Likelihood [22, 24]. RSSI, however, is susceptible to several disturbances, such as noise, interference, multi-path fading, dilution of precision, which greatly affect the signal received power [23]. A poor ranging usually determines poor position estimates and, hence, unsatisfactory localization performances: this limit depends on the ranging errors and cannot be overcome by the use of more sophisticated estimation algorithms. The recent RSSI literature is mainly focused in finding solutions to improve the localization accuracy [18, 33], to deal with dynamic environments [27] and to minimize the power consumption of the localization system [31]. These solutions, however, are oriented towards the world of wireless sensor networks, where accuracy, robustness and optimized results are obtained at the cost of high complexity algorithms and time consuming setup phases, and are often limited to heavily structured environments. On the other hand, commercial solutions typically require the use of ad hoc devices and do not exploit the already existing wi-fi network (such as the iBeacon from Apple [15]).

In the proposed work, instead, we focus our attention on the world of IoT and smart homes for AAL, and want to investigate how RSSI localization can be performed in an easy way by exploiting common IoT communication networks. We thus propose a plug and play solution where the BNs are represented by smart objects located in the house, while the UN can be any smart object held by the user. By using real data from different environments (i.e., with different disturbances), it is then possible to provide an empirical model, based on the one-slope model introduced by Panjwani and Abbott [25] and recently used in [21], which provides an acceptable localization accuracy for many services in smart homes, but retaining at the same time the simplicity of a real plug and play solution. At the same time, we compare this approach with the classical one: a path loss model trained and validated on the same testbed. Three different and well-known localization algorithms are tested and their results are presented. The work is organized as follows. Section 2 provides the description of the used hardware and software platforms. Section 3 contains a brief presentation of the experimental test environments, together with the considered test protocol. In Sect. 4 we describe the model and its training in two different scenarios as well as an introduction of the considered localization algorithms. Section 5 deals with the presentation of the experimental results obtained in the two scenarios. Conclusions and future works end the work.

2 Experimental Setup

The whole system is composed by different real-world smart objects, each one equipped with an Apio General [3] (in detail two lamps, an ambient monitoring device and a loudspeaker). The Apio General is actually a USB stick that integrates an Atmel microcontroller with a Lightweight Mesh communication module able to create a mesh network among these objects. The gateway node is the ambient monitoring device (namely ComfortBox) and is composed by a Raspberry PI, an Apio Dongle and different sensors (temperature, humidity, indoor air quality, noise and brightness). The Apio Dongle has the same hardware specs of the Apio General but a different firmware and acts as a concentrator node. The gateway node has the task to elaborate, store and synchronize the data with the cloud (see Fig. 1).

Fig. 1
figure 1

The system architecture

In the presented setup, the Apio General devices which transmit data from the smart objects are the BNs (see Fig. 2), while the UN is a temperature sensor (see Fig. 3) held by the user and equipped with an Apio General. The software platform is built using Node.js for what regards the server side and cloud synchronization. The client side is based on Angular.js and the non-relational database is built using MongoDB. Thanks to the communication module, objects create a mesh network and each one can receive the RSSI value of each other. The source code of the whole OS, USB sticks firmware, server and client modules as well as web applications are available for free on GitHub [26].

Fig. 2
figure 2

Experimental setup and beacons positioning

Fig. 3
figure 3

Unknown Node to localize

3 Experimental Tests

Experiments were performed by considering an area of 36 m2 out of the total surface of five different test environments: a college lab and an office within the campus of the Polytechnic University of Marche (Ancona, Italy), a garage, a dwelling’s living room and a gym in the city of Senigallia (in the province of Ancona). Each test environment is composed by 16 squares with a 1.5 m side (see Fig. 2), 4 BNs (blue dots) in 4 different configurations and 1 UN (red dot). Sixteen sampled locations were identified within each environment, and their position marked on the floor. The average beacon density was 0.11 beacon nodes per square meter.

RSSI values from beacons, placed at 0.75 m from the floor, were gathered at each sampled location while the receiver was in the pocket of the user approximately at the same height of the beacons. Sixteen different tests have been performed in each test environment (four for each beacon configuration). For each test we collected over 200 readings at each sampled location with a sampling frequency of 10 Hz. Over 250,000 readings were collected from the physical test beds.

4 Indoor Localization Algorithms

We first considered a one-slope model [25] and then used it to test three different localization algorithms, namely Min-Max, Trilateration and Maximum Likelihood. The one-slope model considers a parametric equation of the RSSI-distance (x) function as reported in Eq. (1):

$${\text{RSSI}} = A\log \left( x \right) + B$$
(1)

where RSSI is measured in power ratio dBm and x, the distance between the beacon node and the receiver node, is expressed in meters. To find the values of A and B parameters, the least squares method has been considered (see Table 1). In particular, two different testing scenarios have been used to validate the data.

Table 1 One-slope model parameters computed in two different scenarios [see Eq. (1)]
  • Scenario I We performed the training of the model by considering eight tests recorded for only one environment (namely the college laboratory) and the localization performances have been evaluated on the remaining eight tests.

  • Scenario II We trained the model with the readings collected in eight tests for all the five test environment, while the performances of the localization have been evaluated on the remaining tests.

4.1 Min-Max

Min-Max is the most used localization algorithm, whose success is mainly due to its extreme implementation simplicity [33]. Inverting the nominal distance-power loss law [see Eq. (1)], the unknown nodes estimate their distance from each beacon. Then, each unknown node draws a pair of longitudinal lines and a pair of lateral lines around each beacon to create a bounding box given by [(x i  − r i ), (y i  − r i )] × [(x i  + r i ), (y i  + r i )]. (x i  − y i ) is the center of the beacon node while ri is the distance computed by the model. The location of the unknown node is then approximated by the centre of the intersection box computed by the following equation:

$$\left[ {\mathop {\hbox{max} }\limits_{i \le 1 \le N} \left( {x_{i} - r_{i} } \right),\mathop {\hbox{max} }\limits_{i \le 1 \le N} \left( {y_{i} - r_{i} } \right)} \right] \times \left[ {\mathop {\hbox{min} }\limits_{i \le 1 \le N} \left( {x_{i} + r_{i} } \right),\mathop {\hbox{min} }\limits_{i \le 1 \le N} \left( {y_{i} + r_{i} } \right)} \right]$$
(2)

where N is the total number of beacons (4 in our algorithm). Intuitively, the smaller the intersection area the better the localization.

4.2 Trilateration

Trilateration is a decentralized localization algorithm based on geometry principles. As usual, the unknown node collects the beacon messages and estimate their distance to each beacon through the model. Then, any strayed node computes its own position by intersecting the circles centered on the positions occupied by three beacons and having radius equal to the estimated distance between the beacons and the node itself. The intersection should be ideally a single point on a surface. Due to several reasons this intersection is an area where the node is likely to be found. Since we have four beacon nodes, Trilateration is performed each time among three beacon nodes, thus obtaining four potential areas. The node is then positioned in the center of the intersection between these areas. Trilateration is more complex than Min-Max but, at least in principle, it provides better performance, implementing a more sophisticated localization technique.

4.3 Maximum Likelihood

The Maximum Likelihood (ML) localization technique is based on classical statistical inference theory. Given the vector of RSSI values \(\varvec{r} = \left[{\varvec{r}_{1} \; \varvec{r}_{2} \;\ldots \; \varvec{r}_{\user2 n} } \right]^{\user2 T}\) obtained from n beacons with coordinates \(\left[{\varvec{x}_{{\varvec{B}1}} ,\varvec{x}_{{\varvec{B}2}} , \ldots ,\varvec{x}_{{\varvec{Bn}}} } \right]\) and \(\left[{\varvec{y}_{{\varvec{B}1}},\varvec{y}_{{\varvec{B}2}},\ldots,\varvec{y}_{{\varvec{Bn}}}} \right],\) the algorithm computes the a priori probability of receiving r for each potential position \([\varvec{x},\varvec{y}]\) of the unknown node. The position that maximizes the probability is then selected as the estimated node position. The Maximum Likelihood method is more complex than the others, but it tries to minimize the variance of the estimation error as the number of observations, i.e., of beacon nodes, grows to infinity. In most of the test scenarios the number of beacons is limited, so that the ML performance can be rather unsatisfactory.

5 Experimental Results

According to past researches [20], we use the Cumulative Distribution Function (CDF) of localization error as well as basic statistical metrics (mean value, average value and standard deviation) of localization error to measure the localization performance. The CDF F(e) of localization error e is defined in term of a probability density function f (e) as follows:

$$F\left( e \right) = \int\limits_{0}^{e} {f\left( x \right)dx} \quad (x > 0)$$
(3)

From the CDF of localization error, it is possible to establish the localization error at a given confidence level (e.g., 50, 90%). Figures 4 and 5 show the cumulative probability function of the error computed for both considered scenarios.

Fig. 4
figure 4

Cumulative probability computed on the validation set in Scenario I

Fig. 5
figure 5

Cumulative probability computed on the validation set in Scenario II

Table 2 summarize the mean value, standard deviation and median value of the error for the three algorithms considered. Results obtained are coherent with the previous literature works, as in [8, 19, 20, 28]. The research results indicate that the MinMax algorithm has the best accuracy among the three localization algorithms tested in both scenarios. Furthermore, the MinMax algorithm has other advantages over the other algorithms: it is easier to implement, the running time and data storage is linear with the number of beacons. These features bring more convenience to deploy the MinMax algorithm on resource constrained smart objects and mobile networks. The second important result of this research is that the modeling of five different real environments (Scenario II) does not strongly affect the localization results. Indeed, as it is possible to notice in Table 2, the average performances of MinMax in Scenario II are only 0.18 m worse than those of Scenario I, when a single environment is used to train and validate the RSSI one-slope model.

Table 2 Accuracy performance comparison of the localization algorithms in the two different modeling scenarios (errors in meters)

6 Conclusions

In this work we present an RSSI based approach for human indoor localization in AAL applications. Localization is performed without the use of ad hoc sensors, but exploits the wireless networks already installed at home, like those required by smart objects to operate. Three algorithms were evaluated: MinMax, ML, and Trilateration. To evaluate the algorithms, over 250,000 readings were collected from five physical test beds. A one-slope model has been created in two different scenarios: by considering a single test bed both for training and validation (Scenario I) and by considering all the test beds (Scenario II). Results are coherent with the literature for what concern Scenario I and seems to be promising for Scenario II. When training a model for five scenarios the performances obtained are only 11.8% worse than those obtained in Scenario I. In particular, the MinMax algorithm shows the best performances and can have the potential for a future adoption in AAL applications. The results presented in the work are still preliminary, and the authors are currently testing different RSS models and custom algorithms for localization, together with different hardware solutions.