Skip to content

MPU-6050 IMU

InvenSense 6-axis gyroscope and accelerometer

MPU-6050 IMU module

I2C address: 0x68 (fixed — this board does not expose AD0)

The MPU-6050 is a 6-axis Inertial Measurement Unit (IMU) from InvenSense combining a 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer in a single package. It is commonly used in drones, robots, and motion-tracking applications.

The full MPU-6050 register map is available here.

RegisterAddressDescription
WHO_AM_I0x75Device ID — always 0x68
PWR_MGMT_10x6BSleep, reset, clock source, temp disable
PWR_MGMT_20x6CPer-axis standby, low-power wake rate
SMPLRT_DIV0x19Sample rate divider (controls FIFO fill rate)
CONFIG0x1ADLPF bandwidth setting, FSYNC
GYRO_CONFIG0x1BFull-scale range (FS_SEL), self-test
ACCEL_CONFIG0x1CFull-scale range (AFS_SEL), self-test
FIFO_EN0x23Channel enable bits for FIFO
INT_PIN_CFG0x37INT pin polarity (bit 7), open-drain (bit 6), latch mode (bit 5)
INT_ENABLE0x38Interrupt enable mask
INT_STATUS0x3AInterrupt status — clears on read, deasserts INT pin
ACCEL_XOUT_H/L0x3B0x3CX-axis acceleration
ACCEL_YOUT_H/L0x3D0x3EY-axis acceleration
ACCEL_ZOUT_H/L0x3F0x40Z-axis acceleration
TEMP_OUT_H/L0x410x42Die temperature
GYRO_XOUT_H/L0x430x44X-axis angular rate
GYRO_YOUT_H/L0x450x46Y-axis angular rate
GYRO_ZOUT_H/L0x470x48Z-axis angular rate
USER_CTRL0x6AFIFO global enable (bit 6), FIFO reset (bit 2)
FIFO_COUNT_H/L0x720x73Bytes currently in FIFO
FIFO_R_W0x74FIFO read/write port

Accelerometer (AFS_SEL in ACCEL_CONFIG bits [4:3])

Section titled “Accelerometer (AFS_SEL in ACCEL_CONFIG bits [4:3])”
AFS_SELFull ScaleSensitivity
0±2 g16384 LSB/g
1±4 g8192 LSB/g
2±8 g4096 LSB/g
3±16 g2048 LSB/g

Gyroscope (FS_SEL in GYRO_CONFIG bits [4:3])

Section titled “Gyroscope (FS_SEL in GYRO_CONFIG bits [4:3])”
FS_SELFull ScaleSensitivity
0±250 °/s131 LSB/(°/s)
1±500 °/s65.5 LSB/(°/s)
2±1000 °/s32.8 LSB/(°/s)
3±2000 °/s16.4 LSB/(°/s)
T (°C) = TEMP_OUT / 340 + 36.53

PWR_MGMT_1 (0x6B) defaults to 0x40 on power-on — SLEEP bit is set. Firmware must clear it before sensor data is valid.

BitNameDescription
7DEVICE_RESETResets all registers to defaults; auto-clears
6SLEEP1 = sleep mode (default after power-on)
5CYCLELow-power sampling between sleep cycles
3TEMP_DISDisable temperature sensor — TEMP_OUT returns 0x0000
[2:0]CLKSELClock source (0 = internal 8 MHz oscillator)

The standard firmware pattern reads 14 bytes starting at 0x3B in a single I2C transaction, returning accel X/Y/Z, temperature, and gyro X/Y/Z atomically. The simulator snapshots all values at the start of this burst so all 14 bytes are consistent.

ControlRangeDescription
Temperature slider−40 to +85 °CAmbient temperature (thermal lag τ ≈ 0.3 s)
Accel X/Y/Z sliders−16 to +16 gAcceleration along each axis (default Z = 1.0 g)
Gyro X/Y/Z sliders−2000 to +2000 °/sAngular rate along each axis
Gyro Bias X/Y/Z−30 to +30 °/sStatic zero-rate offset per axis (default ≈ 2.5/−1.8/1.2 °/s)
Accel Bias X/Y/Z−200 to +200 mgStatic zero-g offset per axis (default ≈ 15/−20/10 mg)

Bias is a constant additive offset applied on top of the set value — it is not cleared by DEVICE_RESET (hardware property). Real MPU-6050 modules typically show 2–5 °/s gyro zero-rate offset and 10–50 mg accel offset uncalibrated. Firmware must measure and subtract it during a startup calibration routine.

Gaussian noise is added to every reading and scales with DLPF bandwidth (datasheet Table 13):

  • Accel: σ = 400 µg/√Hz × √BW (e.g. ≈ 6.5 mg at 260 Hz, ≈ 0.9 mg at 5 Hz)
  • Gyro: σ ≈ 0.01 °/s/√Hz × √BW — conservative real-world estimate (2× datasheet typical, accounts for module-level noise)
  • Temperature: σ ≈ 1 °C (estimated; electrical characteristics are in PS-MPU-6000A, not the register map)
  • No DMP — the Digital Motion Processor (quaternion / gesture engine) is not simulated
  • Pulse mode treated as latchINT_PIN_CFG latch bit (bit 5) is stored; latch mode works correctly. Pulse mode (50 µs auto-deassert) is simulated as latch mode since a sub-millisecond pulse is not meaningful in simulation — firmware will still see and clear the interrupt normally
  • No self-test response — self-test bits in GYRO_CONFIG / ACCEL_CONFIG are accepted but the output does not change
  • ASCL / ASDA are stubs — the auxiliary I2C master bus is not functional
  • CLKSEL is stored but has no effect — simulation always uses wall-clock time
  • SMPLRT_DIV controls the FIFO fill rate; direct burst reads always return the latest sample