In many situations, a lap counter would be handy. RC sports, motorsports, roller derbies, track events, etc. would benefit from a simple counter that is keeping track of how many laps have been completed.
The idea in this tutorial is to build a counter using two RuuviTags.
One RuuviTag will travel on a competitor/car and is continuously broadcasting.
The another one is listening from a fixed base. This "base station" will record data from the racing RuuviTag and will broadcast a lap count.
All the nearby Android/iOS mobile phones will be able to receive messages from it.
To get started, flash Eddystone firmware to the first RuuviTag. Then flash Espruino firmware to the other one. You can find the files from here.
Configure the racing RuuviTag to broadcast following parameters. Check the Eddystone tutorial to see how it's done.
Copy & paste the following code to Espruino IDE and hit flash. Note that before flashing the code, you need to modify ID to match your Eddystone beacon's MAC address.
Use a beacon scanner of your choice (nRF Connect for example) to see what the base station is broadcasting. The LED of the base station is also worth checking. It should light up every time the other beacon is close.
You can modify the script or configure the Eddystone beacon's TX parameters. To find the best transmission interval and transmission power settings that work, you may need to do some field testing.
If you enhance the script, please let others know by commenting the tutorial.
Ruuvi Innovations Ltd (Oy) / FinlandWeb Design Niku Creative