Close

Global Time

A project log for Bluetooth Low Energy Mesh Protocol

This is a demo project for my Bluetooth Low Energy Mesh Protocol using a simple nRF51822 based board

tim-wilkinsonTim Wilkinson 08/29/2015 at 21:030 Comments

One of the "nice to haves" in the Mesh is the notional of the current, global time. By default, the nRF51 chips has a good idea of how much time has elapsed (using a relatively accurate and low power counter), but they have no idea of the actual time. One option might be to add a high-precission realtime clock chip. Some of these devices use < 1uA of current so are well suited to these sorts of battery operated devices. However, they also add a few dollars to the BOM which I'd rather avoid.

The software answer is to build an NTP like protocol into the mesh. NTP is the protocol your laptop and phone use to keep their time synchronized with the global time on Earth; essentially it tunes a local clock's precision and reliability to match global time.

In the Mesh, whenever an external devices (e.g. Phone) attaches to read the current state, it also provides the current global time to the devices. With enough of these time samples, the mesh is able to adjust and synchronized all the nodes to this time keeper and so establish a consistent, correct, global time across the entire mesh.

The code just hit GitHub if you want to take a look.

Discussions