accelerometer
An accelerometer is a sensor that measures how hard something is being pushed or pulled in a straight line — what physicists call acceleration. A useful way to picture it: imagine a tiny weight hanging on springs inside a box. When the box jerks forward, the weight lags behind and tugs the springs; the sensor measures that tug and reports how strongly, and in which direction, the box is being accelerated. Speed up, brake, or get bumped, and the accelerometer feels it.
There is a clever twist: gravity feels exactly like acceleration to this sensor. Even a perfectly still accelerometer reads a steady upward push of one g, because the ground is constantly holding it up against gravity. That turns out to be wonderfully useful — by sensing which way "down" points, a robot can work out how it is tilted. This is exactly how your phone knows to rotate the screen when you turn it on its side, and how a robot can tell it is leaning before it topples.
Modern accelerometers are MEMS chips — micro-electro-mechanical systems — meaning the springs and weight are etched in silicon so small you would need a microscope to see them, yet they cost pennies and fit on a fingertip. The price of that tininess is noise: the readings jitter, and they cannot tell steady cruising from sitting still, since constant velocity means no extra push. So robots use accelerometers mainly for sensing tilt and sudden jolts, and pair them with other sensors to fill the gaps.
A drone uses its accelerometer to feel which way is down, so it can hold itself level in the air instead of drifting into a slow, lopsided tilt.
Sensing the direction of gravity lets a robot keep itself level.
An accelerometer at rest reads one g of upward support, not zero — a quirk that makes it great for sensing tilt but tricky for measuring true motion alone.