Received 8 April 2016; accepted 19 May 2016; published 15 June 2016
Internet of Things (IoT), a fast growing technology, is getting popular day-by-day due to increased use of smart 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 WiFi based indoor navigation with smartphone sensor  . 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  . However, WiFi has its own cost-effective factors. Activity level descriptors were achieved with LoMoCo (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  . Alsohuman activity recognition using wearable sensors has also been reported  . 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   . Moreover, star topology reduces the design time complexity, routing delay and error rate compared to mesh topology  -  . User’s activity is generally measured by classification algorithms   . 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  .
2. Related Works
You Li et al.  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.  . 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.  .
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.  . Wu Liu et al.  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.  . 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  .
Ozlem Durmaz Incel et al.  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.  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.  . Kensuke Onishi  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.
3. 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
Figure 1. Eight different activity of the users in the Eight different positions of the same indoor organization (computer science and engineering).
rotation matrices includes set of three euler angles such as azimuth rotation around the Z-axis, pitch rotation around the X-axis and roll rotation around the Y-axis. Applying these three rotations euler angles in azimuth, pitch and roll order transforms identity matrix to the rotation matrix. Three euler angles are positive in the counter-clockwise and negative in clockwise directions such as:
Azimuth is a rotation of about the Z-axis.
Pitch is a rotation of about the X-axis.
Roll is a rotation of about the Y-axis.
The each rotation can be made by smartphone user orientation. A sample dataset is calculated 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, 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(a) showing the front
Figure 2. (a) Front panel of the UA detecting system in LabVIEW; (b) Block diagram of the UA detecting system in LabVIEW.
panel containing waveform chart of Orientations _X, _Y, _Z axis signals and visual variation in orientation of android smartphones.
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.
4. Tests and Analysis
4.1. 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 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(a) represents the signals of one of the eight different users by placing the user’s smartphone at the different positions and direction of the signals are detected and recorded. Other Figures 5(b)-(h) represent the
Figure 3. Overall representation of working model of UA based direction detection monitoring system.
Table 1. Smartphones, server with USB BLE and tools.
Figure 4. Real time sample datasets collected from indoor smartphone user using star topology in IoT.
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 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 Figures 5(a)-(c), Figures 5(e)-(g) indicate the normal signals ascertaining that the users are in the normal mode. 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.
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*.
4.3. Performance Measures
The following performance measures  used to detect the directions of smartphone user’s:
Precision: The fraction of predicted directions those are relevant.
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.
Accuracy: Degree to which the direction prediction is correct.
Error Rate: Degree to which the direction prediction is wrong.
Kappa statistics: Kappa statistic is used to measure the directions between predicted and observed categorizations of a dataset.
The classification algorithm showed higher average precision (RF―0.912, Ibk―0.904, j48―0.855, K*―0.731), average recall (RF―0.913, Ibk―0.904, j48―0.854, K*―0.733), average f-measure (RF―0.913, Ibk―0.904, j48―0.85425, K*―0.73338), accuracy(RF―91.42%, Ibk―90.55%, j48―85.61%, K*―73.54%), kappa statistics (RF―0.92, Ibk―0.892, j48―0.835, K*―0.489) and low error rate (RF―8.575, Ibk―9.447, j48―14.389, K*―26.453). The resultant values in Tables 2-5 show the predicted values of direction detection of user
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 2. Average precision.
Table 3. Average recall.
Table 4. F-measure.
Table 5. Accuracy, kappa statistics and error rate.
activities in eight different smartphone users with their eight different position of the smartphone placed in them with their eight different directions. Using this classification algorithm the performance measures are evaluated for direction detection system.
From Tables 2-5, it is cleared that the Random Forest algorithm is best among the four different classification algorithms such as RF, Ibk (Log and Gaussian kernel for K-NN), j48, K*. From the results the direction of the smartphone users is accurately predicted using the combination of both the orientation sensors and BLE in IoT.
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 organization.
The authors D.K and C.C would like to thank the project coordinators and the TCS officials, for their kind support and valuable inputs throughout the research. Also, I would like to thank TCS-Research Scholarship for providing financial assistance during the entire period.
 Li, Y., Zhuang, Y., Lan, H.Y., Zhou, Q.F., Niu, X.J. and El-Sheimy, N. (2016) A Hybrid WiFi/Magnetic Matching/PDR Approach for Indoor Navigation with Smartphone Sensors. IEEE Communications Letters, 20, No. 1.
 Incel, O.D., Kose, M. and Ersoy, C. (2013) A Review and Taxonomy of Activity Recognition on Mobile Phones. BioNanoScience, 3, 145-171.
 Pei, L., Guinness, R., Chen, R.Z., Liu, J.B., Kuusniemi, H., Chen, Y.W., Chen, L. and Kaistinen, J. (2013) Human Behavior Cognition Using Smartphone Sensors. Sensors, 13, 1402-1424.
 Zachariah, T., Klugman, N. and Campbell, B. (2015) The Internet of Things has a Gateway Problem. Proceedings of the 16th International Workshop on Mobile Computing Systems and Applications, Santa Fe, 12-13 February 2015, 27-32.
 Farej, Z.K. and Abdul-Hameed, A.M. (2015) Performance Comparison among (Star, Tree and Mesh) Topologies for Large Scale WSN based IEEE 802.15.4 Standard. International Journal of Computer Applications, 124, No. 6.
 del Rosario, M.B., Redmond, S.J. and Lovell, N.H. (2015) Tracking the Evolution of Smartphone Sensing for Monitoring Human Movement. Sensors, 15, 18901-18933.
 Tian, Z.S., Zhang, Y., Zhou, M. and Liu, Y. (2014) Pedestrian Dead Reckoning for MARG Navigation Using a Smartphone. EURASIP Journal on Advances in Signal Processing, 2014, 65.
 Susi, M., Renaudin, V. and Lachapelle, G. (2013) Motion Mode Recognition and Step Detection Algorithms for Mobile Phone Users. Sensors, 13, 1539-1562.
 Anguita, D., Ghio, A., Oneto, L., Parra, X. and Reyes-Ortiz, J.L. (2012) Human Activity Recognition on Smartphones Using a Multiclass Hardware-Friendly Support Vector Machine. In: Bravo, J., Hervás, R. and Rodríguez, M., Eds., Ambient Assisted Living and Home Care, Springer, Berlin Heidelberg, 216-223.
 Khan, A.M., Siddiqi, M.H. and Lee, S.-W. (2013) Exploratory Data Analysis of Acceleration Signals to Select Light-Weight and Accurate Features for Real-Time Activity Recognition on Smartphones. Sensors, 13, 13099-13122.