I am trying to write arduino code for an accelerometer that I purchased to calculate rpm for a bicycle and am running into some issues. Does anyone have any advice or examples of code to find rpm from an accelerometer?
Thanks!
I am trying to write arduino code for an accelerometer that I purchased to calculate rpm for a bicycle and am running into some issues. Does anyone have any advice or examples of code to find rpm from an accelerometer?
Thanks!
Where is this accelerometer mounted?
On the frame, it could only detect RPM if the wheels are unbalanced and there will be a minimum speed it can't detect.
On the wheel, it will really measure the centrifugal force, mixed with gravity, which will make it very difficult to calculate the RPM.
Use a proper RPM sensor like a reed switch, Hall effect or optical sensor.
It is located inside the crankset, between the two crank arms. I am currently trying to use the angle of rotation from 0 to 360 degress but am having difficulties converting it to rpm in the code.
I can already receive the angle while it is sitting still as well as receiving the angle of the accelerometer instantaneously while it is spinning. So it looks like that part is not "impossible" and that you can measure rpm with a peanut butter sandwich...
Disregarding the likelihood that there are easier ways to go about this . . .
Are you using a single axis accelerometer or a multi-axis?
What does your code for "working while sitting still" look like?