IMU Motion and Environment Workbench
Tilt an IMU to read gravity on three axes, run motion presets, watch a gyro trace, and convert barometric pressure to altitude
Tilt an IMU, run motion, and read altitude from pressure.
Every number on this page follows from a stated formula. Tilt the board to split gravity across three axes, run motion presets with their real acceleration signatures, and switch to the barometric mode to turn pressure into altitude.
Three-axis accelerometer and gyro
A stationary accelerometer measures gravity, so tilt splits 1 g across the axes.
Pitch (side view)
Board tipped nose-up or nose-down.Roll (front view)
Board tipped left or right.Total acceleration |a| over time
Static holds at 1 g; free-fall collapses to about 0 g; walking and shake swing around 1 g.
Gyroscope rate trace (representative)
The gyro reads angular velocity in deg/s. It is near zero when still and grows with rotation; integrating it drifts over time.
Barometric pressure to altitude
Lower measured pressure implies higher altitude through the barometric formula.
Model readings
The same instant shown as axis values, reconstructed angles, and raw counts.
Formula trace
Live substitution into the equation that produced each reading.
ax = -sin(pitch)
Pitch tips gravity onto the x axis.
ay = cos(pitch) * sin(roll)
Roll splits the remaining gravity onto y.
az = cos(pitch) * cos(roll)
What is left of gravity stays on z.
|a| = sqrt(ax^2 + ay^2 + az^2)
Static tilt always totals 1 g; motion or free-fall changes it.
pitch = atan2(-ax, sqrt(ay^2+az^2)); roll = atan2(ay, az)
The same gravity split, inverted back to angles.
h = 44330 * (1 - (P / P0)^0.1903)
Standard barometric formula; 44330 m and 0.1903 are fixed constants.
h = 44330 * (1 - (900.0 / 1013.25)^0.1903) = 988.7 m
P is measured pressure; P0 is the sea-level reference.
rule-of-thumb: (P0 - P) x 100 / 12
Only accurate near sea level, where ~12 Pa maps to 1 m.
Learning support
These notes keep the simplified workbench honest about what a real MPU6050 and BMP280 do and do not measure.