# Make It Shake, Rattle, and Roll: Accelerometer Use

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/061/026/medium800/sensors_accelerometers2.png?1536239587 At left, a large 1950's inertial navigation system, credit CC BY-SA 4.0 Sanjay Acharya Wikipedia, at right, the Circuit Playground Express and the tiny LIS3DH sensor in the center. )

You have a great project idea and it involves action when something moves. How do you turn that idea into a project? Some type of Rube Goldberg machine? Nope - today there are inexpensive, tiny chips called accelerometers which detect motion in three directions. These can make the measurements for you, allowing you can focus on implementing your project!

Adafruit makes several breakout boards using accelerometers for various projects. In addition, the Adafruit [Circuit Playground Express](https://www.adafruit.com/product/3333) has an accelerometer on-board (at the very center) which works great!

This guide will demonstrate the use of an accelerometer in Microsoft MakeCode and CircuitPython using simple projects which will allow you to quickly incorporate movement sensing in your project.

## Acceleration & Movement
![](https://cdn-learn.adafruit.com/assets/assets/000/060/865/medium800/sensors_Cartesian-coordinate-system.jpg?1536069490)

_Movement_ in two dimensions can be thought of as changing the point you are at on a piece of flat paper. Let's make it graph paper so we can count where we might be. If we start at the _center,_ (0, 0), we can move anywhere to the right or left, which we will call the x direction. We can also move up and down (we'll call y). And we can move both up/down and left/right (which would mean changes in both the x and y directions). This is our shake and rattle.

If we now consider that we can lift something off the graph paper (above it or putting it below it), we get one more set of directions, we'll call z. Using three sets of coordinates to point to a place (like 0,0,0) is called _3 dimensions_ or 3D which we hear alot about. This is the roll.

Now if I move from one place to another, say (0,0,0) to (10,10,10), I have created an _acceleration_. Wait, what about a _velocity_, or steady movement? Well, to start at 0 and stop at 10, you have to get going and slow to a stop, both which both are not a steady change in motion. This change in motion which we can relate to a change in where we move something, is called _acceleration_.

A device which can measure acceleration, changes in motion, is called an _accelerometer._ Back in the Space Race, an accelerometer was HUGE. Even ten years ago, an accelerometer for one or two directions was rather expensive. Due to cell phone developments, now accelerometer chips are inexpensive and tiny - yay!

## Parts
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
![A Black woman's manicured hand holds a round microcontroller with lit up LEDs.](https://cdn-shop.adafruit.com/640x480/3333-05.jpg)

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

### To Test Using External NeoPixels
### Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter

[Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter](https://www.adafruit.com/product/3812)
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow! This **Adafruit NeoPixel LED Strip with Alligator Clips** has **30 total LEDs in a "30 LED per meter" spacing** , and is 1 meter long,...

In Stock
[Buy Now](https://www.adafruit.com/product/3812)
[Related Guides to the Product](https://learn.adafruit.com/products/3812/guides)
![Adafruit NeoPixel LED 1 meter Strip with Alligator Clips wired to Circuit Playground, lighting up rainbow](https://cdn-shop.adafruit.com/product-videos/640x480/3812-06.jpg)

- [Next Page](https://learn.adafruit.com/make-it-shake-rattle-and-roll/lis3dh-and-other-accelerometers.md)

## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter

[Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter](https://www.adafruit.com/product/3812)
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow! This **Adafruit NeoPixel LED Strip with Alligator Clips** has **30 total LEDs in a "30 LED per meter" spacing** , and is 1 meter long,...

In Stock
[Buy Now](https://www.adafruit.com/product/3812)
[Related Guides to the Product](https://learn.adafruit.com/products/3812/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### Circuit Playground Express - Base Kit

[Circuit Playground Express - Base Kit](https://www.adafruit.com/product/3517)
It's the **Circuit Playground Express Base Kit!** &nbsp;It provides&nbsp;the few things you'll need to get started with the new [Circuit Playground Express](https://www.adafruit.com/product/3333).&nbsp;This version of Circuit Playground is super powered, and will...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3517)
[Related Guides to the Product](https://learn.adafruit.com/products/3517/guides)
### Circuit Playground Express Advanced Pack

[Circuit Playground Express Advanced Pack](https://www.adafruit.com/product/2769)
 **Circuit Playground Express** &nbsp;is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to program....

Out of Stock
[Buy Now](https://www.adafruit.com/product/2769)
[Related Guides to the Product](https://learn.adafruit.com/products/2769/guides)
### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [CircuitPython Hardware: LED Backpacks & FeatherWings](https://learn.adafruit.com/micropython-hardware-led-backpacks-and-featherwings.md)
- [Circuit Playground Express Rocket Lamp](https://learn.adafruit.com/cpx-rocket-lamp.md)
- [Circuit Playground Express Sugar Glider](https://learn.adafruit.com/cpx-sugar-glider.md)
- [How to Choose a Microcontroller](https://learn.adafruit.com/how-to-choose-a-microcontroller.md)
- [Make It Plot](https://learn.adafruit.com/make-it-graph-plot.md)
- [CircuitPython Hardware: PCA9685 DC Motor & Stepper Driver](https://learn.adafruit.com/micropython-hardware-pca9685-dc-motor-and-stepper-driver.md)
- [Capacitive Touch Pulsing Heart](https://learn.adafruit.com/3d-printed-heart-capacitive-touch.md)
- [Hacking Ikea Lamps with Circuit Playground Express](https://learn.adafruit.com/hacking-ikea-lamps-with-circuit-playground-express.md)
- [Circuit Playground Express Compass](https://learn.adafruit.com/circuit-playground-express-compass.md)
- [Mouse Painter: Emulate Mice with MakeCode ](https://learn.adafruit.com/mouse-painter-emulate-mice-with-makecode.md)
- [Jellyfish Umbrella with easy WLED WiFi Control](https://learn.adafruit.com/jellyfish-umbrella-with-easy-wled-wifi-control.md)
- [Slider Crank Mechanism -- from Cardboard and Craft Sticks](https://learn.adafruit.com/cardboard-slider-crank.md)
- [Circuit Playground Analog Input](https://learn.adafruit.com/circuit-playground-analog-input.md)
- [Crickit Powered Holiday Diorama](https://learn.adafruit.com/crickit-powered-holiday-diorama.md)
- [Kombucha Thermostat with CircuitPython and Feather ](https://learn.adafruit.com/kombucha-thermostat-with-circuitpython-and-feather.md)
