<<

sensors

Letter A Low-Cost Visible Light Positioning System for Indoor Positioning

Juan Carlos Torres 1,*, Aitor Montes 1, Sandra L. Mendoza 1, Pedro R. Fernández 1 , Juan S. Betancourt 1 , Lorena Escandell 1 , Carlos I. del Valle 2 and José Manuel Sánchez-Pena 1

1 Display and Photonic Applications Group, Electronic Technology Department, Carlos III University, Butarque 15, 28911 Leganés, Spain; [email protected] (A.M.); [email protected] (S.L.M.); [email protected] (P.R.F.); [email protected] (J.S.B.); [email protected] (L.E.); [email protected] (J.M.S.-P.) 2 Optiva Media, Edif. Europa II, Calle Musgo 2, 28023 Madrid, Spain; [email protected] * Correspondence: [email protected]

 Received: 5 August 2020; Accepted: 4 September 2020; Published: 9 September 2020 

Abstract: Currently, a high percentage of the world’s population lives in urban areas, and this proportion will increase in the coming decades. In this context, indoor positioning systems (IPSs) have been a topic of great interest for researchers. On the other hand, Visible Light Communication (VLC) systems have advantages over RF technologies; for instance, they do not need satellite signals or the absence of electromagnetic interference to achieve positioning. Nowadays, in the context of Indoor Positioning (IPS), Visible Light Positioning (VLP) systems have become a strong alternative to RF-based systems, allowing the reduction in costs and time to market. This paper shows a low cost VLP solution for indoor systems. This includes multiple programmable beacons and a receiver which can be plugged to a running a specific app. The position will be quickly and securely available through the interchange between the receiver and any configurable LED-beacon which is strategically disposed in an area. The implementation is simple, inexpensive, and no direct communication with any data server is required.

Keywords: indoor positioning system (IPS); LED beacon; smart systems; visible light communication; visible light positioning (VLP); VLC beacons

1. Introduction Currently, the technological evolution is carrying new concepts, such as the of Things (IoT), where, positioning in indoor environments is essential for “real-time” tracking of people, devices, and tools [1]. Since the implementation of satellite navigation, GPS or Galileo on most mobile devices, outdoor positioning has become a must-have service in modern society. However, even with the wide range of satellite signals, they are not always strong enough to be used in indoor environments. Thus, the further development of a varied range of new technologies to meet the demand of indoor positioning systems is needed, including WLAN, BLE, ultra-wide band (UWB), ultrasonic wave, and Visible Light Positioning (VLP). Most of these solutions use technology; however, these solutions require a specific, complex, and expensive deployment [2,3]. Besides, radio technology can be compromised in specific deployment environments, including tunnel construction, mining, petrochemical plants and hospitals, among others. However, the restrictions of radio-based solutions can be overcome with other types of systems, such as VLC systems, which can be deployed using the installed illumination infrastructure with small modifications. All these features generally provide the system a high density of light sources, that can be also easily limited by walls or other physical elements. In this way, the accuracy of a VLP

Sensors 2020, 20, 5145; doi:10.3390/s20185145 www.mdpi.com/journal/sensors Sensors 2020, 20, 5145 2 of 14 system could be increased and would be less sensitive to the multipath effect. On the other hand, VLC systems are not affected by electromagnetic fields and do not create interference with other communication devices. However, VLP needs a direct Line of Sight (LOS) and the lights must stay on, even during daytime. A VLP setup is basically composed of a and a receiver. The main components on the transmitter is a commercial off-the-shelf LED (or a LED array), which is controlled by a programmable driver. The transmitter can be named as “Beacon” because it has a fixed position and generally continuously sends the same pattern. The receiver incorporates a light detector or an image sensor to receive and decode the information received from the beacons. In the VLP receiver, the position can be decoded using at least three different strategies: range-based methods, range-free methods and fingerprinting [3]. The most straightforward localization algorithm, but least accurate, is the range-free approach (also known as proximity or coverage approach) [4], where the location is determined with an identification code (ID) sent through the beacon and is associated to a known area. In this approach, a mobile target is located and positioned inside the area illuminated by the strongest beacon footprint. The received ID is used to search the transmitter device record in an LUT or database and retrieve the location information of the transmitting device, which is then reported as the location of the mobile device [5–7]. The system precision can be improved using the received signal strength indicator (RSSI) algorithm [8–10], because the distance between the transmitter and receiver increases as the strength of the received signal decreases. Therefore, the receiver position can be estimated using the strengths of the received signals. The effects of the optic power transmitted are unpredictable. When the signal decreases due to the distance between the transmitter and the receiver, the interference effect of obstacles or reflected waves are larger, limiting the precision of the localization method. Another frequent source of interference is ambient light because it changes the strength of the received signal and, in outdoor or windowed environments, can produce unpredictable changes that effect positioning. Either way, the proximity algorithm has low precision since, in indoor positioning, a couple of meters can be the difference between being in one room or another. Other techniques, such as trilateration based on RSSI [3,10–12] or fingerprinting [3,13–17], have been studied to improve system precision. However, these techniques have been discarded in this work. The literature presents other algorithms that use other light characteristics, such as the angle of arrival (AOA), the time of arrival (TOA) and the difference in time of arrival (TDOA). However, all these algorithms have drawbacks, including the complexity of the receiver circuit, the weight and volume of the deployed hardware, consumption, and the processing time of the implemented algorithm, making them not viable solutions to the indoor positioning problem. In this paper, we propose a solution that works with the proximity algorithm, seeking to improve implementation problems in indoor positioning systems. Hardware and software can transform any mobile device, such as , tablets, or virtual/augmented reality glasses, into a VLC receiver device. Then, the device can obtain its position transparently, as how it could obtain its position from other geolocation systems. However, this solution is not based on a distributed system where energy consumption could be redistributed between different elements of the system, as proposed in [18,19], especially when multiple receivers are in play. On the other hand, the design and development of a small receiver device that does not need external power and has low consumption are addressed. Furthermore, in this paper, we show the viability of a system using the designed low-cost receiver in combination with an Android or IOS device to localize and follow people or resources in indoor environments. Sensors 2020, 20, 5145 3 of 14

