What sensor should i use? Accelerometer vs Magnetometer

Hi everyone,

I am currently making a project that will measure the angle of the pedal of bike during cycling. I first tried an accelerometer to measure the angle but I quickly found that the accelerometer was only accurate when pedal was stationary. As soon as I started cycling the values became very very un-accurate (which totally makes sense when you look into how the sensor works! stupid me!). Im now looking at the MPU-9250 which contains a magnetometer along with an accelerometer and gyroscope. Will this help me accurately determine my pedal angle as I cycle? My instinct say yes but I dont want to waste my money again!

All help appreciated!


I do not see how a magnetometer will do any good for what you want to do. The gyro on the IMU, maybe.

Clearly a magnetometer will be useless on a bike with (any nearby) steel parts. And since the Earth's magnetic field is mostly distinguished in a horizontal plane, it is hard to see how it would help you with an azimuth indication.

Imagine yourself miniaturised and holding onto the side of the pedal, with your eyes closed. You have your in-built "accelerometer" and gyroscope (semicircular canals in the ears). How would you be able to determine the pedal angle? Your brain is pretty good at this (especially if you are a gymnast!), you cannot expect an IMU to do it if you cannot.