World wide free shipping on orders over 100€ - PayPal and Stripe payments - Made in Finland

Lap Counter: how to create a simple lap counter for sports

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.


Get familiar with Espruino and Eddystone and learn how to update the firmware over-the-air.

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.

Step 1

Configure the racing RuuviTag to broadcast following parameters. Check the Eddystone tutorial to see how it’s done.

  • Eddystone-UID (you can random-generate the ID)
  • 100ms transmission interval
  • -12dBm transmission power 

Step 2

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.

The address can be seen using nRF Connect mobile app (Android | iOS).


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.

Video Tutorial

This video is made by students of Centria University of Applied Sciences. Thanks for contributing!

Featured Products

Find the right products for your measuring needs
  • RuuviTag sensor measures temperature, air humidity, air pressure and motionIn stock
    Made in Europe, Finland. Worldwide free shipping on orders over...
    Read more

    RuuviTag Sensor (4in1)

  • Ruuvi KitIn stock
    Every Ruuvi Gateway product is shipped with...
    Read more

    Ruuvi Sensor Measurement Kit

  • Ruuvi GatewayIn stock
    Note! Every Ruuvi Gateway product is shipped with a...
    Read more

    Ruuvi Gateway Router

  • RuuviTag Pro 3in1 measures temperature, air humidity and motionIn stock
    Choose your model (2in1, 3in1 or 4in1) depending on...
    Read more

    RuuviTag Pro Sensor

    This product has multiple variants. The options may be chosen on the product page