2. Materials and Methods

2.1. System Design and Protocol

Sensors 2020, 20,The x FOR proposed PEER REVIEW system consists of multiple light-emitting diodes (LED) lamps that perform as 3 of 13 beacons, sending a message indicating their position through the illumination beam. This occurs when a user carrying a mobile device (with a low-cost detector connected) is in the range of one of the light the light beams, as shown in Figure 1. Furthermore, each lamp could send additional information beams, as shown in Figure1. Furthermore, each lamp could send additional information about near about nearservices services and promotions,and promotions, among others.among others.

Figure 1. VLC beacon system based on proximity algorithm. Figure 1. VLC beacon system based on proximity algorithm. An important design restriction is not to overlap light cones emitted from adjacent beacons. An importantThe LED beacons design were restriction designed is to not illuminate to overla a narrowp light area cones reducing emitted the possibility from adjacent that multiple beacons. The LED beaconsbeacons were share designed the same area to/channel illuminate (Figure a1 ).narrow area reducing the possibility that multiple In the scope of the application, two users were required: a standard user and admin (Figure1). beacons share the same area/channel (Figure 1). The former can only make use of a navigation app. The administrator uses another independent In theapplication scope of that the has application, advanced functionalities two users were and thatrequired: can modify a standard the status user and and information admin (Figure of 1). The formerthe beacons.can only make use of a navigation app. The administrator uses another independent application thatThe infohas storedadvanced on the functionalities beacons can be modified and that using can an independentmodify the infrared status interface and information controlled of the beacons. by an Admin app. This app runs on a standard mobile device which incorporates an infrared interface, and a VLC receiver module, as with the rest of users. The info stored on the beacons can be modified using an independent infrared interface The firmware running on the MCU is interrupted when a command is received from an IR interface. controlledIn thatby case,an Admin the device app. falls intoThis a programmingapp runs on mode a thatstandard prepares mobile the beacon device to receive which the information incorporates an infrared interface,to broadcast. and This a operationVLC receiver can be executedmodule, from as with a mobile the devicerest of that users. runs a specific administration The applicationfirmware that, running among otheron the functions, MCU controls is interrupted IR module towhen update a the command beacon info. is A received microcontroller from an IR interface.runs In that a firmware case, thatthe followsdevice the falls flowchart into a represented programming on Figure mode2. The that MCU prepares manages boththe thebeacon sending to receive of the VLC and the reception of the IR signal to update the beacon. the information to broadcast. This operation can be executed from a mobile device that runs a specific administration application that, among other functions, controls IR module to update the beacon info. A microcontroller runs a firmware that follows the flowchart represented on Figure 2. The MCU manages both the sending of the VLC frame and the reception of the IR signal to update the beacon.

Sensors 2020, 20, 5145 4 of 14 Sensors 2020, 20, x SensorsFOR PEER 2020, REVIEW20, x FOR PEER REVIEW 4 of4 13 of 13

Reset Rx_IRQ Reset Rx_IRQ

update=1 MCU Setup update=1 MCU Setup update=0 update=0 Return

Return

update==1? NO

update==1? NO

Change Beacon Info Send Beacon Info

Change Beacon Info Send Beacon Info

update=0 Delay 1s

update=0 Delay 1s

Figure 2. Flowchart of the beacon firmware.

Figure 2. Flowchart of the beacon firmware. The transmission protocol and the transmitter and receiver designs are discussed below. Figure 2. Flowchart of the beacon firmware. The transmission protocol and the transmitter and receiver designs are discussed below. 2.1.1. Transmission Protocol The2.1.1. transmission Transmission protocol Protocol and the transmitter and receiver designs are discussed below. The selected to transmit the data is Frequency-Shift Keying (FSK), where each bit is Thecoded selected in modulationfrequency, toassociating transmit the each data logic is Frequency-Shift level to a different Keying (FSK),carrier where frequency. each bit The is resulting 2.1.1. Transmission Protocol coded inmodulated frequency, associatingsignal is: each logic level to a different carrier frequency. The resulting modulated signal is: The selected modulation to transmit the sin data 2 is Frequency-Shift ,Keying → (FSK),0,1 where each bit is(1) SFSK = Asin 2πt( fl + data(fh fl)) , data 0, 1 (1) coded in frequency, associating each logic level to −a different→ carrier{ } frequency. The resulting where A is the amplitude of the signal. The mark frequency (bits “1”) is a signal of fl = 1.2 kHz, and modulatedwhere signal A is theis: amplitude of the signal. The mark frequency (bits “1”) is a signal of fl = 1.2 kHz, and the space frequencythe space (bitsfrequency “0”) is (bits a signal “0”) ofis afh signal= 2.2 of kHz. fh = Each 2.2 kHz. symbol Each has symbol a duration has a ofduration Ts = 8.4 of ms, Ts = 8.4 ms, as shown in Figure 3a. The transmission frequencies limit the maximum bit rate, but the fact that the as shown in Figure3a. The transmission sin 2 frequencies limit the maximum, bit → rate,0,1 but the fact that the (1) user woulduser notwould be in not movement be in movement is enough is to enough receive to all receive the messages. all the messages. where A is the amplitude of the signal. The mark frequency (bits “1”) is a signal of fl = 1.2 kHz, and the space frequency (bits “0”) is a signal of fh = 2.2 kHz. Each symbol has a duration of Ts = 8.4 ms, as shown in Figure (3a.a) The transmission frequencies limit the maximum bit rate, but the fact that the user would not be in movement is enough to receive all the messages.

(a)

(b)

Figure 3. Message codification: (a) FSK modulation, (b) . Figure 3. Message codification: (a) FSK modulation, (b) communication protocol. (b) The first element in the message structure is a six-bit header, and the next three bits identify the lamp. Then, four bits know the package, and the last eight bits are the messages, as shown in Figure 3b. The lamp transmits its geographic coordinates in sexagesimal format (degrees, minutes, and seconds). The information could be, for example: Figure 3. Message codification: (a) FSK modulation, (b) communication protocol.

