Sensing Orientation & Motion

Many smart devices are aware of their orientation and motion in space. For example, smartphones will automatically switch the screen between landscape and portrait layouts depending on the orientation of the phone. The most basic sensors are electromechanical devices that detect motion using physically moving parts. The image below depicts a basic electromechanical tilt sensor. The sensor contains small metal balls that make electrical contact when the sensor is oriented upright. When the sensor is upside down, the contact is broken. This type of sensor is simple, robust and easy to use, though the data is limited (on/off) and the sensor is susceptible to vibration.

More complicated electromechanical sensors, such as gyroscopes, use a large, spinning mass to detect changes in orientation. Due to the conservation of angular momentum, the spinning mass will resist any change in orientation and will continue to point in the same direction. Electromechanical gyroscopes consume large amounts of power to keep the mass spinning, and are susceptible to wear and mechanical failure. In many sensing applications, electromechanical gyroscopes have been replaced by MEMS devices.

Most modern orientation/motion sensors are microelectromechanical systems (MEMS). As the name implies, MEMS devices use the same electromechanical principles scaled down to a chip-level scale. Normal chips are manufactured by etching microscopic electronic devices onto a silicon substrate. MEMS chips use a similar process to also etch mechanical features, such as springs and levers. The image below shows an electron-microscope scan of a MEMS accelerometer sensor. The image shows a moving mass (middle) that is suspended by springs (top/bottom). This mass moves in response to left-right motion of the device, and the displacement of the mass is detected by the comb-like structure to the left and right of the mass. Support circuitry on the chip is responsible for amplifying and translating these analog readings to digital data.

Different types of solid-state sensors can be used for orientation and motion sensing. Some are based on MEMS technology, others rely on different principles, such as the Hall effect.

  • Gyroscopes measure changes in rotational speed.
  • Accelerometers measure changes in linear velocity (acceleration). Earth’s gravitational field corresponds with an acceleration of 1 G, and this is also detected by accelerometers
  • Magnetometers measure the orientation of an external magnetic field, such as earth’s magnetic field.
  • Barometers measure air pressure. Because air pressure is dependent on altitude, precision barometers can be used as altimeters with ±1m of accuracy.

Sensors are also categorized by the number of axes they measure. The most basic sensors measure only one axis, e.g. acceleration in one direction. More advanced sensors will measure three cartesian axes (e.g. X, Y, Z) so that acceleration in any direction can be computed. The most advanced systems will combine 3-axis accelerometer, gyroscope, and magnetometer sensors into a single 9-DOF Inertial Measurement Unit (IMU). Using a sensor fusion algorithm (e.g. a Kalman filter), data from multiple sources is combined into one high-accuracy result. Sometimes, accelerometer, gyroscope, and magnetometer sensors are combined in a single chip. Doing so prevents potential mis-alignment errors. The most advanced IMU chips (e.g. MPU-6050) have an integrated coprocessor that handles sensor fusion calculations.

Further Reading

Sparkfun – Accelerometer, Gyro and IMU Buying Guide
AHRS for Adafruit’s 9-DOF, 10-DOF, LSM9DS0 Breakouts