Home Sensor Projects MMA7455 accelerometer example

MMA7455 accelerometer example

by shedboy71

The MMA7455 accelerometer is a sensor that can measure acceleration in three axes. This sensor is commonly available as a breakout board that you can connect to your Arduino. It requires VCC, GND , SCA and SCL to be connected.

The MMA7455L is a Digital Output (I2C/SPI), low power, low profile capacitive micromachined accelerometer featuring signal conditioning, a low pass filter, temperature compensation, self-test, configurable to detect 0g through interrupt pins (INT1 or INT2), and pulse detect for quick motion detection. 0g offset and sensitivity are factory set and require no external devices. The 0g offset can be customer calibrated using assigned 0g registers and g-Select which allows for command selection for 3 acceleration ranges (2g/4g/8g).

The MMA7455L includes a Standby Mode that makes it ideal for handheld battery powered electronics.
Features
• Digital Output (I2C/SPI)
• 3mm x 5mm x 1mm LGA-14 Package
• Self-Test for Z-Axis
• Low Voltage Operation: 2.4 V – 3.6 V
• User Assigned Registers for Offset Calibration
• Programmable Threshold Interrupt Output
• Level Detection for Motion Recognition (Shock, Vibration, Freefall)
• Pulse Detection for Single or Double Pulse Recognition

 

Here is a picture of the sensor breakout.

MMA7455 Accelerometer Sensor Module

MMA7455 Accelerometer Sensor Module

Here is how to wire the MMA7455 accelerometer to your Arduino

Schematic/Layout

MMA7455 Accelerometer arduino

MMA7455 Accelerometer arduino

 

Code

You will need a copy of the MMA_7455 library to make your life easier. Download and copy to your Arduino -> Libraries folder

This example simply displays the X, Y and Z axes settings in the serial monitor

 

[codesyntax lang=”cpp”]

#include <Wire.h> //Include the Wire library
#include <MMA_7455.h> //Include the MMA_7455 library

MMA_7455 mySensor = MMA_7455();

char xVal, yVal, zVal;

void setup()
{
Serial.begin(9600);
delay(500);
Serial.println(“MMA7455 Accelerometer Test.”);
mySensor.initSensitivity(2);
}

void loop()
{
xVal = mySensor.readAxis(‘x’); //Read the ‘x’ Axis
yVal = mySensor.readAxis(‘y’); //Read the ‘y’ Axis
zVal = mySensor.readAxis(‘z’); //Read the ‘z’ Axis
Serial.print(“X = “);
Serial.print(xVal, DEC);
Serial.print(” Y = “);
Serial.print(yVal, DEC);
Serial.print(” Z = “);
Serial.println(zVal, DEC);
delay(1000);
}

[/codesyntax]

 

 

Links

MMA7455 Accelerometer Sensor Module on Amazon UK

MMA7455 Accelerometer Sensor Module on Amazon US

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More