Accelerometer + Arduino
Contents
Overview
This tutorial will cover how to hook up an Arduino with an MMA845 accelerometer. After completing this tutorial, you will be able to read in acceleration data from the x, y, and z directions. Although the MMA845 accelerometer is compatible with all Arduino types, this tutorial will handle hooking up the accelerometer with the Arduino Uno.
Materials and Prerequisites
- MMA8451 Accelerometer
- Arduino (we used an Arduino Uno, but will work with any kind of Arduino)
- Breadboard
- Two 330 Ω resistors
- Connector cables
- Soldering materials (if the headers have not been soldered already)
Downloading Libraries
The nice thing about using this accelerometer is that it comes with libraries that will allow you to quickly start reading in data. Before you download anything though, make sure you have the latest version of the Arduino IDE.
To download the library, click this link.
Setting Up Circuit
We will be using I2C, so there will only need to be two connections between the arduino and the sensor. For more information about I2C, refer to this tutorial.
The materials you will need for this part of the process is the breadboard, MMA845 accelerometer, the resistors, and the Arduino.
Below, you will see a diagram for the circuit. You need to put the accelerometer somewhere on the breadboard, and connect the power (3.3V) and ground with the Arduino. Using the two 330 Ω resistors, connect the SLC port on the Arduino with the SLC port on the accelerometer so that it goes through the resistance. Do the same for the SDA port. Once you have completed the circuit, you are ready to connect the Arduino with your computer.
Authors
- Gillian Laming
Published fall 2018.
Group Link
Our project was called Zesty Vesty. See below for links to our project page and weekly log.
Weekly log
Link to project page
External References
https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide