Adafruit MMA8451 Accelerometer Breakout
Created by lady ada
Last updated on 2018-08-22 03:42:52 PM UTC
Guide Contents
Guide Contents
Overview
Pinouts
(https://adafru.it/dLn)Power Pins
I2C Pins
INT and ADDR Pins
Assembly
Prepare the header strip:
Add the breakout board:
And Solder!
2
3
6
6
6
6
8
8
9
9
Arduino Code
Download Adafruit_MMA8451
Download Adafruit_Sensor
Load Demo
Library Reference
Set & Get Range
Read Raw Count Data
Reading Normalized Adafruit_Sensor data
Read Orientation
11
11
12
12
14
14
14
15
15
Python & CircuitPython
CircuitPython Microcontroller Wiring
Python Computer Wiring
CircuitPython Installation of MMA8451 Library
Python Installation of MMA8451 Library
CircuitPython & Python Usage
Full Example Code
Python Docs
Downloads
Datasheet & Files
Schematics
Fabrication print
16
16
16
16
17
17
18
21
22
22
22
22
© Adafruit Industries
https://learn.adafruit.com/adafruit-mma8451-accelerometer-breakout
Page 2 of 23
Overview
You can detect motion, tilt and basic orientation with a digital accelerometer - and the MMA8451 is a great
accelerometer to start with. It's low cost, but high precision with 14-bit ADC. It has a wide usage range, from +-2g up to
+-8g yet is easy to use with Arduino or another microcontroller
The MMA8451 is a miniature little accelerometer from Freescale, who are (by this point) masters at the accelerometer-
design game. It's designed for use in phones, tablets, smart watches, and more, but works just as well in your Arduino
project. Of the MMA8451/MMA8452/MMA8453 family, the MMA8451 is the most precise with a built in 14-bit ADC. The
accelerometer also has built in tilt/orientation detection so i can tell you whether your project is being held in
landscape or portrait mode, and whether it is tilted forward or back
© Adafruit Industries
https://learn.adafruit.com/adafruit-mma8451-accelerometer-breakout
Page 3 of 23
This sensor communicates over I2C so you can share it with a bunch of other sensors on the same two I2C pins.
There's an address selection pin so you can have accelerometers share an I2C bus. Please note this chip requires
repeated-start I2C support (in case you are looking to port this to another processor)
© Adafruit Industries
https://learn.adafruit.com/adafruit-mma8451-accelerometer-breakout
Page 4 of 23
To get you going fast, we spun up a breakout board for this little guy. Since it's a 3V sensor, we add a low-dropout
3.3V regulator and level shifting circuitry on board. That means its perfectly safe for use with 3V or 5V power and logic.
© Adafruit Industries
https://learn.adafruit.com/adafruit-mma8451-accelerometer-breakout
Page 5 of 23