Login

Interface ADXL345 accelerometer with NodeMCU

Objectives

  • Interface an ADXL345 accelerometer with NodeMCU
  • View the output of every axis as a graph

Things

  1. NodeMCU board (quantity: 1 no.)
  2. Micro USB cable A to B (quantity: 1 no.)
  3. Breadboard (quantity: 1 no.)
  4. ADXL345 accelerometer  (quantity: 1 no.)
  5. Adafruit Unified Sensor library
  6. Adafruit ADXL345 library
  7. Jumper wire – male to male (quantity: 4 no.)
  8. Arduino IDE on your computer

Let’s begin!

An ADXL345 is an digital accelerometer that gives the values of acceleration in three axes – X, Y and Z. It has high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface.

Several special sensing functions are provided. Activity and inactivity sensing detect the presence or lack of motion and if
the acceleration on any axis exceeds a user-set level.

 

 

ADXL345

 

Interfacing an ADXL345 accelerometer with NodeMCU

 

Interfacing an ADXL345 accelerometer with NodeMCU

 

Final Code

To copy the code, right click on view raw at the bottom of the code, click on open link in new tab and then copy the code.

There you go!

Takeaway

Loader Loading...
EAD Logo Taking too long?
Reload Reload document
| Open Open in new tab

We would love to see what you build out of these learnings!

Click here to submit your projects, share it with the world and stand a chance to be rewarded.

top

Knowledge and Content by Li2 Technologies | © 2021 NASSCOM Foundation | All rights reserved

X