Jump to content
I2Cdevlib Forums

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.



Link to comment
Share on other sites

  • 1 year later...

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..

Link to comment
Share on other sites

  • 3 years later...
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.



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

Link to comment
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


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


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...