Direction Detecting System of Indoor Smartphone Users Using BLE in IoT

Indoor organization user activity’s (UA) direction detection monitoring system and also emergency prediction are major challenging tasks in the field of the typical body sensor and indoor fixed sensor networks. In this paper, indoor UA based direction detection monitoring system is achieved by the combination of both the orientation sensor and Bluetooth Low Energy (BLE) in user’s smartphones belonging to the Internet of Things (IoT). The orientation sensor senses the actual orientation of the user and BLE transmits the sensed BLE signals to monitoring system us-ing star topology in IoT. In monitoring system, classification algorithm is used to identify the directions of the smartphone users. The emergency situation of the user is also predicted based on signal variation instantly in real time. The user activity’s signals are captured using LabVIEW toolkit then applied to various classification algorithms such as RF—91.42%, Ibk—90.55%, j48— 85.61%, K*—73.54% are the results obtained. An average of 85% was obtained in all the classification algorithims indicating the consistency and accuracy in detecting the directions of the users. RF was found to be the best among all the classification algorithms. IoT enabled devices have high demand in near coming future, moreover smartphones users increase day by day, hence implementing and maintaining the above said system would be much easier and cheaper compared to other conventional networks.


Introduction
mobile devices like smartphones, tablets, notebooks, ultra-books and Personal Digital Assistants (PDA) etc.These devices have become as a part of everyone's life in this digital world and can be used for many other purposes.
Our work is performed using latest features which are in-built with user's smartphone i.e. orientation sensors and BLE in IoT.Thus, it has high advantage without the support of any attachments or mounting any external sensors either on the user's body or on the walls or entrance or ceilings.UA recognitions are also done with Wi-Fi based indoor navigation with smartphone sensor [1].Recently it was reviewed that the target personal health and well-being applications activity recognition systems using integrated sensors in the mobile phone were obtained [2].However, WiFi has its own cost-effective factors.Activity level descriptors were achieved with Lo-MoCo (Location-Motion-Context) model however the solution had to be restricted up to 1.9 meters in corridor environments and 3.5 meters in open spaces [3].Alsohuman activity recognition using wearable sensors has also been reported [4].Nevertheless, it has its own disadvantages.Whereas, BLE in IoT could be efficiently used for indoor user's direction detection due to its wide range and also best for indoor communication technology with the smartphones using the combination of both the orientation sensors and BLE could be much attractive because it was cheaper than existing methods.This technology consumes low power energy and latency with minimal fixed infrastructure [5] [6].Moreover, star topology reduces the design time complexity, routing delay and error rate compared to mesh topology [5]- [9].User's activity is generally measured by classification algorithms [10] [11].The user orientation readings are recorded using LabVIEW toolkits and are classified by four different classification algorithms (Random Forest (RF), Ibk (Log and Gaussian kernel for K-NN), j48, K*).
In this present paper, the major contribution was that the user's activity direction detection by using star topology was developed by the combination of orientation sensor and BLE in IoT.The objective of the present investigation is to detect the position and direction of the users both in the times of emergences and normal condition while walking, sitting, standing in an organization.The subject performed various activities in different directions with the help of a smartphone, and the signals were taken using LabVIEW toolkit in direction detection monitoring system and were classified by four different algorithms.Therefore, this would be a promising system for the users who are in urgent and normal need in an indoor organization.The present system under considerations has great target applications towards remote health monitoring system, commercial applications and safety services [12].

Related Works
You Li et al. [1] recently reported has hybrid navigation algorithm using off the shelf sensors available in consumer portable devices and existing WiFi infrastructures.The algorithm was tested with Samsung Galaxy S3 and S4 smartphones in two indoor environments (i.e., area E with more WiFi access points and frequent magnetic changes, and area B with less WiFi access points and less magnetic changes) and four motion conditions (i.e., handheld, at an ear, dangling with hand, and in a pants pocket).The performances measured by Dynamic Time Warping (DTW).
Physical movement recognition using inertial measurement unit with users smartphone position of belt on the waist and following activities standing, walking, sitting, lying, staircase ascent and descent are classified by Support Vector Machine (SVM) algorithm was reported by Anguita et al. [13].Human activity recognition using accelerometer sensor with users smartphone positions of front and back pant pocket and jacket breast pocket and following activities are standing, walking running, hopping staircase ascent and descent are classified by Artificial Neural Networks (ANN) was reported by Adil Mehmoodkhan et al. [14].
Motion mode recognition using inertial sensor with users smartphone positions of body or belt and following activities such as walking (swinging, texting, phoning, bag) are classified by decision tree classification algorithm has been published by Melania Susi et al. [12].Wu Liu et al. [15] reported the human body orientation recognition using RGB camera-Depth sensor mounted by hallway and ceiling following activities are static and motion.The performances measured by Dynamic Bayesian network.
Human activity recognition using accelerometer sensor with users smartphone positions a front and back pant pocket and jacket breast pocket and following activities such as standing, walking running, hopping staircase ascent and descent are classified by Artificial Neural Networks (ANN) was reported out by Sourav Bhattacharya.et al. [16].Indoor users physical movement detection using Pyro-electric Infrared (PIR) sensors fixed with hallway, ceiling and opposite wall and following activities are walking(forward, and backward), different speeds (slow, moderate and fast) and distances(neared far) are classified by Bayesian Network, multi-Layer Perceptron (MLP), Naive Bayes (NB) and SVM [17].
Ozlem Durmaz Incel et al. [18] recently reported the human Position recognition using Linear acceleration, gravity, gyroscope and magnetic field in smartphone sensors with following users activity such as walking, jogging, running, biking, going up/down stairs and on a bus are performance classified by K. Nearest Neighbour, MLP and J48 and Fen Miao et al. [19] reported the human physical activity recognition using proximity and light sensor with any pocket and following user's activity such as static, walking, running, walking upstairs and walking downstairs are classified by J48, NB and Sequential Minimal Optimization (SMO).
Global positioning system (GPS) is advantage of user's position identification in outdoor environments.The GPS is not suitable for indoor environments due to lack of line sight between the satellites and receiver was reported by Mekuanint Agegnehu Bitew et al. [20].Kensuke Onishi [21] has recently published an article describing, Beacons using BLE transmit BLE signals, which received by smartphones running iOS or Android OS and demonstration experiments were alone conducted.An indoor position detection using an ordered order-k Voronoi diagram was proposed.
Thus, there has been much report for the UA recognition using various users' smartphones and other indoor fixed and body sensors.However, herein we report the IoT enabled devices for the user's direction detection system using the combination of the orientation sensors and BLE with the classification algorithms.

