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.

Basics

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.

Prerequisites

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).

Done!

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. 

Tweaks

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. Not approved to Australia (lithium...
    Read more

    RuuviTag Sensor (4in1)

    39,90
  • Ruuvi KitOn backorder
    Every Ruuvi Gateway product is shipped with...
    Read more

    Ruuvi Sensor Measurement Kit

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

    Ruuvi Gateway Router

    199,00
  • RuuviTag Pro 3in1 measures temperature, air humidity and motionIn stock
    Made in Europe, Finland. Worldwide free shipping on orders over...
    Read more

    RuuviTag Pro Sensor

    49,9055,90
    This product has multiple variants. The options may be chosen on the product page