

The 3-Axis Accelerometer Breakout - MMA8452Q by SparkFun is a compact and versatile sensor module designed to measure acceleration along three axes: X, Y, and Z. It features the MMA8452Q accelerometer, a low-power, high-performance device capable of detecting motion, orientation, and free-fall events. The module communicates via an I2C interface, making it easy to integrate into microcontroller-based projects.








Below are the key technical details of the MMA8452Q breakout board:
| Parameter | Value |
|---|---|
| Operating Voltage | 1.95V to 3.6V |
| Logic Level | 3.3V (I2C pull-ups are 3.3V) |
| Communication Interface | I2C (7-bit address: 0x1C or 0x1D) |
| Measurement Range | ±2g, ±4g, ±8g (configurable) |
| Output Data Rate (ODR) | 1.56 Hz to 800 Hz |
| Sensitivity | 1024 LSB/g (±2g), 512 LSB/g (±4g), 256 LSB/g (±8g) |
| Power Consumption | 6 µA in standby, 165 µA in active mode |
| Dimensions | 0.8" x 0.8" (20.3mm x 20.3mm) |
The breakout board has six pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | GND | Ground connection |
| 2 | 3.3V | Power supply input (3.3V) |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
| 5 | INT1 | Interrupt 1 output (configurable for motion detection, orientation, etc.) |
| 6 | INT2 | Interrupt 2 output (configurable for additional interrupt sources) |
To use the MMA8452Q breakout board with an Arduino UNO, follow these steps:
Below is an example Arduino sketch to read acceleration data from the MMA8452Q:
#include <Wire.h>
// MMA8452Q I2C address
#define MMA8452Q_ADDR 0x1C
// Register addresses
#define REG_CTRL_REG1 0x2A
#define REG_OUT_X_MSB 0x01
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Configure MMA8452Q
Wire.beginTransmission(MMA8452Q_ADDR);
Wire.write(REG_CTRL_REG1); // Access control register 1
Wire.write(0x01); // Set active mode
Wire.endTransmission();
Serial.println("MMA8452Q initialized.");
}
void loop() {
int16_t x, y, z;
// Request 6 bytes of acceleration data (X, Y, Z)
Wire.beginTransmission(MMA8452Q_ADDR);
Wire.write(REG_OUT_X_MSB); // Start reading from OUT_X_MSB register
Wire.endTransmission(false);
Wire.requestFrom(MMA8452Q_ADDR, 6);
if (Wire.available() == 6) {
x = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB for X-axis
y = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB for Y-axis
z = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB for Z-axis
// Convert raw data to g values (assuming ±2g range)
float x_g = x / 1024.0;
float y_g = y / 1024.0;
float z_g = z / 1024.0;
// Print acceleration values
Serial.print("X: "); Serial.print(x_g); Serial.print(" g, ");
Serial.print("Y: "); Serial.print(y_g); Serial.print(" g, ");
Serial.print("Z: "); Serial.print(z_g); Serial.println(" g");
}
delay(100); // Delay for readability
}
No data or incorrect readings from the sensor.
Arduino hangs or crashes during I2C communication.
Interrupts are not triggering as expected.
By following this documentation, you should be able to successfully integrate and use the 3-Axis Accelerometer Breakout - MMA8452Q in your projects.