Direction Detecting System of Indoor User Activity
Figure 1 represents the smartphone user's activity in the different places of the same indoor organization i.e., the direction of the users can be detected, in spite of the smartphones users daily usages such as attending the call, various other smartphone applications, text messages etc. by placing smartphone in different positions such as jacket pocket, pant front pocket, back pocket, in bags and also by placing in belt.

Detection of 3d Euler Angles Using Orientation Sensor
The indoor smartphone UA signals are captured by smartphone orientation sensor derives its data by using a device's geomagnetic field sensor in combination with a devices accelerometer.Using these two hardware sensors, orientation sensor provides data captured mechanism has implemented by android (OS) in smartphone by using ( ) Pitch is a rotation of θ about the X-axis.
( ) Roll is a rotation of ϕ about the Y-axis.
( ) R ψ θ ϕ each rotation can be made by smartphone user orientation.A sample dataset is calcu- lated by single rotation matrix can be formed by multiplying these three Equations (( 1)-( 3)), as shown in Equation (4).Thus this Equation ( 4) evaluates the exact position of the users.
, , where, ( ) , , θ ϕ ψ , are the 3d Euler angles (pitch, roll, azimuth), corresponding to rotations around the X-, Y-and Z-axis, ( ) c and ( ) are shorthand for cosine and sine.Conversion of the rotation matrix to Euler angles positions using Equations (( 5)-( 7)): ( ) ( ) ( ) Each time as the position of the users are changed, the Euler angle values are obtained from rotation matrix in the Equation ( 4) is used to capture the users daily activities in 3d Euler angles values as shown in Figure 2(a) front panel of the single UA detecting system using LabVIEW in shows as Orientation_X, Orientation_Y and Orientation_Z.Similarly seven other different smartphone UA detecting system using LabVIEW was detected.The sample results are collected and it's communicated to a monitoring system using on-demand service.This process involves the output of communicated samples datasets collected by using orientation sensors from eight different smartphone user's with eight different directions using BLE in IoT.The direction monitoring system pre-process the statistical parameters both the mean and standard deviation as shown in Figure 2(a) which are used to calculate the mean (μ) of each Dimension "D" of "N" positions using the following Equation (8): And standard deviation (σ) was calculated using the μ D by the following Equation ( 9): The block diagram of user's activity detection using smartphone's orientation sensor is shown in Figure 2(b) which captures the 3d euler angles positions and transmits to the monitoring system via BLE.The monitoring system recognises the smartphone users BLE name and MAC address and then android initialize the users in while loopcondition using captured android smartphone Euler angles positionsdatausinggets magnetic field gives orientation _X, _Y and _Z axis of the users signals and finally the mean and standard deviations are calculated for each orientations respectively.Hence this has clearly been represented in Figure 2 Figure 3 shows the overall representation of UA based direction detection working model block diagram of both smartphone user's and direction detection monitoring system.The user's activity signals are captured using LabVIEW, then applied to classification algorithms used to evaluate the performance of accuracy detection of directions by the smartphone users.Based on the mean and standard deviation, the inputs are applied to the suitable classification algorithm namely (Random Forest (RF), Ibk (Log and Gaussian kernel for K-NN), j48, K*) to detect the smartphone user's directions monitoring system implemented in LabVIEW (v14.0)toolkit using android package.

