Understanding Sensors: Magnetometers, Accelerometers and Gyroscopes

Our smartphones, tablets and other mobile devices are pretty ordinary looking from the outside, but on the inside they are packed with tiny, sophisticated sensors. The three most likely to be in your average device are magnetometers, accelerometers and gyroscopes.

These devices have also been essential for the development of modern consumer virtual reality, as they allow us to measure motion and direction in space. Something that is rather necessary to know when translating movement  to the virtual world. Thanks to research and development in smartphone technology these sensors are now cheap and very tiny, both features that address problems with older generations of virtual reality equipment that was both expensive and clunky.

Before we get to the sensors themselves though, we first have to talk about MEMS or micro-electromechanical systems. The sensors used in electronic devices today are actually microscopic mechanical devices embedded in solid-state silicon microchips. Digital Light Processing or DLP projectors, for example, use millions of microscopic mirrors that tilt individually, thousands of times a second, to produce high definition images. Each mirror can be precisely tilted for fine gradation in light intensity. MEMS technology can provide the mechanical and electrical components needed to build devices such as gyroscopes at a tiny, tiny scale. The next step beyond MEMS is NENS, or nano-electromechanical systems. This takes these components out of the microscopic realm into the domain of nanotechnology. Without MEMS manufacturing methods any smartphone that needed a compass, accelerometer and gyroscope would be very bulky indeed.

A magnetometer is, as you probably can tell, a device that measures magnetic fields. Therefore it can act as a compass, by detecting magnetic North it can always tell which direction it is facing on the surface of the earth. Clever developers have repurposed the magnetometer for use with the Google Cardboard, where a magnetic ring is slid up and down another magnet, the fluctuation in the field is then registered as a button click. Metal detectors also use magnetometers, which is why they can only detect ferrous metals. That is, metals that can be magnetized. Magnetometers can work in a number of different ways. Some use permanent magnets and others use electromagnets. In either case when a magnetic field perturbs the material inside the magnetometer this is detected and the magnitude and direction of that magnetism can be measured.

An accelerometer is a mechanism that lets your device, such as a smartphone, know which way up it is. This is the sensor that tells your phone or tablet whether the screen should be in portrait or landscape mode. One accelerometer can tell whether it is in line with the pull of gravity or not, but if you combines three of them (one for each axis) you can tell which way up something is, since each axis is fixed in relation to the device it is in. MEMS accelerometers are a few hundred microns across, truly tiny devices that add an intuitive input method for computer systems. Of course, accelerometers can measure more than orientation. As the name suggests it can also measure the magnitude of acceleration along an axis. For example, they are used to trigger airbags during a crash where the g-force along the horizontal axis exceeds a certain threshold. In the case of motion sensing devices such as the Nintendo Wiimote the can tell how strong a swing in a particular direction is. The most successful MEMS accelerometers (the capacitive transduction type) consist of microscopic silicon parts that have an almost comb-like structure. When gravity (or g-forces from a fall or swing) perturb the combs they generate an electrical current that can be translated into acceleration data.

Accelerometers have their limitations, however. Although you can get some sophisticated motion data by combining the readings from all three accelerometer axes at the same time, you can’t get data to represent finely grained rotation of the device. For example, if you are playing a game on your smartphone where you turn the phone like a steering wheel an accelerometer wouldn’t be much use, since you are not applying any lateral force to the device. This is where the gyroscope comes in. A gyroscope is a device that can be used to calculate orientation either to help you stick to a particular orientation or to make sure you have changed to the right one. There’s a good chance you’ve seen a mechanical gyroscope. It looks a bit like this:

Gyroscope operation

No matter how the frame (and whatever it’s mounted to) changes orientation, the spinning disc in the middle stays true to its original plane. This is invaluable in, for example, aircraft where you may not know if the craft is level or not due to issues like visibility.

Of course, there are MEMS gyroscopes that achieves the same outcome, just using a different principles. The types of components used to measure rotation in electronic devices can be quite varied. Generally they detect vibration that’s translated to rotational measurement with microscopic tuning forks, vibrating wheels or resonant solid matter. These work like the organs of insects (known as halteres) that help to orient them them. These MEMS gyroscopes are also known as vibrating structure gyroscopes. Since objects that vibrate tend to continue vibrating in the same plane even when rotated, which means the vibrating mass generates a coriolis force that can be detected electronically.

In electronic devices such as smartphones, HMDs or motion controllers these sensors are often represented in multiple iterations. The device may have several gyroscopes, accelerometers and magnetometers in order to provide rich sensor input that can be interpreted by the software as highly accurate and complex movements. The goal is usually to achieve true six-degrees-of-freedom (6DoF), which covers all the degrees of motion for a rigid body in space. In virtual reality 6DoF is the gold standard for a motion sensor.

6 degrees of freedom image

This covers the basics of the sensors in your devices and the basics of how they work. The next time you are looking around with your HMD or having a race using your smartphone spare a thought for the amazing microscopic electronics that make it all possible

Leave a Reply

Your email address will not be published.