Design of Bluetooth Low Energy Based Indoor Positioning System

Nowadays, there is an increasing demand for indoor positioning systems as services based on location are very important in mobile applications. Since Global Positioning System (GPS) makes only outdoor positioning successful, there is a need of new approaches for indoor positioning systems. Some techniques on indoor positioning systems have been proposed in this scope, but they have not reached to the success of outdoor systems in terms of speed, consistency and power management. The aim of this study is to develop an indoor positioning system using latest Bluetooth Low Energy (BLE) technology. This system consists of BLE sensor nodes, a mobile device and a mobile application that calculates indoor position by measuring the signal levels of the sensor nodes designed. BLE sensor nodes have low power consumption and can be powered by a coin battery. Since most consumers have a mobile phone today, the system can be used easily by installing a mobile application.


I. INTRODUCTION
N RECENT YEARS, the focus of navigation systems has shifted to indoor venues where people spend almost all of their free time.These systems can identify people and track their indoor position.The scope of these systems notably oriented for use in hospitals, malls, museums to monitor people and their behavior, to enhance their satisfaction, and to provide navigation ability.These systems should provide information about location economically and just in time like classical GPS navigation.For instance, an intelligent navigation system guides patients in hospitals or mobile applications make blind people freely discover indoor activities.In other words, an indoor positioning system should provide location-awareness for mobile device users everywhere.Therefore, this study aims to develop accurate and reliable indoor positioning system with power consumption.
This paper is organized as follows: In section 2, the concept of indoor positioning system is presented.In section 3, the newest Bluetooth technology and its properties are described.The developed system is presented in section 4. The experimental results for the proposed system are given in section 5. Finally, section 6 summarizes the study and presents future works.

II. INDOOR POSITIONING
The goal of an indoor positioning system is to make indoor locations to be identified by using sensor nodes.This system uses specific location information gathered from sensor nodes for navigation support.This system could find a possible usage in hospitals, universities, museums and shopping malls.Indoor location information can be used for navigation, giving information about a specific place, collecting customers behaves, helping people with limited vision to navigate and connecting people who are in close proximity.
For this purpose, several systems have been developed over the last decade.One of them is based on Wi-Fi technology, which requires many access points and has lack of accuracy [1].The other developed systems are based on optical, electromagnetic and sound waves [2][3][4][5][6].They have weak capabilities and drawbacks [7].Some of these systems can be combined to improve accuracy, which will make the system more expensive [8].
Since Wi-Fi, infrared and ultra-sound based systems are costly and have complex components to be installed, they can be considered as unpractical to commercialize [9,10].
Bluetooth Low Energy (BLE) is a new technology that can be used for many applications including positioning.BLE has basically focused on lowering the battery use and making the battery usage up to 10 times lesser than that of the classic Bluetooth devices.This specification of BLE gives it a good chance to develop a device, which run on a battery without charging for years like watches, remote control, and health devices.In addition, systems designed based on BLE are economical for commercial applications.These systems use same key components with classic Bluetooth technology except new BLE chipset.This chipset prices are as low as $2 if they are bought in quantities of thousands.There is also an assumption that the BLE will be available in 90% of the smart phones by 2018.All these factors make the BLE to be a good choice for indoor positioning system.

III. BLUETOOTH TECHNOLOGY
Bluetooth technology gives electronic devices an ability to communicate with each other without wires.Bluetooth communication uses radio waves within the 2.4 GHz licensefree ISM (Industrial, scientific and medical) band.Classic Bluetooth is used for short-range wireless communication

Design of Bluetooth Low Energy Based
Indoor Positioning System D. Taşkın I between devices in networks where nodes are all mobile.It uses 79 channels on the 2.4 GHz ISM band with a pseudo-random frequency hopping sequence so a master device can establish connection with 7 slave devices simultaneously.Although it is based on low-cost transceiver microchips and designed for low power consumption, its usage and popularity is decreasing against Wi-Fi enabled devices.Note that Wi-Fi enabled devices have wider range, large list of supported security protocols, user-friendly applications and a larger bandwidth.Bluetooth Special Interest Group (SIG) who manages the Bluetooth specification, lately concerned about these problems and gives this technology a fresh direction by introducing BLE.BLE differs significantly from others classes.While all wired and wireless communications technologies increase their speeds, BLE lowers classical Bluetooth 54 Mbps transfer rate to 0.3 Mbps.Since Wi-Fi and cable based connection solutions are already proved themselves as stabilized and easy to operate for mobile devices, Bluetooth class 4 is designed to achieve another concept.As its name implies, it uses more less power than other Bluetooth standards since peak current not exceeding 15 mA according to the Bluetooth Core Specification.Small amount of data can be transmitted to the host devices without a physical master-slave connection.This means low data rates can be reached by this technology while a small battery lasts for a year [11].This technology also aims "internet of things" concept.Its main objective is to work for a very long time with a small battery and to enable devices to work with the internet technology where traditionally they have not been able to do in so an efficient way.

