Beginner

Overview

A accelerometer measures forces of acceleration, whether from gravity or from the user shaking the device. This means it can tell direction of tilt, rotation, or motion. It's what allows you to control your direction in Doodle Jump when you're playing on your iPhone or what automatically rotates your pictures when you take them horizontally instead of vertically. There are lots of applications for this handy little device. Read on to find out!


Things to Know

  • Accelerometer vs. gyroscope: An accelerometer measures acceleration, whereas a gyroscope measures rotation. An accelerometer will tell you the direction of motion, whereas a gyroscope will tell you an angle along the x and y axis that won't change if you tilt it up and down. For more information on the benefits and drawbacks of each tool, you can check out this article.
  • Choosing a number of axes: A two-axis accelerometer will only measure acceleration in two directions, usually x and y, so it won't help you with up and down. For more functionality, go for a three-axis accelerometer. That will allow you to measure back and forth as well as up and down.
  • Sensitivity: As you can imagine, a more sensitive accelerometer is best. More sensitive accelerometers will give you a wider swing for smaller changes. You'll also want to keep in mind the maximum swing that your accelerometer can measure. You won't need much more than 1 G (the amount of force caused by gravity).
  • Software: The software interface for your accelerometer will depend upon the package you choose. You can find an example of an accelerometer board and corresponding software instructions here.
...
tinyIMU by Nathan Duprey (CC-BY-SA)

Project Ideas


...
Image by Arduino Basics

Motion Detector:

This handy security system will go off whenever it's moved. Put it inside a drawer or under your piggy bank to determine who's been messing with your stuff. You can add a custom code to turn off the alarm if you'd like to extend the project.




...
Image by Vernier

Color-Changing RGB LED:

With this project, you can change the color of an RGB LED by tilting a ball back and forth. It's not a difficult idea, but it leads to interesting results. Think about creating a ring of lights that will change color based on tilt, so the highest point is always blue.




Tilting Musical Ball:

This football has been hacked to include an Arduino and a musical instrument shield that play different notes depending on the tilt. It's a great project to surprise your friends when they just want to play some ball.

...
Image by doghk

Tilt-to-unlock box:

Secure your stuff by building a box that can only be unlocked by tilting it in a certain combination of directions. No one will expect such a cunning security device, and it's definitely harder to hack than a keypad combination.

...
Image by alexdglover

Tips and Tricks

  • Inertial measurement unit: An accelerometer and a gyroscope can be combined into one chip called an inertial measurement unit, or IMU. These can be used in applications such as quadcopters to give you a complete picture of the environment.
  • Interpreting measurements: The math required to interpret your accelerometer readings can be a little dense, so make sure to check out a guide before writing your code. There are lots of guides online, such as this one or this one to get you started.
  • Calibration: Your accelerometer will drift over time and start giving you less accurate readings. To avoid this issue, make sure you caliubrate it on a regular basis to set it back to zero. Your hardware should include information on how to set the initial angle.

Good luck, and have fun!




<-- Previous: Laser Maze Next: Weather Station -->