Go Down

Topic: How to convert the output voltage from MPU6050 IMU sensor to angle??  (Read 665 times) previous topic - next topic

knithin3

I am using MPU 6050 IMU sensor to measure the Road gradient while riding on a motorcycle. I need to log this data using a logging device where i get the output voltage from the sensor. How can i convert it to angle?? Please help me

ieee488


Idahowalker

After doing the scale factor thing and the bias thing you could do this thing
Code: [Select]
roll = atan2f( get_aX(), sqrtf( (get_aY() * get_aY()) + (get_aZ() * get_aZ())) );
        pitch = atan2f( get_aY(), sqrtf( (get_aX() * get_aX()) + (get_aZ() * get_aZ())) );

After you do that thing, you'll find your readings are a bit jumpie, so you'll want to do a filter thing, which should lead to doing the internet search thing on the words "complementary filter arduino".


Robin2

where i get the output voltage from the sensor.
An MPU 6050 does not produce a voltage output - it produces numbers.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up