The first element in the message structure is a six-bit header, and the next three bits identify the lamp. Then, four bits know the package, and the last eight bits are the messages, as shown in Figure 3b. The lamp transmits its geographic coordinates in sexagesimal format (degrees, minutes, and seconds). The information could be, for example:

Sensors 2020, 20, 5145 5 of 14

The first element in the message structure is a six-bit header, and the next three bits identify the lamp. Then, four bits know the package, and the last eight bits are the messages, as shown in Figure3b. The lamp transmits its geographic coordinates in sexagesimal format (degrees, minutes, and seconds). SensorsThe 2020 information, 20, x FOR couldPEER REVIEW be, for example: 5 of 13

Latitude:Latitude: 40 ◦40°18 01800′ 000’N′’ N

Longitude:Longitude: 03 03°◦ 43 430 00′ 000’W′’ W Each character is encoded in eight bits and forms the message body. The lamp must send eight Each character is encoded in eight bits and forms the message body. The lamp must send eight packets of information to receive all the geolocation information. These packets are divided into four packets of information to receive all the geolocation information. These packets are divided into four for longitude and four for latitude. The packets are sent continuously in a cyclic way so that when for longitude and four for latitude. The packets are sent continuously in a cyclic way so that when the the user is under one of the lamps, the packets receive their exact location. user is under one of the lamps, the packets receive their exact location.

2.1.2.2.1.2. LED LED Beacon Beacon TheThe beacon beacon is a is programmable a programmable driver driver that that is is responsible responsible for for sending sending a data frame, continuously.continuously. Additionally,Additionally, the the beacon beacon can can modify modify the the stored stored info whenwhen required.required. Therefore, Therefore, it isit necessaryis necessary to addto add a a microcontrollermicrocontroller to to format format and sendsend thethe information information through through the the LED LED lamps lamps and and an IrDAan IrDA interface interface to to receivereceive the info toto bebe changed.changed. The The internal internal structure structure can can be be shown shown in Figurein Figure4. 4.

Figure 4. The beacon block diagram. Figure 4. The beacon block diagram. The beacon includes three sub-circuits: the IR interface, the Driver and the MCU. The IR Receiver The beacon includes three sub-circuits: the IR interface, the Driver and the MCU. The IR Receiver permits the beacon configuration at 9600 bps and relative short distance using the Admin-App. permitsThe the beacon LED bias configuration current is approximately at 9600 bps and 42 mA,relative generating short distance an illuminance using the of Admin-App. 88 and 24 lux at distancesThe LED of bias 100 andcurrent 200 is cm, approximately respectively. The42 mA, microcontroller generating usedan illuminance for this specific of 88 solution and 24 islux an at distancesSTM32L152 of 100 with and a clock200 cm, frequency respectively. running The at 32 microc MHz,ontroller because of used its flexibility for this inspecific use, small solution size, andis an STM32L152fast software with configuration. a clock frequency A 2N6029 running BJT transistor, at 32 MHz, is used because to drive of theits LED.flexibility To bring in use, power small for thesize, andemitter fast software systems, configuration. an IC LSD05-15B05S A 2N6029 is used. BJT It transistor, is configured is used with ato few drive components the LED. to To stabilize bring power a 5 V for outputthe emitter voltage, systems, generating an IC enough LSD05-15B05S current for theis used. LED andIt is the config microcontroller.ured with a To few generate components the mark to stabilizeand space a 5 signals,V output the voltage, internal oscillatorgenerating of theenough microcontroller current for is usedthe LED as a clock, and the creating microcontroller. a PWM output To generatein the desiredthe mark pin. and The space bit time signals, is controlled the internal with a separatedoscillator timerof the to mi ensurecrocontroller that the time is used maintains as a clock, the creatingsame, a even PWM for output “1” and in “0” the bit desired frequencies. pin. The bit time is controlled with a separated timer to ensure that the time maintains the same, even for “1” and “0” bit frequencies.

2.1.3. Optical Detector and Conditioning Electronics A receiver is coupled to an Android device through the audio jack to capture the VLC signal. The switched light sent by the beacon is captured by this optical receiver, which amplifies and filters the signal to be processed using a user application. The optical detector consists of a photodetector and an amplification circuit. Figure 5 shows the block diagram of the receiver module. Note that energy supply for the amplifier circuit is provided by the Android device through the audio jack plug, avoiding the use of any external power module.

Sensors 2020, 20, 5145 6 of 14

2.1.3. Optical Detector and Conditioning Electronics A receiver is coupled to an Android device through the audio jack to capture the VLC signal. The switched light sent by the beacon is captured by this optical receiver, which amplifies and filters the signal to be processed using a user application. The optical detector consists of a photodetector and an amplification circuit. Figure5 shows the block diagram of the receiver module. Note that energy supply for the amplifier circuit is provided by the Android device through the audio jack plug, Sensors 2020avoiding, 20, xSensors theFOR use PEER 2020 of, any20REVIEW, x externalFOR PEER power REVIEW module. 6 of 13 6 of 13

Photodetector DevicePhotodetector Device Android DeviceAndroid Device

Signal Signal Photodetector PhotodetectorAmplifier Amplifier A/D A/D ProcessingProcessing

Power Power Supply Supply

