Keywords

1 Introduction

Many technologies (viz. Wi-Fi, Bluetooth, RFID, Zigbee, and GPS) have been in use to estimate the position of indoor environment. Each technology has its own advantages and disadvantages. In recent years, visible light communication has been gaining attention for indoor localization [1, 2].

VLC-based indoor localization involves two modules—a transmitter and a receiver. Generally, LED is used as a transmitter unit because of its high bandwidth and fast switching capability [3]. Photodiode (PD) is used as a receiver unit due to its high reception bandwidth.

Transmitter module requires multiple LEDs which can be modulated by different techniques. On/Off keying is a simple technique in which LED is modulated by turning LED on and off in order to transmit the bit 1 and 0. In Ref. [4], author used the NRZ-OOK modulation technique and achieved a speed of 550 Mbit/s in real time. A pulse position modulation (PPM) uses a position of pulse and identifies the transmitter symbol [4], time-division multiplexing (TDM) [5], and frequency-division multiplexing (FDM) [6]. A code-division multiplexing (CDMA) is a multiple access technology, wherein each LED is assigned its unique code and the receiver can decrypt the data.

Receiver module consists of photodiode that receives the LED signals. After extracting the signal, position techniques are used to locate the target device. Different position techniques have been studied to estimate the location. (i) Time of arrival (TOA)—in Ref. [7] author used white LED as transmitter and assumed that the transmitter and receiver are perfectly synchronized. (ii) Time difference of arrival (TDOA)—the positional accuracy of 3.2 cm has been proposed in Ref. [8]. However, the author used simulation for the experiment. In the practical environment, this accuracy could not be obtained. (iii) Angle of arrival (AOA) measures angle between transmitters and receivers, and using geometric property, it estimates the distance. (iv) Received signal strength (RSS) is an asynchronous technique; using the attenuation property of the transmitter signal, the distance can be obtained [6].

In general, it is noticed that the TOA is a simple method but it requires synchronization between transmitter and receiver unit. It is tedious to obtain in practice and, hence, is error-prone. In TDOA, synchronization is required between transmitters. This is less difficult than TOA but clock resolution and PD response can cause errors here. RSS has the advantage of asynchronous operation but is subject to path loss, especially, when receivers are not in the line of sight to the transmitter. However, RSS is easy to use as compared to TOA and TDOA [7,8,9,10].

Triangulation is a common positioning algorithm that requires angle or distance between transmitters and receivers. Two derivations are there—lateration and angulation. Lateration involves TOA, TDOA, and RSS for position estimation, and angulation uses AOA to estimate the target device’s position.

2 Proposed Methodology

2.1 RSS

RSS received method is used to calculate the transmitter to receiver distance. When receiver (PD) is in the line of sight, then using Lambertian characteristics, the relation between transmitted and received power is given as:

