ADXL345* Accelerometer Tutorial

By Evelyn Grevelink, Published: 03/30/2017, Last Updated: 03/30/2017

Data from the built-in 3-axis accelerometer of the Terasic DE10-Nano is measured on ALL 3 axes to show when the board is in motion. The raw output of the accelerometer is converted to g-force values by a sensor library and then sent to graphing software for data visualization and interpretation.

In this tutorial you will:

  • Interface with the board's built-in digital accelerometer using an I2C interface.
  • Use Intel’s I/O and sensor libraries (MRAA and UPM) to get data from the accelerometer.
  • Monitor and observe acceleration data for small vibration and movement along the x, y, z axes.
  • Translate the acceleration data into +/- g-force values to demonstrate the motion of the Terasic DE10-Nano board.
  • Show the accelerometer data using different open-source technologies:
    • Express* (web server)
    • Plotly* (graphing library)
    • Websocket* (data stream).

Note: Both Express.js and Plotly.js are non-restrictive MIT* licensed technologies.

Visit GitHub Project

Additional Resources

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804