Figure 5. Block diagram of the receiver module. FigureFigure 5. 5.BlockBlock diagram diagram of thethe receiver receiver module. module. The receiver schematics and views of the implemented module are shown in Figure 6. A The receiver schematics and views of the implemented module are shown in Figure6. A BPW21R The receiverBPW21R schematics photodetector and views(D1), which of the was im especiallyplemented designed module for highare precisionshown in linear Figure applications, 6. A is photodetector (D1), which was especially designed for high precision linear applications, is used. It has a used. It has a spectral range from 420 nm to 675 nm with a maximum sensitivity peak at BPW21Rspectral photodetector bandwidth range (D1), from which 420 nmwas to especially 675 nm with designed a maximum for sensitivity high precision peak at 565 linear nm. The applications, current is 565 nm. The current generated by the photodetector is used to bias a BJT transistor 2n2222 (Q1). A 1 used. Itgenerated has a spectral by the photodetector bandwidth is range used to from bias a420 BJT nm transistor to 675 2n2222 nm with (Q1). a A maximum 1 µF capacitor sensitivity (C1) is used peak at 565 nm.to The eliminate currentµF thecapacitor DC generated component (C1) is by used and the lowto photodetector elimin noises.ate the DC is usedcomponent to bias and a BJT low transistor noises. 2n2222 (Q1). A 1 µF capacitor (C1) is used to eliminate the DC component and low noises. (a)

(a)

(b)

(b) Figure 6. Receiver module (a) schematic and (b) PCB-Mount circuit. Figure 6. Receiver module (a) schematic and (b) PCB-Mount circuit. The circuit small signal behaviour was analysed to obtain the required voltage output. At first, the small signalThe equivalent circuit small circuit signal (Figure behaviour7a) is divided was analysed into the input to obtain and outputthe required nets knowing voltage the output. At first, intrinsicthe transistor smallFigure valuessignal 6. Receiver (equivalentrπ = 2273 moduleΩ circuit, β = (110).a (Figure) schematic Then, 7a) with isand divided values (b) PCB-Mount of intoR1 =the154 input circuit.kΩ, andRload output= 2 kΩ netsthe knowing the 5 resultingintrinsic gain is transistor10 [V/A] values(Figure 7(rb).π = 2273 Ω, β = 110). Then, with values of R 154 kΩ, R 2 kΩ the ∼ The circuitresulting small signalgain is behaviour~10 ⁄ was (Figure analysed 7b). to obtain the required voltage output. At first, the small signal equivalent circuit (Figure 7a) is divided into the input and output nets knowing the intrinsic transistor values (rπ = 2273 Ω, β = 110). Then, with values of R 154 kΩ, R 2 kΩ the resulting gain is ~10 ⁄ (Figure 7b). (a)

(a)

(b)

(b)

Figure 7. Receiver (a) small signal equivalent circuit and (b) simplified equivalent circuit.

Figure 7. Receiver (a) small signal equivalent circuit and (b) simplified equivalent circuit.

Sensors 2020, 20, x FOR PEER REVIEW 6 of 13

Photodetector Device Android Device

Signal Photodetector Amplifier A/D Processing

Power Supply

Figure 5. Block diagram of the receiver module.

The receiver schematics and views of the implemented module are shown in Figure 6. A BPW21R photodetector (D1), which was especially designed for high precision linear applications, is used. It has a spectral bandwidth range from 420 nm to 675 nm with a maximum sensitivity peak at 565 nm. The current generated by the photodetector is used to bias a BJT transistor 2n2222 (Q1). A 1 µF capacitor (C1) is used to eliminate the DC component and low noises.

(a)

(b)

Figure 6. Receiver module (a) schematic and (b) PCB-Mount circuit.

The circuit small signal behaviour was analysed to obtain the required voltage output. At first, the small signal equivalent circuit (Figure 7a) is divided into the input and output nets knowing the

Sensorsintrinsic2020, 20 transistor, 5145 values (rπ = 2273 Ω, β = 110). Then, with values of R 154 kΩ, R 2 kΩ 7the of 14 resulting gain is ~10 ⁄ (Figure 7b).

(a)

(b)

Sensors 2020, 20, x FOR PEER REVIEW 7 of 13

Therefore, theFigure receiver 7. Receiver device (a) small has signal a high equivalent gain circuit, as andwell (b )as simplified input equivalentand output circuit. impedances with intermediate values.Figure These 7. Receiver characteristics (a) small signal make equivalent it ideal circuit forand working(b) simplified in equivalent intermediate circuit. stages. Therefore, the receiver device has a high gain, as well as input and output impedances with intermediate values. These characteristics make it ideal for working in intermediate stages. 2.1.4. Signal Processing 2.1.4. Signal Processing After the signal is collected and amplified by the receiver device, it is sent to the Android device through the Afteraudio the jack signal to is be collected processed. and amplified A custom by the Android receiver device, application it is sent towas the Androiddeveloped device to collect, process, throughand show the audio the information jack to be processed. to the A user custom us Androiding the applicationintegrated was development developed to collect, environment process, (IDE), and show the information to the user using the integrated development environment (IDE), Android AndroidStudio Studio 3.1.1 3.1.1 (JetBrains, (JetBrains, Prague, CzechPrague, Republic; Czech Google, Republic; Menlo Google, Park, CA, USA).Menlo The Park, received CA, signal USA). The receivedpasses signal through passes the through following the multiple following stages: reception,multiple signal stages: reshape reception, and storage, signal signal reshape conditioning, and storage, signal conditioning,, demodulation, and synchronization, and as sy shownnchronization, in Figure8. as shown in Figure 8.

Figure 8. Application block diagram. Figure 8. Application block diagram. The sampling frequency required for the audio AD converter in the receiver is estimated using fh Theas sampling it has a greater frequency number required of cycles (n for) per the symbol. audio To AD obtain converter the bit rate in of the a signal receiver with frequencyis estimatedfh using n fh as it hasin a cycles,greater number of cycles (n) per symbol. To obtain the bit rate of a signal with frequency fs k BW, (2) fh in n cycles, ≥ · bit rate = 1/T = BW/N = f /k N (3) S S · ∙, (2) where k must be at least two.

