sensors_accelerometers2.png
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 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

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

A Black woman's manicured hand holds a round microcontroller with lit up LEDs.
Circuit Playground Express is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and...
$24.95
In Stock
USB cable - USB A to Micro-B - 3 foot long
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...
$2.95
In Stock

To Test Using External NeoPixels

Adafruit NeoPixel LED 1 meter Strip with Alligator Clips wired to Circuit Playground, lighting up rainbow
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...
Out of Stock

This guide was first published on Sep 12, 2018. It was last updated on Mar 08, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.