Cadence controlled LED bike lights

I built some cadence controlled LED bike lights this week to put on my bike for this weekend’s Dunwich Dynamo – an annual overnight cycle ride from London to the coast.

Here is a quick demo of the thing in action:


The cadence on the bike is measured by a Wahoo fitness cadence sensor, which detects each time the pedal passes it, as a magnet is fitted to the pedal. The Wahoo fitness sends a signal wirelessly via the ANT+ protocol, typically used for bike computers to display the info on the handlebar.

I used a Raspberry Pi computer with a Suunto USB Ant-stick to pick up the ANT+ signal, and also a Wifi USB dongle so that I could VNC from my phone into the Raspberry PI to make tweaks whilst I was on the ride.

The LED light itself was a strip I’d bought off of eBay.

I used an 13,000mAh Anker battery pack to supply power to both the Pi and the LED strip light.

LED cadence system hardware


The code was based on:
Python ANT library –
Tom Wardill’s HRM code –
Haotianwooo’s Cadence code –
Bibliopixel LED library –


The LEDs and Pi were wired up as follows:

Pi 5V – 5V on USB powers supply, +5V on LED strip
Pi MOSI – DI on LED strip
Pi SCLK – CI on LED strip
Pi GND – GND on USB power supply, GND on LED strip


To get the Suunto USB stick up and running, follow:

Install Python-ANT and the Bibliopixel LED library

I set it to run automatically when the Pi boots up, and installed TightVNCServer so I could log into in from my phone (set up phone tethering as a known wi-fi network on the Pi).

It worked well on the night, and the battery pack lasted the distance – it went from 100% to ~50% over the 11½ hours it was switched on.

My code used on the night ride can be found here:



2 thoughts on “Cadence controlled LED bike lights”

  1. Hi James,

    which raspian version are you using? I am trying it on buster, but I am stuck with thousands of errors like
    ImportError: No module named core
    or : ImportError: No module named queue


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.