As the duration of each bit is 8.4 ms, and 1/ the bit rate / is 119 bps, the/ A ∙/D converter sample frequency (3) configured is 32,000 samples per second (sps). where k must be at least two. As the duration of each bit is 8.4 ms, and the bit rate is 119 bps, the A/D converter sample frequency configured is 32,000 samples per second (sps). The necessary samples per bit can be obtained as follows: 32,000 sps 269 samples per bit 119 bps To ensure that all the bits of the package are obtained, the input buffer must have a size of at least 42 bits. Therefore, the buffer size must be at least 11,298 positions (269 sps × 21 bits ×2 = 11,298 samples). The captured signal is stored in the buffer in a pulse code modulation (PCM) format, because, as it is collected through the jack input of the Android device, the signal is treated as an audio signal. The recorded signals oscillate between positive and negative values. The signal amplitude varies depending on the distance between the LED beacon and the receiver. As the modulation works over and not over , the variances in the amplitude and the additive noise do not affect the symbol detection. The signal amplitude varies depending on the distance between the LED beacon and the receiver module. As the scheme works using frequency modulation, any amplitude variation in the received signal does not affect the symbol detection. If the optical receiver module lacks a flat response for all frequencies, the received signal amplitude may vary between the mark and space signals. Additionally, the low-pass filter used in the receiver driver will affect the amplitude. This situation is shown in Figure 9.

Sensors 2020, 20, 5145 8 of 14

The necessary samples per bit can be obtained as follows:

32, 000 sps 269 samples per bit 119 bps ≈

To ensure that all the bits of the package are obtained, the input buffer must have a size of at least 42 bits. Therefore, the buffer size must be at least 11,298 positions (269 sps 21 bits 2 = 11,298 samples). × × The captured signal is stored in the buffer in a pulse code modulation (PCM) format, because, as it is collected through the jack input of the Android device, the signal is treated as an audio signal. The recorded signals oscillate between positive and negative values. The signal amplitude varies depending on the distance between the LED beacon and the receiver. As the modulation works over frequency modulation and not over amplitude modulation, the variances in the amplitude and the additive noise do not affect the symbol detection. The signal amplitude varies depending on the distance between the LED beacon and the receiver module. As the scheme works using frequency modulation, any amplitude variation in the received signal does not affect the symbol detection. If the optical receiver module lacks a flat response for all frequencies, the received signal amplitude may vary between the mark and space signals. Additionally, the low-pass filter used in the receiver driverSensors will 2020, a, 20ffect,, xx FORFOR the PEERPEER amplitude. REVIEWREVIEW This situation is shown in Figure9. 8 of 13

FigureFigure 9.9. SignalSignal recordedrecorded through the audio audio jack. jack.

AfterAfter digitalizing digitalizing the the signal,signal, thethe demodulationdemodulation pr processocess will will be be executed executed in in the the digital digital domain. domain. EvenEven when when an an FSK FSK modulated modulated signal signal can can be demodulatedbe demodulated in di infferent different ways, ways the, one the used one inused this in system this measuressystem measures the signal the period. signal Initially, period. theInitially, stored the signal stored is reshapedsignal is reshaped using a simple using thresholda simple threshold algorithm (Figurealgorithm 10). (Figure 10).

Figure 10. Reshaped signal through simple threshold algorithm. Figure 10. Reshaped signal through simple threshold algorithm.

Then, the detection will be executed using a correlator algorithm, such as that described in [20] (Figure 11). The main idea in [18] is to find the optimal delay (θ), which causes a significant correlation difference between the two possible frequencies of the input signal (fl and fh). The correlator output is determined as follows: Mt cos 2πft cos 2πft ∙ ∙ cos 2πf cos 2πft θ (4) Mt 1/2cos 1/2cos2πfθ cos 2πf2t θ (5) The second term is twice the input frequency and can be easily rejected using a low pass filter. However, the first term tends to be a DC component depending on the delay θ and the current input frequency. This component is just the sent data. Thus, choosing an optimal delay, the original data are recovered. To obtain the optimal delay value θ, that causes the maximum variation, Equation (5) must be maximized.

maxcos2 cos 2 cos 2 (6)

Figure 11. FSK Detector block diagram.

Sensors 2020, 20, x FOR PEER REVIEW 8 of 13

Figure 9. Signal recorded through the audio jack.

After digitalizing the signal, the demodulation process will be executed in the digital domain. Even when an FSK modulated signal can be demodulated in different ways, the one used in this system measures the signal period. Initially, the stored signal is reshaped using a simple threshold algorithm (Figure 10).

Figure 10. Reshaped signal through simple threshold algorithm.

