16 | MMA8452 Accelerometer

Accelerometers measure 'proper acceleration' or g-force and are commonly used to measure tilt in cell phones, aircraft and more. In this example we'll learn how to read acceleration data from the MMA8452Q and visualize all three axis on a graph.



Parts List
  • Sparkfun RedBoard

  • 1x MMA8452Q Accelerometer
Circuit Schematic



  • Open the LINX - MMA8452Q Accelerometer example from the LabVIEW Example Finder.

  • The RedBoard only has one I2C master so select I2C Channel 0.

  • Run the VI, then tilt the accelerometer. Notice the X, Y, and Z accelerations update on the graph indicator.

  • Use the X, Y and Z accelerations to control the Red, Green and Blue values of an RGB LED.

  • Create an alarm system that flashes LEDs and sounds a piezo buzzer when the accelerometer is bumped.