Home Sensors & Detection MPU6050 6-Axis IMU
Sensors & Detection

MPU6050 6-Axis IMU

$2-5

Specifications

Gyroscope±250/500/1000/2000 °/s
Accelerometer±2/4/8/16 g
InterfaceI2C
DMPBuilt-in motion processor

Use cases

Motion detectionTilt sensingGesture recognition

Integration code

Example code
from machine import I2C, Pin
from mpu6050 import MPU6050

i2c = I2C(0, scl=Pin(22), sda=Pin(21))
mpu = MPU6050(i2c)

accel = mpu.acceleration
gyro = mpu.gyro
temp = mpu.temperature

print(f"Accel: {accel}, Gyro: {gyro}")

Notes and tips

Great for motion/impact detection. Use MPU9250 if you need magnetometer.