Login

Interface ADXL335 accelerometer with NodeMCU

Objectives

  • Interface an ADXL335 accelerometer with NodeMCU

Things

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

Let’s begin!

An ADXL335 is an analog accelerometer that gives the values of acceleration in three axes – X, Y, and Z.

ADXL335

 

As the ADXL335 has three analog outputs and the NodeMCU has only one analog input – A0, we will use an analog multiplexer (MUX) to allow us to send data from three analog channels to one analog channel. For this project, we will use a 16-channel MUX.

 

16-channel MUX

 

Interfacing ADXL335 accelerometer and MUX with NodeMCU

 

Interfacing ADXL335 accelerometer and MUX 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