Jump to content
I2Cdevlib Forums
Sign in to follow this  
33chen

How to change the accelerometer range level from 2g to 4g for MPU6050

Recommended Posts

Dear all,

 

Just want to how I can change the acceleration level from 2g to 4g on the Jeff's MPU6050 code for raw data. I assume I need to change AFS_SEL = 0 to AFS_SEL = 1. But how could I do it? I didnt find anything I need to change in MPU6050.h file.  Do I need to do something on MPU6050.h file?

 

Thanks all.

 

Ji

Share this post


Link to post
Share on other sites

Hi, can you help me understand how to do it ? maybe im just dump, but i dont even know how to configure that bloody mpu. I dont know what ranges i have...

all i found in the code is AFS_SEL = 0, 1, 2 but i dont know what to do with it..

Share this post


Link to post
Share on other sites
On 6/14/2013 at 9:09 AM, 33chen said:

Hi guys,

 

Just realize it is pretty simple question and I have solved it now. Thanks for this forum.

 

Ji

Hi 33chen, my apologies for opening this post again

it's true that it's easy to change the range in the provided code by jeff rowberg, but I couldn't find any post about it in this forum.

can you please help me how to do it.

thank you

Share this post


Link to post
Share on other sites

I found the answer my self

in case anybody needs it I'm posting it in here

the default sensitivity range for the accelerometer is +-2g which is equal to 16384*2, in which 16384 LSB is equal to the gravity acceleration 9.81m/s^2

in the source code of mpu6050.cpp  line 66 the range has been defined as follows

setFullScaleAccelRange(MPU6050_ACCEL_FS_2);

by changing the number 2 into 4 the range is also changed into +-4g and the sensitivity accordingly to 8192 lbs.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×