Bike Cadence/RPM displayed via Raspberry Pi 3 on Pimoroni Blinkt

Hi,
 
I want to make a cadence/RPM -Raspberry Pi based LED display mounted on my handle bar so I can see my RPM while mountainbiking.
It needs to switch different Led light patterns according to Rpm on the MetaWear RG / Raspberry Pi base.
 
I have bought a Metawear RG development board sensor and downloaded your "MetaWear Python SDK for Debian".
Now I am struggeling to get the data from the sensor usable on a Raspberry Pi.

The sensor connects via Bluetooth (I get the LED to blink Green as proof).
I tried to run various scripts on the Pi and failed to get a read out.
I Do get a read out via ios and Win10 development app btw. 
Can you help us getting some signals out (i'm pretty much a noob on the Pi)?

This is the hardware I have atm:
* Raspberry Pi 3 running Debian Jessie + Metawear + Pimoroni installed
* Metawear RG development board (casing I will 3D print myself for mounting under the pedal or on the Crank)
* Pimoroni Blinkt (8-LED Hat) 
* 5V powerpack to power the RPi for a Day (or more) but still need to buy it :)
 
I need:
Idle / 0-RPM -> program 1 (PRg1.py) will be sleep mode or 1 Red blinking every 3 sec 
Peddling -> program 2 (PRi2.py) will be startup patterns with random blinking and Rainbow for 5 Sec
Rpm 1-15 -> program 3 (PRi3.py) still to create / adjusted Larson/Solid "White"
Rpm 16-30 -> program 4 (PRi4.py) still to create / adjusted Larson/Solid "Red"
Rpm 31-45 -> program 5 (PRi5.py) still to create / adjusted Larson/Solid "Yellow"
Rpm 46-60 -> program 6 (PRi6.py) still to create / adjusted Larson/Solid "Green"
Rpm 61-75 -> program 7 (PRi7.py) still to create / adjusted Larson/Solid "Blue"
Rpm 76-110 -> program 8 (PRi8.py) still to create / adjusted Larson/Solid "Purple"

The PRi*.py programms can be re-writed/adjusted Pimoroni programs like my 1st thought above.

Thanks in Advance,
Ramasen
Netherlands

Comments

  • Can you post the debug output from one of the example scripts you were running?
  • Yes! I have data from accelerometer and gyroscope!
    The trick was to use pybluez instead of pygatt.
    X-Y-Z axes give data in -1 / +1 range for 5 - 10 seconds
  • Ah yea, I've never had much luck with pygatt, always stuck with pybluez.  Glad to hear everything is sorted out.
  • It took me a quite a bit of time to figure it out.
    Now i need to find out how to translate the data into 4 pulse per turn (+x<-> -x and +y <-> -y shifts maybe?).
    From that pulses calculate RPM/cadence, or is there a api / Py lib ready for that?
  • The gyro report angular velocity in degrees per second.  A simple unit conversion to rpm should suffice.
  • When using the gyro it doesn't matter how the sensor is mounted?
  • Yes, you are correct that mounting position is important.  I assumed you were mounting the board at the center of axis but clearly that is not the case as stated in your first post.

    Back to the original question, I am not aware of any py lib that categorizes pulses.  You'll have to search for that yourself or write your own detector.
  • Hi Eric,
    I want to mount it under the pedal Or in line with the crank.
    On the crank (close to the pedal) I have too little room for mounting the sensor.
This discussion has been closed.