$$P_{\text{r}} = \left\{ {\begin{array}{*{20}c} {P_{\text{t}} \frac{(m + 1)A}{{2\pi d^{2} }}\cos^{m} (\emptyset )T_{\text{s}} (\psi )g(\psi )\cos (\psi )} \\ {0 \le \psi \le\varvec{\psi}_{c} } \\ {0,\quad \psi \le\varvec{\psi}_{c} } \\ \end{array} } \right.$$
(1)

where Pt is the transmitted power, A is the physical area of the detector in the photodiode (PD), m is the order of Lambertian emission, \(\upvarphi\) is the irradiance angle, ψ is the incidence angle, Ts(ψ) is the gain of the optical filter, g(ψ) is the gain of the optical concentrator, Ψc is the field of view at the PD, and d is the transmitter to receiver distance.

In our experiments, FOV is taken 60°, so m can be calculated as (Fig. 1):

Fig. 1
figure 1

Transmitter and receiver model with four LEDs and a photodiode (PD)

$$m = \frac{ - \log 2}{{\log (\cos (\Phi _{0.5} ))}} = \frac{ - \log 2}{{\log (\cos (60^{ \circ } ))}} = 1$$
(2)

We assume no optical filter and concentrator is used, by substituting the value of m and \((T_{\text{s}} (\psi ) = g(\psi ) = 1)\) in Eq. (1), we can obtain equation as

$$P_{\text{r}} = P_{\text{t}} \frac{A}{{\pi d^{2} }}\cos (\varPhi )\cos (\varPsi )$$
(3)

Using Eq. (3), the linear distance from transmitter to receiver is calculated as follows:

$$R_{n} = \sqrt {d_{n}^{2} - H^{2} }$$
(4)

In order to calculate the physical distance between the transmitter and the receiver, the signal strength at the receiver must be known. Equation (2) is used to find the signal strength. Rearranging Eq. (3) gives an equation in terms of diagonal distance d between the LED and the photodiode.

$$d = \sqrt[2]{{\frac{{AH^{2} P_{\text{t}} }}{{\pi P_{\text{r}} }}}}$$
(5)

2.2 Trilateration

In our work, circular trilateration is utilized to estimate the location of the receiver. Transmitter locations are known and the distance from each transmitter to the receivers is obtained using RSS technique.

As shown in Fig. 2, distance between the ith transmitter and the receiver is given as Ri. Each circle as shown in Fig. 2 is a set of the receiver’s possible locations from a single range measurement, which can be expressed by following equation [11]:

Fig. 2
figure 2

Trilateration model

$$(X_{i} - x)^{2} + (Y_{i} - y)^{2} = R_{i}^{2}$$

where i = 1, 2, …, n and n is the number of transmitter points.

$$\begin{aligned} R_{i}^{2} - R_{1}^{2} & = (x - X_{i} )^{2} + (y - Y_{i} )^{2} - (x - X_{1} )^{2} + (y - Y_{1} )^{2} \\ & = X_{i}^{2} + Y_{i}^{2} - X_{1}^{2} - Y_{1}^{2} - 2x(X_{i} - X_{1} ) - 2y(Y_{i} - Y_{1} ) \\ \end{aligned}$$

Then, the equations can be described into matrix form as:

$${\mathbf{A}}{\text{X}} = {\mathbf{B}}$$

where \(X = \left[ {\begin{array}{*{20}c} x & y \\ \end{array} } \right]^{\text{T}}\)

$${\mathbf{A}} = \left[ {\begin{array}{*{20}c} {X_{2} - X_{1} } & {Y_{2} - Y_{1} } \\ \vdots & \vdots \\ {X_{n} - X_{1} } & {Y_{n} - Y_{1} } \\ \end{array} } \right]$$

and

$${\mathbf{B}} = \frac{1}{2}\left[ {\begin{array}{*{20}c} {\left( {R_{1}^{2} - R_{2}^{2} } \right) + \left( {X_{2}^{2} + Y_{2}^{2} } \right) - \left( {X_{1}^{2} - Y_{1}^{2} } \right)} \\ \vdots \\ {\left( {R_{1}^{2} - R_{n}^{2} } \right) + \left( {X_{n}^{2} + Y_{n}^{2} } \right) - \left( {X_{1}^{2} - Y_{1}^{2} } \right)} \\ \end{array} } \right]$$

The least squares solution of the system is then given by:

$$X = (A^{T} A)^{ - 1} A^{T} B$$
(6)

The flow diagram has two sections shown in Fig. 3: first section is the hardware section which consists of LEDs, PD, ADC converter, and controller. The second is the computation section which performs the calculation in order to estimate PD location.

Fig. 3
figure 3

Flow diagram of proposed approach for indoor localization

3 System Description

This section describes the components used to perform the experiments. Majorly, there are four units, viz. transmitter, receiver, A/D converter, and controller. Each is discussed below:

Transmitter: In our work, LEDs are used as transmitter unit which are modulated by a controller. Frequency-division multiplexing generates a unique frequency by each LED. The LED has 20 mw maximum power and can operate up to 5 V.

Receiver: Photodiode (PD) OPT101 from Texas Instrument is used a receiver unit. It has a responsivity of 0.45 V/W at visible light of 650 nm. It generates an output voltage.

A/D converter: The photodiode output is analog voltage. Before processing the data in Raspberry Pi, it needs to be converted to digital form. Texas Instrument ADC (ADS1115) is used as the A/D converter. It has 16 bits resolution output and programmable data rate of 8 SPS to 860 SPS. Data is sent via I2C—compatible serial interface.

Controller: Raspberry Pi 3 model is used as a controller to process the digital data. RPi CPU has 1.2 GHz 64/32-bit quad-core ARM Cortex-A53 processor and 1 GB RAM. It has capability to compute FFT and to do other computations on a single processor.

4 Experiments and Results

Initially, these experiments were performed inside the closed box to avoid the external light effect. Dimensions of closed box are 0.16 m × 0.16 m × 0.20 m with area of 0.0256 m2. LEDs are used as transmitter units and have been adjusted over different frequencies. Four LEDs have been used and positioned at four corners to perform the experiment. Table 1 represents the position and frequency of different LEDs. During the experiments, photodiode is placed at the center of the area. Samples were taken in real time during with time gap of 1 s. FFT is performed over the collected sample and different frequency components were extracted. Figure 4 shows the collected input samples, and Fig. 5 shows the extracted frequency components.

Table 1 LED position and frequency
Fig. 4
figure 4

Histogram of input data

Fig. 5
figure 5

Frequency plot output of FFT

After frequency extraction, RSS method calculates the distance of receiver from each transmitter. Subsequently, trilateration method estimates the location in 2D space.

The proposed approach works in real time and the location is updated after every 4 s. The distance root mean square error (DRMS) is measured to define the two-dimensional accuracy. The horizontal position error () can be computed from the direction of the coordinate axis’s known position. The DRMS measurement shows that the probability of being within the circle is 63–68% [12].

$${\text{DRMS}} = \sqrt {\sigma_{x}^{2} + \sigma_{y}^{2} }$$
(7)

To calculate the 95% confidence region for an object to be located in space, we can modify Eq. (7) as follows:

$$2{\text{DRMS}} = 2\sqrt {\sigma_{x}^{2} + \sigma_{y}^{2} }$$
(8)

The distance root mean square error distribution is shown in Fig. 6, and the DRMS distribution in the different location is shown by boxplot in Fig. 7. Figure 8 shows the estimated location of the object in the space where the large blue circle represents the position accuracy computed from DRMS.

Fig. 6
figure 6

Distance mean square distribution of location at x = 16 and y = 8

Fig. 7
figure 7

Boxplot represents mean square distribution of different locations

Fig. 8
figure 8

Position accuracy based on DRMS

5 Conclusion

The proposed approach is tested on a small scale and it works well in real time. The obtained results successfully show that our approach can locate the object within confidence region. Obtained distance root mean square error is 0.04 m in the experiments. To extend it, one may perform this experiment over large scale to check the versatility and robustness. Furthermore, other algorithms may be tested to increase the accuracy.