IV. OVERVIEV OF BLE ARCHITECTURE
Similar to the older Bluetooth technologies, the latest Bluetooth class operates in the 2.4 GHz ISM band but divides it into 40 channels.Three of these channels are located between the commonly used data channels and used for advertising and service discovery.Except within these advertising channels, there are also 37 channels for transferring data (Figure 1).In BLE protocol stack architecture, the controller part is on the lowest layer of the stack and responsible of handling physical hardware signals.This part captures the physical packets in the air band, manages the timing of incoming and outgoing packets and controls the physical level data flow.
The host part of stack consists of application, attribute protocol, security manager and L2CAP properties.L2CAP provides a communication channel for data services between host and controller parts.The L2CAP encapsulates data for the upper service layers.The generic access profile (GAP) is responsible for handling device discovery and connection related services.It gives the ability of implementing different Bluetooth modes like advertising, scanning, etc. to the application layer.The security manager (SM) provides AES (Advanced Encryption Standard) 128-bit encryption engine to be used in authentication, pairing and key distribution.The attribute protocol (ATT) makes a decision about the role of the device.These roles can be master/slave or server/client.Another component is the generic attribute profile (GATT) which is a service framework and responsible for describing the sub-procedures of ATT.It interfaces the application layer to the application profiles.Each attribute profile directly communicates with the specific application and provides data formatting for this application.
In this study, we focus on Texas Instruments' CC254x BLE stack that offers different system design options to the developer.In this evolution platform, a system application can be combined with Bluetooth stack or the application can run in the separate processor called network processor (Figure 3).In the first option single chip is used for application and BLE stack operations.In the second option, a network processor chip is used in addition to BLE stack chip.These separate units communicate with each other using their serial interfaces.The single device configuration has advantages like hardware cost and energy efficiency.This design concept uses only one chip for Bluetooth radio and application layer.While this method does not have additional communication procedures, system performance is better than previous one.It also consumes less power than the network processor configuration since the system can support sleep mode and does not require additional processor.Generally, developers use different type of BLE stacks for different types of applications.However, in this study, Texas Instruments' CC254x BLE stack is used because it uses less energy and has lower system cost due to single device configuration.Since it has build-in 8051 processors for applications, our system is more efficient and reliable than network processor based ones.Several Texas Instruments CC2540 BLE chipset based nodes are placed indoor locations for covering entire test area and embedded software is developed to use them in these nodes.This software simply makes chip to advertise its identification information by using BLE's advertising channels.Also, there is a mobile application developed to for mobile phones.This software identifies nodes and calculates mobile phone's absolute indoor position by using this information.
A. BLE advertiser node BLE advertiser node's hardware does not contain expensive active parts.Leading role belongs to Texas Instruments' CC2540 SOC (System On Chip).Some antenna logic and passive components are used to complete the circuit.While SOC responds to voltage range 2V to 3.6V, there is no need for power circuitry except decoupling capacitors.
This design consists of two crystals (XTAL1: 32 MHz and XTAL2: 32kHz) as clock source while 32kHZ is used only when device is sleeping.This is also a key point for making device more energy efficient (Figure 4, Figure 5).
A BLE device can operate in 4 basic modes.These modes are master device mode, slave device mode, advertising mode and scanning mode.Master and slave device modes need pairing each other and a connection link has to be done before the communication between two devices.While using master/slave modes requires more time to communicate, our developed nodes use advertising mode, which does not need to be connected.To give periodically identification information of device by using BLE advertising channels, developers should use advertising mode.The devices that are in scanning mode can gather this information.While using master/slave modes requires more time to communicate, our nodes use advertising mode and not connected.Developed software uses the BLE software development kit that is supported by manufacturer's BLE stack.The entire BLE protocol stack that is provided by Texas Instruments used as is.All software structure is build around Operating System Abstraction Layer (OSAL).The OSAL is not an actual operating system (OS) in the traditional sense, but rather a control loop that allows software to setup the execution of events.In every loop a list of tasks is executed.These tasks are grouped as The Hardware Abstraction Layer (HAL), Humancomputer Interaction (HCI), Generic Access Profile (GAP) and application.HAL tasks can be checking push buttons, turning on/off LED's, performing communication routines.We use HAL tasks for only checking battery level of device.HCI tasks are used as given by the BLE Protocol Stack.GAP task is responsible of setting device's role, preparing advertising data, setting initial advertising value, setting advertisement type and setting advertising interval.The functionality of the GAP layer is designed to make our node work as non-connectable broadcaster.We use application tasks for only packaging advertisement data and updating it periodically.HAL of the CC254x provides an interface of abstraction between the physical hardware and software.This development layer is like kernel drivers in Linux operating system and makes developed code more flexible and versatile.If a hardware change is done, only HAL code modification is enough to handle this; protocol stack or application code modification is no longer needed (Figure 6).
We also prepared a special advertisement packet format for this work.This advertisement data format consists of five pieces: data length application signature, software revision, battery level and a unique ID.Unique ID is also divided into four two-byte long pieces: Building ID, Floor ID, Region ID and Sensor ID.Data length is always "0E" since our data packet is 15 bytes long.Application signature is 4 bytes long and is selected as "22, DE, 05, 37".And a byte is reserved for each software revision and battery level fields.Software revision is constant value and determined by the developed firmware.Battery level is a living value and updated periodically during advertisement.Unique ID field is prepared specifically for this application and consists of Building ID, Floor ID, Region ID and Sensor ID sub fields (Figure 7).Firmware has to specify all the nodes unique.This is important for identifying each node separately and calculating indoor location.Then, another background engine calculates mobile phone's latest location by using Trilateration method.The basic principle of Trilateration method is that an unknown location (E1) is calculated by using known locations (A, B, C) and signal strength (R1, R2, R3) as shown in Figure 8 [12].point can be calculated by using these parameters [13,14].This location information is shown by the application interface in a preloaded indoor map.Since there are building, floor and region information in UID field, these UID fields can be associated with discrete floor plans.

