SMART SENSING insights

Clock Drifts & Synchronization in Wireless Sensor Networks

What if your sensor nodes can’t agree on the time? Having all wireless sensor nodes developed and ready for use is an important milestone toward conducting multimodal experiments – but it’s only the beginning. To ensure consistent data across all nodes, wireless sensor networks rely on precise fusion of measurements from different devices. This is where clock drift quickly becomes a critical factor – and where robust synchronization algorithms are essential.

In this kickoff of our Synchronization Series, we start with a general overview of why synchronization matters and how clock drift affects distributed sensing. You’ll get a first look at the role of clock drift, plus the insights we gained while developing our highly synchronized wireless sensor network maphera®.

Think of this post as the foundation – and for all fellow engineers, don’t worry: you will find algorithms, metrics, and plenty of shiny diagrams in the other posts of the series. We hope you’ll enjoy this series as much as we do. 

Let’s talk about watches

Let’s go back a little bit in time, when a lot of watches were still analog. Every now and then, you check the current time of your watch just to see that it is slightly off. So you compare the time on your watch with a reference clock and correct for its deviation.

Microcontrollers suffer a similar fate. They have internal clocks, which are crucial for a variety of tasks like scheduling and communication. Like our analog watches, the accuracy of time is less important when considering a single individual. As soon as multiple people start making arrangements, a shared time base becomes crucial. In case of sensor networks made of multiple microcontrollers, where each is running at tens of megahertz, drifts of a few microseconds can break system integrity and corrupt recorded data.

maphera® — Drifts & synchronization in wireless sensor networks

Since much of the content in this series is based on the development of maphera®, we will use maphera for reference. But the general problem of drifts and synchronization is pretty much the same for all high-resolution wireless sensor networks that fuse data from multiple sources.

While maphera® can be used for a wide variety of applications, we primarily use it to record physiological data. In this domain, some signals need high time resolution, like data from ECG and IMU sensors. As maphera® is a universal platform, the requirements for the synchronization of recorded data are derived from challenging use cases. maphera® can synchronize up to seven wirelessly connected sensors with an accuracy well below 50 µs.

When two sensors are set up in a wired network, it is rather straightforward to implement time synchronization. However, as maphera® is designed for mobile applications with minimal constraints on subject mobility, the sensors are connected wirelessly. This is where things are getting interesting.

Synchronization in wireless sensor networks

Time synchronization in wireless sensor networks is tricky. Delivering messages wirelessly exposes them to external traffic. For maphera®, we use Bluetooth-Low-Energy (BLE) to send data. BLE is a great tool for low-power wireless applications. We are going to provide more details about synchronization when using BLE in a follow-up post, but here is a quick summary: BLE operates in the ISM band. What makes the ISM band special is that it is free to use in many countries. While this simplifies the portability of BLE around the world without getting into conflicts with local regulations, many other technologies like Wi-Fi operate in this band. Transmitting a message within the ISM band is like riding a bike on the main city road during rush hour. Put your helmet on and hope for the best!

BLE is like a dedicated bike lane for you to ride on. BLE does a great job at evading other traffic on the ISM band with methods like adaptive frequency hopping. It is a very reliable protocol, ensuring messages sent will arrive at the receiver; however, it is highly non-deterministic when it comes to latencies. Another Wi-Fi message might just crush into your BLE message, resulting in a retransmission.

In terms of our initial goal of achieving synchronization, it is not straight forward for a sender to know when a package will arrive at the receiving end. With wired connections the latency is usually constant and can be measured, which makes synchronization easier. In wireless sensor networks varying latencies in the range of tens of milliseconds are not unusual.

Can’t get enough of clock drifts?

“Methods for microsecond accuracy synchronization of Wireless Body Area Networks for biosignal acquisition using Bluetooth Low Energy” by Dominik Weber and Norman Pfeiffer introduces two novel and easy-to-implement synchronization methods for µs-accuracy in Wireless Body Area Networks (WBANs) using BLE.

Read the paper

Weber, Dominik & Pfeiffer, Norman. Methods for Ms-Accuracy Synchronization of Wireless Body Area Networks for Biosignal Acquisition Using Bluetooth Low Energy. Available at ScienceDirect: http://dx.doi.org/10.2139/ssrn.5034871


Image copyright (cover image): Rawpixel.com – stock.adobe.com

Avatar photo

Markus Jechow

Markus is an Embedded Software Engineer in the Medical Sensor Systems group at Fraunhofer IIS. He contributes to the development of innovative medical wearables and embedded medical applications.

Add comment

All Categories