accelerometer
An accelerometer measures acceleration — how fast your velocity is changing — and the whole trick is a tiny weight on a spring. Imagine a ball hanging from a rubber band inside a box: shake the box left and the ball lags behind, stretching the band; how far it lags tells you how hard the box accelerated. A MEMS accelerometer is exactly this, shrunk onto silicon: a small slab of silicon (the proof mass) is held by flexible silicon springs, and when the chip accelerates the mass shifts by a fraction of a nanometre relative to the frame. Because the mass carries comb-like fingers that interleave with fixed fingers, that shift changes a capacitance, which the chip reads as a voltage proportional to acceleration.
A subtle, beautiful consequence: at rest on a table, an accelerometer does NOT read zero — it reads 1 g straight up, because gravity tugs the proof mass exactly as an upward acceleration would (Einstein's equivalence principle, made cheap). That's why your phone knows which way is down and rotates the screen. Sensors come as 3-axis devices reporting (x, y, z) in units of g (1 g ≈ 9.81 m/s²), with ranges like ±2 g for orientation or ±200 g for crash detection. Integrate acceleration once and you get velocity; twice and you get position — but tiny offset errors compound, so an accelerometer alone drifts badly over seconds, which is why it's fused with a gyroscope.
Counter-intuitively, an accelerometer in free fall (a dropped phone, an orbiting satellite) reads ~0 g, not 1 g — because the proof mass and frame fall together, so the spring relaxes. 'Weightlessness' in orbit is exactly this: you're accelerating constantly (always falling toward Earth) yet feel nothing, and the accelerometer agrees.