This paper presents a method to synchronize the clocks in a Bluetooth piconet from the application layer in a mobile phone. It adapts algorithms for time synchronization of distributed systems and the Internet to Bluetooth networks. The performance issues that cause problems for data synchronization between master and slaves in Bluetooth are highlighted. The tests show that the synchronization error is limited to one sampling time.
I. INTRODUCTION AND RELATED WORKApplications in mobile phones that collect and analyze data from multiple wireless sensors have become wide-spread today e.g., in sports, leisure and for physical activities in general. In this paper we present a method to synchronize the clocks between the master and the slaves in a Bluetooth piconet in order to perform data fusion of data from multiple sensors with correct timestamps. One example is collecting data from several inertial sensors placed along the legs of a cyclist to measure the ankle and knee angles and provide feedback to optimize performance [1]. Another application, also estimating the knee angle from wireless inertial sensors, is gait analysis e.g., for recovery and rehabilitation after a knee surgery.The main problem studied in this paper is to associate samples from different sensors that are taken at approximately the same time in order to perform data fusion. One approach is use the Bluetooth clock to synchronize the slaves to the master [3] or other layer-2 techniques. Synchronized time division access protocols can also be used [1]. A comprehensive survey of time synchronization in wireless sensor networks can be found in [4]. Our approach is to achieve data synchronization from the application layer, without having access to the internal Bluetooth stack. It is sometimes not possible or even desirable, to program the wireless sensor nodes. In previous work we have presented an algorithm on the mobile phone for data synchronization without any time information in the data samples sent from the sensor nodes [5]. In this paper we propose a method to synchronize the sensor nodes' clocks using a combination of methods for distributed systems (see brief overview in [6]) and the Network Time Protocol (NTP) [7] for the Internet, adapted to Bluetooth and mobile phones.The paper is organized as follows. Section II introduces our method for time synchronization and the theory behind it. Section III highlights some of the performance issues in Bluetooth that make synchronization of data from multiple sensors on a mobile phone difficult, as described in Section IV.