Experimental Setup
For experimental purpose, Table 1 is used in the system, users direction detection was carried out using eight different smartphone users walking in eight different places such as (users-inside research lab, walking corridor, entering staff room, research lab (exit and entering), inside third floor computer science lab, ground floor lab (entering and exit) at the department of computer science and engineering at college of engineering, guindy campus, Anna University, Chennai-600025.Indoor environments are used with smartphone user's activity direction monitoring system used with star topology in IoT as shown in

S. No
Model name Specification Eight different smartphone used

7.
Samsung Galaxy On5 OS-v5.1 (Lollipop), Quard-core 1.3 GHz Cortex-A7, 1.5 GB-Ram, BLE (v4.1),Sensors-Accelerometer, Proximity seven other different direction detection and their signals were also recorded similarly.Among the eight different users two users orienting in the direction of South East and North East directions had showed abnormal activities due to some sort of emergency in them, as a result unusual raise in the peak intensity were measured as a final result and are displayed in As seen and analyzed from the graph is clear and obvious that for every 300 seconds the user s position were changed and we could see the oscillations in the signal with ups and downs indicating the different positions were obtained by the users.

Classification
This classification system is used to classify UA as an input from set of collected samples from smartphone users.These input samples are allocated into desired classes.The desired classes are the directions such as North, North East, East, South East, South, South West, West and North West.In our technique, the input to a classification algorithm is the mean and standard deviation values which are calculated from orientation sensor in Equations (( 8) and ( 9)).The process is tested with the following four different classification algorithms: Random Forest, Ibk (Log and Gaussian kernel for K-NN), j48, K*.

Performance Measures
The following performance measures [22] used to detect the directions of smartphone user's: Precision: The fraction of predicted directions those are relevant.
relevant direction predicted direction Precision predicted direction =  .
Recall: The fraction of relevant directions that are predicted.
F-measure: Measure that combines precision and recall is the harmonic mean of precision and recall.
2 precision recall F-Measure precision recall Accuracy: Degree to which the direction prediction is correct.

number of correct predictions Accuracy
Total number of predictions = .
Error Rate: Degree to which the direction prediction is wrong.

number of wrong predictions Error rate
Total number of predictions = .
Kappa statistics: Kappa statistic is used to measure the directions between predicted and observed categorizations of a dataset.

Conclusion
Direction detection system (approximately eight different directions) of eight different users at eight different positions and with each user placing smartphone at the eight different positions within them were successfully achieved by using BLE in IoT using star topology.The classification algorithm was used to measure the smartphone user's directions with different activities.The results obtained by the present system evaluated by various four classification algorithms such as RF, Ibk, j48 and K* are 91.42%,90.55%, 85.61% and 73.54% respectively, and the result of an average 85.28% is obtained in all the four classification algorithms indicating the low error rate 14.71%.Random Forest algorithm was found to be the best among the four different classification algorithms.UA based direction detection and emergency situation prediction system using the combination of both orientation sensor and BLE in IoT was achieved by the four classification algorithms.The direction detecting systems' coverage area could be increased by implementing more number of users' direction detection systems in various places in an organization, which could be the next research work plan.Thus the above system could be considered as the promising one with the help of smartphone in the health care monitoring system in an Internet of Things (IoT), a fast growing technology, is getting popular day-by-day due to increased use of smart How to cite this paper: Kothandaraman, D. and Chellappan, C. (2016) Direction Detecting System of Indoor Smartphone Users Using BLE in IoT.Circuits and Systems, 7, 1492-1503.http://dx.doi.org/10.4236/cs.2016.78131D. Kothandaraman, C. Chellappan

Figure 1 .
Figure 1.Eight different activity of the users in the Eight different positions of the same indoor organization (computer science and engineering).

Figure 2 .
Figure 2. (a) Front panel of the UA detecting system in LabVIEW; (b) Block diagram of the UA detecting system in Lab-VIEW.

Figure 4 .
In the monitoring system installed LabVIEW toolkits running in the computer science admin server with windows 2008 and USB BLE dongles.A sample dataset is collected from the range up to 50 m -100 m in a day today activities performed at different time periods.

Figure 5
represents the eight different user's 8 different directions signals obtained as graph by amplitude vs time in three axes of X-, Y-and Z-both in normal and emergency conditions.Eight users with smartphone placed in the different positions of the computer science department and their activities were analyzed.

Figure 5 (Figure 3 .
Figure 3. Overall representation of working model of UA based direction detection monitoring system.

8 .Figure 4 .
Figure 4. Real time sample datasets collected from indoor smartphone user using star topology in IoT.

Figure 5 (
d) and Figure 5(h).To find out the emergency cases only X-axis is considered, whereas Y-and Z-axis are not considered as not much variation in the signals was observed.However other graphs shown in Figures5(a)-(c), Figures 5(e)-(g) indicate the normal signals ascertaining that the users are in the normal mode.

Figure 5 .
Figure 5.The amplitude along three orthogonally mounted axis, X (red), Y (green) and Z (blue), when the smartphone user is moving in the directions: (a) North, (b) North East, (c) East, (d) South East, (e) South, (f) South West, (g) West and (h) North West.

Table 1 .
Smartphones, server with USB BLE and tools.

Table 5 .
Accuracy, kappa statistics and error rate.