How to convert the measurement range of MPU6050 accel & gyro from +-16g / 2000 deg/sec into +- 2g / 200deg/sec?

 import smbus
 import time

# Get I2C bus
bus = smbus.SMBus(1)

# MPU-6000 address, 0x68(104)
# Select gyroscope configuration register, 0x1B(27)
# 0x18(24) Full scale range = 2000 dps
bus.write_byte_data(0x68, 0x1B, 0x18)
# MPU-6000 address, 0x68(104)
# Select accelerometer configuration register, 0x1C(28)
# 0x18(24) Full scale range = +/-16g
bus.write_byte_data(0x68, 0x1C, 0x18)

# MPU-6000 address, 0x68(104)
# Select power management register1, 0x6B(107)
# 0x01(01) PLL with xGyro reference
bus.write_byte_data(0x68, 0x6B, 0x0

Its in ±16g but and according to the datasheet 1 page 15, its AFS_SEL. So i just simply replace the bus.write_byte_data(0x68, 0x1C, 0x18) the ‘0x18’ into AFS_SEL = 0 and replace ‘0x18’ into FS_SEL = 0 for both accelerometer and gyro?

 Acceleration in X-Axis : 932
Acceleration in Y-Axis : -108
Acceleration in Z-Axis : 15036
X-Axis of Rotation : -362
Y-Axis of Rotation : -40
Z-Axis of Rotation : -114

Data i get using bus.write_byte_data(0x68, 0x1C, 0x18)

Acceleration in X-Axis : 924
Acceleration in Y-Axis : -32
Acceleration in Z-Axis : 15072
X-Axis of Rotation : -335
Y-Axis of Rotation : -30
Z-Axis of Rotation : -95

And these are the data i get by using (0x68, 0x1C, 0x00)
Aren’t they almost the same?

Hi,

I’m assuming that the device is at a state of rest while these readings are being read. Accelerometers and Gyros are a relative sensor and have off zero readings while at rest. The readings you’re getting should be considered a zero value reading.

You may try testing them on something that moves like a washing machine, pump, or motor to see if the values are still similar while in use.

Also the write to register 0x6b, the datasheet recommends using something other than the internal clock unless you’re going for a low power mode. Try 0x68, 0x6b, 0x01-0x03. It should improved stability.