What it is: The MPU6050 is a 6-axis motion sensor: a 3-axis accelerometer plus a 3-axis gyroscope in one chip. It's the go-to sensor for tilt sensing, self-balancing robots, and gesture projects.
How it works: I2C device at address 0x68 (0x69 if AD0 is tied high). The accelerometer measures g-force on each axis (gravity shows as ~9.8 on the "down" axis); the gyro measures rotation rate. Shares SDA/SCL with the OLED.
Wiring (shared I2C bus with the OLED):
MPU6050 SDA -> GPIO4
MPU6050 SCL -> GPIO5
MPU6050 VCC -> 3V3
MPU6050 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: "Adafruit MPU6050" (installs "Adafruit Unified Sensor" and "Adafruit BusIO"), plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: acceleration X/Y/Z in m/s². Tilt the board and watch gravity move between axes.
Gotchas: Address is 0x68 by default. The raw gyro drifts over time — for stable angles you'd fuse accel + gyro with a complementary or Kalman filter (beyond this intro). Let it sit still a moment at power-on.