Then,Sensors the2020 detection, 20, 5145 will be executed using a correlator algorithm, such as that described9 of 14 in [20] (Figure 11). The main idea in [18] is to find the optimal delay (θ), which causes a significant correlation differenceThen, the detection between will the be two executed possible using afrequencies correlator algorithm, of the suchinput as signal that described (fl and in fh [20). ] The correlator(Figure 11). The output main ideais determined in [18] is to find as the follows: optimal delay (θ), which causes a significant correlation difference between the two possible frequencies of the input signal (fl and fh). The correlator output is determinedMt cos 2πft as follows: ∙ cos 2πft θ (4) M t M 1/2cos(t) = cos(2πf2πft) θcos(2π cos 2πff(t + θ))2t θ (4) (5) · The second term is twice theM( tinput) = 1 /frequency2[cos( 2πfθ )andcos can(2πf (be2t +easilyθ)) rejected using a low(5) pass filter. However, the first term tends to be a DC component− − depending on the delay θ and the current input The second term is twice the input frequency and can be easily rejected using a low pass filter. frequency.However, This component the first term is tends just to the be a sent DC component data. Thus, depending choosing on the an delay optimalθ and thedelay, current the input original data are recovered.frequency. To obtain This component the optimal is just thedelay sent data.value Thus, θ, that choosing causes an optimal the maximum delay, the original variation, data are Equation (5) must be maximized.recovered. To obtain the optimal delay value θ, that causes the maximum variation, Equation (5) must be maximized. Di f f = maxcosmax(cos(22π fθ) cos cos 2(2π f θ)) (6) (6) l − h

Sensors 2020, 20, x FOR PEER REVIEW 9 of 13 Figure 11. FSK Detector block diagram. The previous analyses canFigure be extrapolated 11. FSK Detector to square block signals. diagram. In our case, we applied a delay of approximatelyThe previous 429 analysesµs (~14 bits can of be delay extrapolated in the bu toffer) square because signals. our mark In our and case, space we appliedsignal frequencies a delay of approximatelyare 1.2 kHz and 429 2.2µ kHz,s (~14 respectively. bits of delay Notice in the bu thatffer) the because computational our mark cost and is space decreased signal with frequencies respect are to 1.2[20] kHz using and the 2.2 kHz,detector respectively. algorithm Notice as well that theas computationalan XOR function cost isinstead decreased of witha multiplier. respect to This [20] usingsimplification the detector is possible algorithm because as well the as signals an XOR involved function insteadin the correlation of a multiplier. operation This simplification are previously is possibleshaped squares. because the signals involved in the correlation operation are previously shaped squares. After applying the XOR function (see(see Figure 1212),), the resulting signal is passed through a digital low-pass filterfilter toto recoverrecover thethe originaloriginal data.data.

Figure 12. Signal obtained at the XOR output. Figure 12. Signal obtained at the XOR output. After filtering, the input signals with a frequency of 1.2 kHz (“1” bits) result in a high output level, After filtering, the input signals with a frequency of 1.2 kHz (“1” bits) result in a high output and the input signals with a frequency of 2.2 kHz (“0” bits) result in a low output level. An example of level, and the input signals with a frequency of 2.2 kHz (“0” bits) result in a low output level. An the filter output is shown in Figure 13. example of the filter output is shown in Figure 13.

Figure 13. Detector output.

The next step is to transform the obtained high values in ones and the low values in zeros. This step transforms the filter output into a square signal containing the message transmitted (Figure 14).

Figure 14. Signal obtained after the processing.

Sensors 2020,, 20,, xx FORFOR PEERPEER REVIEWREVIEW 9 of 13

The previous analyses can be extrapolated to square signals. In our case, we applied a delay of approximately 429 µs (~14 bits of delay in the buffer) because our mark and space signal frequencies are 1.2 kHz and 2.2 kHz, respectively. Notice that the computational cost is decreased with respect to [20] using the detector algorithm as well as an XOR function instead of a multiplier. This simplification is possible because the signals involved in the correlation operation are previously shaped squares. After applying the XOR function (see Figure 12), the resulting signal is passed through a digital low-pass filter to recover the original data.

Figure 12. Signal obtained at the XOR output.

After filtering, the input signals with a frequency of 1.2 kHz (“1” bits) result in a high output level, and the input signals with a frequency of 2.2 kHz (“0” bits) result in a low output level. An Sensorslevel, 2020and, 20the, 5145 input signals with a frequency of 2.2 kHz (“0” bits) result in a low output level.10 ofAn 14 example of the filter output is shown in Figure 13.

Figure 13. Detector output. Figure 13. Detector output. The next step is to transform the obtained high values in ones and the low values in zeros. This step The next step is to transform the obtained high values in ones and the low values in zeros. This transforms the filter output into a square signal containing the message transmitted (Figure 14). step transforms the filter output into a square signal containing the message transmitted (Figure 14).

Sensors 2020, 20, x FOR PEER REVIEWFigure 14. Signal obtained after the processing. 10 of 13 Figure 14. Signal obtained after the processing. Once thethe inputinput signalsignal is is demodulated, demodulated, it it is is necessary necessary to to locate, locate, in thein the bu ffbuffer,er, the synchronismthe synchronism bits indicatingbits indicating the beginningthe beginning of a of frame. a frame. When When the synchronizationthe synchronization trace trace is detected, is detected, the algorithmthe algorithm can recovercan recover the informationthe information from from that that point point (Figure (Figure 15). 15).

Figure 15. Synchronization and message bits after processing. Figure 15. Synchronization and message bits after processing.

The message begins with a header consisting of 6 synchronism bits, 5 high level bits ‘10, and 1 The message begins with a header consisting of 6 synchronism bits, 5 high level bits ‘1′, and 1 low level bit ‘00. In this way, when the receiver detects the header, there must be a specific number low level bit ‘0′. In this way, when the receiver detects the header, there must be a specific number of of bits indicating the lamp identifier, the corresponding number of packets of information, and the bits indicating the lamp identifier, the corresponding number of packets of information, and the location coordinates. location coordinates.

3. Results and Discussion The versatility of this system allows it to be installed on any Android device that has an audio jack port. In the laboratory, some tests were carried out with smart glasses, EPSON BT 200 model H560A (SEIKO EPSON, Suwa, Nagano, Japan), which also use an Android operating system, as shown in Figure 16. This system works perfectly with other types of devices without making any additional modification in both the software and hardware of the smart glasses.

Figure 16. EPSON BT-200 smart glasses, model H560A, with receiver connected to the jack port.

The setup used to test the whole system is shown in Figure 17. Four beacons were used and the Android device with the detector attached was passed through the light beams (beam angle of 11 degrees) to verify the performance of the system and the Android application.

Sensors 2020, 20, x FOR PEER REVIEW 10 of 13

Once the input signal is demodulated, it is necessary to locate, in the buffer, the synchronism bits indicating the beginning of a frame. When the synchronization trace is detected, the algorithm can recover the information from that point (Figure 15).

Figure 15. Synchronization and message bits after processing.

The message begins with a header consisting of 6 synchronism bits, 5 high level bits ‘1′, and 1 low level bit ‘0′. In this way, when the receiver detects the header, there must be a specific number of Sensorsbits 2020indicating, 20, 5145 the lamp identifier, the corresponding number of packets of information, and11 of 14the location coordinates.

3.3. Results Results and and Discussion Discussion TheThe versatility versatility of of this this system system allows allows it to it be to installedbe installed on any on Androidany Android device device that has that an has audio an audio jack port.jackIn port. the laboratory,In the laboratory, some tests some were tests carried were outcarried with out smart with glasses, smart EPSONglasses, BTEPSON 200 model BT 200 H560A model (SEIKOH560A EPSON, (SEIKO Suwa,EPSON, Nagano, Suwa, Japan),Nagano, which Japan), also whic useh an also Android use an operating Android system,operating as shownsystem, in as Figureshown 16 in. This Figure system 16. This works system perfectly works with perfectly other types with ofother devices types without of devices making without any additionalmaking any modificationadditional modification in both the software in both the and software hardware and of thehardware smart glasses.of the smart glasses.

Figure 16. EPSON BT-200 smart glasses, model H560A, with receiver connected to the jack port. Figure 16. EPSON BT-200 smart glasses, model H560A, with receiver connected to the jack port. The setup used to test the whole system is shown in Figure 17. Four beacons were used and the AndroidThe device setup with used the to detector test the attachedwhole system was passed is show throughn in Figure the light 17. beams Four beacons (beam angle were of used 11 degrees) and the Android device with the detector attached was passed through the light beams (beam angle of 11 toSensors verify 2020 the, 20 performance, x FOR PEER REVIEW of the system and the Android application. 11 of 13 degrees) to verify the performance of the system and the Android application.

Figure 17. Experimental setup. Figure 17. Experimental setup. The maximum distance achieved between the receiver (Android device + photodetector) and The maximum distance achieved between the receiver (Android device + photodetector) and emitter (LED lamp) was 200 cm. As it is the maximum vertical distance, the device was moved emitter (LED lamp) was 200 cm. As it is the maximum vertical distance, the device was moved in a in a horizontal way to obtain the maximum horizontal distance at the maximum vertical distance, horizontal way to obtain the maximum horizontal distance at the maximum vertical distance, obtaining 75 cm as the maximum value that maintains a BER less than 10 9. As the position information obtaining 75 cm as the maximum value that maintains a BER less− than 10−9. As the position information can be sent in one data frame with a size of 14 bits, the minimum time that the user must be under the lamp is 117 ms. That minimum time is traduced in that the users can be moving at a maximum speed of 12 m/s to use our system and ensure data integrity. In addition, as a part of the system, an indoor navigation application was developed, as shown in Figure 18. The application embeds a map where the user is located with the received location information from the beacon, as well as the lamp identification number.

(a) (b)

Figure 18. Application (a) map view of the obtained position and (b) obtained position in DMS format.

Sensors 2020, 20, x FOR PEER REVIEW 11 of 13

Figure 17. Experimental setup.

The maximum distance achieved between the receiver (Android device + photodetector) and Sensorsemitter2020 (LED, 20, 5145lamp) was 200 cm. As it is the maximum vertical distance, the device was moved12 ofin 14a horizontal way to obtain the maximum horizontal distance at the maximum vertical distance, obtaining 75 cm as the maximum value that maintains a BER less than 10−9. As the position caninformation be sent in can one be data sent frame in one with data a frame size of with 14 bits, a size the of minimum 14 bits, the time minimum that the time user mustthat the be user under must the lampbe under is 117 the ms. lamp That is minimum 117 ms. That time minimum is traduced time in that is traduced the users in can that be the moving users at can a maximum be moving speed at a ofmaximum 12 m/s to speed use our of 12 system m/s to and use ensure our sy datastem integrity. and ensure data integrity. In addition, as a part of the system,system, anan indoorindoor navigationnavigation application was developed, as shown in Figure 1818.. The applicationapplication embeds a map where the user is locatedlocated withwith thethe receivedreceived locationlocation information from thethe beacon,beacon, asas wellwell asas thethe lamplamp identificationidentification number.number.

(a) (b)

Figure 18. Application (a) map view of the obtained position and (b) obtained position in DMS format. Figure 18. Application (a) map view of the obtained position and (b) obtained position in DMS format. The receiver was designed to reject possible interferences such as sunlight or artificial lighting. The signal amplitude in the receiver will variate depending on the distance between the LED beacon and the receiver. Multiple tests have been carried out in different hours of the day and other tests were performed, having the lights of the room switched on and off, and similar results were obtained with just a few differences. We have not carried out a deep analysis of the energy consumption of the algorithm. It could be a very interesting task, and we will consider it in future works. Nevertheless, the application uses processing similar to standard audio recording applications, except for the FSK demodulation algorithm. Our first app version (running on android 7.0), uses 1.7% of the system consumption (verifying system records). Today, any mobile device can handle these requirements for hours, so we did not present it, and the work was more focused on the hardware implementation.

4. Conclusions This paper proposes the design of a low cost and low power consumption VLC system as a solution to spread the use of a VLC-based indoor positioning systems in society, allowing any smart device to become a VLC receiver. In the tests carried out, no positioning errors were detected while positioned in the coverage cone at the maximum vertical distance from the emitter. The device was tested with multiple LED lamps and different smart devices, such as augmented reality glasses, tablets and smartphones, among others. The system allows the user, with a low illumination level (~24 lux), to establish the device position with a precision less than 75 cm at 200 cm of the vertical distance between the emitter lamp and the receiver. Sensors 2020, 20, 5145 13 of 14

The developed application allows for indoor navigation, showing the position received from the lamp in a map. The obtained results also show that the system can properly work with users moving at a speed of up to 12 m/s. The system described here does not need to have a database or a preloaded LUT to retrieve the location information because the message frame itself contains the coordinates of each beacon. The sampling frequency required for the audio AD converter in the receiver is estimated using fh as it has a higher number of cycles (n) per symbol. The maximum bit rate obtained was 441 bps when using a sampling rate of 44.1 kHz and n = 10.

Author Contributions: Conceptualization, J.C.T. and P.R.F.; Formal analysis, L.E. and C.I.d.V.; Investigation, J.C.T. and P.R.F.; Methodology, J.C.T. and P.R.F.; Resources, A.M. and S.L.M.; Software, A.M., S.L.M. and J.S.B.; Supervision, J.M.S.-P.; Validation, A.M. and S.L.M.; Visualization, J.S.B.; Writing—original draft, J.C.T.; Writing—review and editing, P.R.F., L.E., C.I.d.V. and J.M.S.-P. All authors have read and agreed to the published version of the manuscript. Funding: This research was funded by INDRA-Adecco Foundation Chair on Accessible Technology, Comunidad de Madrid and the FSE/FEDER Program under grant SINFOTON2-CM (S2018/NMT-4326) and the UNIVERSIDAD CARLOS III DE MADRID under grant 2020/00038/001. Acknowledgments: This research was funded by INDRA-Adecco Foundation Chair on Accessible Technology, Comunidad de Madrid and the FSE/FEDER Program under grant SINFOTON2-CM (S2018/NMT-4326) and the UNIVERSIDAD CARLOS III DE MADRID under grant 2020/00038/001. Conflicts of Interest: The authors declare no conflict of interest.

References

1. Cross, B. How Location Technology and IoT Data Are Transforming Business, Forbes. Available online: https: //www.forbes.com/sites/esri/2018/01/09/how-location-technology-and-iot-data-are-transforming-business/ (accessed on 5 March 2020). 2. Bahl, P.; Padmanabhan, V.N. Radar: An in-building RF-based user location and tracking system. In Proceedings of the IEEE INFOCOM 2000, Conference on Computer Communications, Nineteenth Annual Joint Conference of the IEEE Computer and Communications Societies (Cat. No.00CH37064), Tel Aviv, Israel, 26–30 March 2000; Volume 2, pp. 775–784. [CrossRef] 3. Afzalan, M.; Jazizadeh, F. Indoor positioning based on visible light communication: A performance-based survey of real-world prototypes. ACM Comput. Surv. (CSUR) 2019, 52, 1–36. [CrossRef] 4. He, W.; Ho, P.-H.; Tapolcai, J. Beacon deployment for unambiguous positioning. IEEE Internet Things J. 2017, 4, 1370–1379. [CrossRef] 5. Sakpere, W.; Oshin, M.A.; Mlitwa, N.B. A state-of-the-art survey of indoor positioning and navigation systems and technologies. S. Afr. Comput. J. 2017, 29, 145–197. [CrossRef] 6. Del Campo-Jimenez, G.; Perandones, J.M.; Lopez-Hernandez, F.J. A VLC-based beacon location system for mobile applications. In Proceedings of the 2013 International Conference on Localization and GNSS (ICL-GNSS), Turin, Italy, 25–27 June 2013; pp. 1–4. [CrossRef] 7. Luo, J.; Fan, L.; Li, H. Indoor Positioning Systems Based on Visible Light Communication: State of the Art. IEEE Commun. Surv. Tutorial. 2017, 19, 2871–2893. [CrossRef] 8. Lee, Y.U.; Kavehrad, M. Long-range indoor hybrid localization system design with visible light communications and network. In Proceedings of the 2012 IEEE Photonics Society Summer Topical Meeting Series, Seattle, WA, USA, 9–11 July 2012; pp. 82–83. [CrossRef] 9. Lee, Y.U.; Kavehrad, M. ‘Two hybrid positioning system design techniques with lighting LEDs and ad-hoc ’. IEEE Trans. Consum. Electron. 2012, 58, 1176–1184. [CrossRef] 10. Sertthin, C.; Tsuji, E.; Nakagawa, M.; Kuwano, S.; Watanabe, K. A switching estimated receiver position scheme for visible light based indoor positioning system. In Proceedings of the 2009 4th International Symposium on Wireless Pervasive Computing, Melbourne, Australia, 11–13 February 2009; pp. 1–5. [CrossRef] 11. Yang, S.-H.; Jeong, E.-M.; Kim, D.-R.; Kim, H.-S.; Son, Y.-H.; Han, S.-K. Indoor three-dimensional location estimation based on LED visible light communication. Electron. Lett. 2013, 49, 54–56. [CrossRef] Sensors 2020, 20, 5145 14 of 14

12. See, Y.C.; Noor, N.M.; Calvin, T.Y.M. Investigation of indoor positioning system using visible light communication. In Proceedings of the 2016 IEEE Region 10 Conference (TENCON), Singapore, 22–25 November 2016; pp. 186–189. [CrossRef] 13. Vongkulbhisal, J.; Chantaramolee, B.; Zhao, Y.; Mohammed, W.S. A fingerprinting-based indoor localization system using of light emitting diodes. Microw. Opt. Technol. Lett. 2012, 54, 1218–1227. [CrossRef] 14. Jung, S.-Y.; Hann, S.; Park, S.; Park, C.-S. Optical wireless indoor positioning system using light emitting diode ceiling lights. Microw. Opt. Technol. Lett. 2012, 54, 1622–1626. [CrossRef] 15. Kail, G.; Maechler, P.; Preyss, N.; Burg, A. Robust asynchronous indoor localization using LED lighting. In Proceedings of the 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Florence, Italy, 4–9 May 2014; pp. 1866–1870. [CrossRef] 16. Lim, J. Ubiquitous 3D positioning systems by led-based visible light communications. IEEE Wirel. Commun. 2015, 22, 80–85. [CrossRef] 17. Nadeem, U.; Hassan, N.U.; Pasha, M.A.; Yuen, C. Indoor positioning system designs using visible LED lights: Performance comparison of TDM and FDM protocols. Electron. Lett. 2015, 51, 72–74. [CrossRef] 18. Sciarrone, A.; Fiandrino, C.; Bisio, I.; Lavagetto, F.; Kliazovich, D.; Bouvry, P.Smart probabilistic fingerprinting for indoor localization over fog computing platforms. In Proceedings of the 2016 5th IEEE International Conference on Cloud Networking (Cloudnet), Pisa, Italy, 3–5 October 2016; pp. 39–44. [CrossRef] 19. González, J.L.S.; Morillo, L.M.S.; Álvarez-García, J.A.; Ros, F.E.D.S.; Ruiz, A.R.J. Energy-efficient indoor localization WiFi-fingerprint system: An experimental study. IEEE Access 2019, 7, 162664–162682. [CrossRef] 20. Seguine, D. FSK Detection Using PSoC. Cypress Corporation. Available online: https://www.cy press.com/file/73096/download (accessed on 5 March 2020).

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).