Measure the speed of a stationary bike with belt drive

arduinospeed

I have a problem with the measurement of the speed of my stationary bike.

enter image description here (also here)

Parameters:

  1. radius of flywheel is 13cm
  2. second wheel is 12cm (0.12m)
  3. the sensor is simply a reed switch

I'm trying to calculate the speed using this formula :

$$\text{angular velocity} = \text{rotation per second (Hz)}\cdot 2\cdot \pi$$

$$\text{speed} = \text{angular velocity}\cdot{0.12}m/s$$

$$\text{speed} =\text{speed} \cdot 3.6 km/h$$

Are my formulas correct? I'm not using a flywheel in this calculation. I'm using an Arduino Mega with Interrupts. The result isn't quite good (output: pastebin.com/V2mtGzmn).

How to do it more acurrately?

The code is here.

Best Answer

Your system seems to be working as you've designed it. You're counting in increments of one Hz. So your results make perfect sense.

For your system:

1 Hz = 2.94 km/h

2 Hz = 5.88 km/h

3 hz = 8.82 km/h

etc.

If you want more precision, count the milliseconds between each revolution. Your measured revolutions per second (that you're incorrectly calling "angular velocity") value will be 1/(measured seconds), which is in Hertz. Use that value in place of "angular velocity" and you'll likely get the results you're expecting rather than what you've currently designed for.