Loading Abhiram Reddy Palle

→The labLab 02 / 10 · Sensor experiment

ExperimentMPU6050 · I²C

MPU6050 orientation

Six axes of motion, turned into an angle you can see.

The story, in 3 stages

  1. 01Sensor
  2. 02Angle
  3. 03Visualization

(01)The instrument

MPU6050 · orientationSimulated
g ↓ always down

Angle out

R -24°
P 18°

roll = atan2(ay, az) · pitch = atan2(−ax, √(ay² + az²))

AX−0.31
AY−0.39
AZ+0.87
|g|1.00

A simulation of how the part behaves — not a recording of mine. Bench photos go in the evidence below.

(02)Sensor → Angle → Visualization

  1. 01 · Sensor

    Gravity is the reference

    An MPU6050 packs a 3-axis gyroscope and a 3-axis accelerometer onto one chip. Lying flat, the accelerometer reads about 1 g straight down — gravity is the one thing everything else is measured against.

  2. 02 · Angle

    Tilt is trigonometry

    Tilt the board and gravity's share moves between the axes. Pitch and roll fall out of arctangents of those shares. Use the wrong axis — or the wrong quadrant — and you get confident nonsense like −135°.

  3. 03 · Visualization■

    Seeing what it sees

    Numbers scrolling past on a serial monitor don't tell you much. Plotted against time, or drawn as a board that tilts with the real one, they suddenly do.

(03)On my bench

What I actually did with it

  • 01On the bench, and the heart of the motorcycle safety prototype

[ADD — how you visualised it, a photo, the code]

(04)Evidence

The breakout boardFig. 01
Next on the bench — 03 / 10Sensor experimentMPU9250 heading→The MPU6050's big sibling: nine axes, and a compass.