C. Reliability of the measurements
The measured signal level values, like all radio-enabled systems, vary over time depending on the crowd device's antenna position.In general, the highest RSSI value that could be measured by the scanner engine is -20dB.This value is gathered by placing a node as close to mobile phone as possible.The lowest RSSI value that could be read is -96dB.The scanner engine ignores the values that are out of these bounds.To get better results a field study was conducted.Almost two thousand measurements were taken for each test points to calculate the indoor positions by using the RSSI values and trilateration method.The data set for three test points each on different floor of building are shown in Figure 10.

VI. CONCLUSION
In this paper, an indoor positioning system is proposed that consists of BLE advertising nodes and a mobile application program.The program has three parts as scan engine, trilateration processor and a graphical user interface.The advertising nodes are developed with Texas Instruments' CC2540 Bluetooth Low Energy chip.These nodes are battery powered and act standalone.There is no physical connection between mobile phone and BLE nodes.RSSI signals are used to calculate estimated location of mobile phone.Since BLE nodes are designed to act as an advertiser, there is no need for master-slave connection or link.This also makes this system usable by unlimited mobile phone users simultaneously.
Distributed BLE advertiser nodes (at least three nodes), which can be identified by the application, are placed in a building for the concept of the designed system.By using the designed system, several measurements were done.The number of nodes can be increased to improve the sensitivity of the system.Also, triangulation formula can be extended for this purpose.
We have not offered a calibration scheme for this system since BLE advertisement nodes are identical.However not all mobile phones are the same.A calibration can be performed for all mobile phone brands and these calibration parameters can be used by the mobile application for specific brand.

Fig. 1 .
Fig.1.BLE channels, 37 for data transfer (blue), 3 for advertising (green)According to the Bluetooth Core Specification V4.1, BLE implements an entirely new protocol stack along with new profiles and applications.As shown in Figure2, this protocol stack consists of two sections.

Fig. 3 .
Fig.3.BLE protocol layers of the TI CC254x, left: single device configuration, right: network processor configuration