SparkFun will be closed on Monday, May 30th, for Memorial Day. We will resume normal business hours at 9am (MT) on Tuesday, May 31st. Orders placed after 2pm (MT) on Friday May 27th will process and ship out on Tuesday, May 31st. From all of us at SparkFun, we wish you a safe and happy Memorial Day weekend!
Accelerometers and gyros are becoming increasingly popular in consumer electronics, so maybe it's time you added them to your project! Scrolling through SparkFun's sensors category reveals a huge list of these sensors that might be perfect for your next project, if only you knew what they did, and which one best fit your project. The goal of this buying guide is to get you speaking the same language as these sensors' datasheets and to help you select the one that is best-suited for your needs.
What's an accelerometer measure? Well, acceleration. You know...how fast something is speeding up or slowing down. You'll see acceleration displayed either in units of meters per second squared (m/s2), or G-force (g), which is about 9.8m/s2 (the exact value depends on your elevation and the mass of the planet you're on).
Accelerometers are used to sense both static (e.g. gravity) and dynamic (e.g. sudden starts/stops) acceleration. One of the more widely used applications for accelerometers is tilt-sensing. Because they are affected by the acceleration of gravity, an accelerometer can tell you how it's oriented with respect to the Earth's surface. For example, Apple's iPhone has an accelerometer, which lets it know whether it's being held in portrait or landscape mode. An accelerometer can also be used to sense motion. For instance, an accelerometer in Nintendo's WiiMote can be used to sense emulated forehands and backhands of a tennis racket, or rolls of a bowling ball. Finally, an accelerometer can also be used to sense if a device is in a state of free fall. This feature is implemented in several hard drives: if a drop is sensed, the hard drive is quickly switched off to protect against data loss.
Now that you know what they do, let's consider what characteristics you should be looking for when selecting your accelerometer:
Gyroscopes measure angular velocity, how fast something is spinning about an axis. If you're trying to monitor the orientation of an object in motion, an accelerometer may not give you enough information to know exactly how it's oriented. Unlike accelerometers gyros are not affected by gravity, so they make a great complement to each other. You'll usually see angular velocity represented in units of rotations per minute (RPM), or degrees per second (°/s). The three axes of rotation are either referenced as x, y, and z, or roll, pitch, and yaw.
In the past, gyros have been used for space navigation, missile control, under-water guidance, and flight guidance. Now they are starting to be used alongside accelerometers for applications like motion-capture and vehicle navigation.
A lot of what was considered when selecting an accelerometer still applies to selecting the perfect gyro:
Gyroscopes and accelerometers are great, but alone they don't give you quite enough information to be able to comfortably calculate things like orientation, position, and velocity. To measure those and other variables many people combine the two sensors, to create an inertial measurement unit (IMU) which provides two to six degrees of freedom (DOF). IMUs are widely used in devices that require knowledge of their exact position, for example robotic arms, guided missiles, and tools used in the study of body motion.
SparkFun's IMUs can really be broken down into two classes: simple IMU combo boards, which just mount an accelerometer and gyro onto a single PCB, and more complex units that interface a microcontroller with the sensors to produce a serial output. If you've glanced over the previous sections, you should know what kind of specifications to be looking for in IMUs: the number of axes (both for the accelerometer and gyro), the measuring range of the sensors, and the interface.
Range: The range of values that a device is capable of measuring is an important factor in deciding which is appropriate for your project. Obviously a 24g accelerometer won't do you much good for tracking body motion unless you plan on being hurled into space by the world's largest slingshot. Likewise, if your accelerometer tops out at 1g then you won't get much useful data on, say, a rocket launch. The range of an accelerometer is measured in g-force, or multiples of the acceleration due to gravity on Earth. The range of a gyro, which measures rotational acceleration, is given in degrees of rotation per second.
Interface: The method by which you send and receive data between a controller and a device is called the interface. There are several standards available and each has its advantages and disadvantages. Analog signals are easy to read and can be measured by most microcontrollers with very little code. Serial communication in this case refers to UART and requires a little more processing overhead but is capable of carrying more information than analog signals, Serial or I2C are common in situations where multiple axes need to be read out to a controller. I2C is a two-wire serial interface that allows several devices to share a bus and communicate with each other, it's also a very common capability among microcontrollers.
Axes: This refers to the number of directions in which acceleration can be measured. Accelerometers measure acceleration along the specified axes whereas gyros measure acceleration about the axes.
Power Requirements: This represents the amount of power that the device will typically consume during operation, your system should be capable of sourcing at least this much current and then some to avoid erratic behavior or brown-out conditions. Many devices also have low-power or power-saving modes in which they'll consume considerably less power. We've also listed the rated voltage of the device for your convenience.
Bonus Features: Every device manufacturer has their own ideas about what 'bells and whistles' should be added to a gyro or an accelerometer. This column is where we list those extra features that set each device apart from the rest.