Device rotation without Gforce


I'm trying to get the device rotation. I have MPU9250. So far, using the sensor's accelerometer, I've successfully calculated the device's rotation state in degrees. However, the accelerometer sensor uses Gforce in its calculations and therefore when the device is moving, so do the values on all axis.

What I'm trying to achieve here is the exact device rotation (in degrees preferably) in all states. Meaning, when the device is accelerating or slowing down, I'll get the same rotation degrees as in its still state.

The final result should help me detect a slope (the device is a mobility scooter FYI).


It becomes the Arduino's problem when you try and make it do the maths LOL

Einstein said there is no difference between the force of gravity and the force of acceleration so they can not be separated by any fancy maths.

Maybe you need to enlist the help of the Earth's magnetic field like they do with this sensor.

If you want to make it simple, use a damped pendulum and a potentiometer on the swing point.
Average the pot value to get angle of incline, your 9250 is probably way to sensitive to do the job.

What do you need to do with the incline angle reading, apply brakes, sound an alarm, limit speed or acceleration?

The pendulum idea is how many after market electric caravan/trailer brakes work, the unit sits under the steering column and controls the trailing vehicle brakes.

Tom… :slight_smile: