Objectives
- Interface an ADXL335 accelerometer with NodeMCU
Things
- NodeMCU board (quantity: 1 no.)
- Micro USB cable A to B (quantity: 1 no.)
- Breadboard (quantity: 1 no.)
- ADXL335 accelerometer (quantity: 1 no.)
- Multiplexer [MUX] (quantity: 1 no.)
- Adafruit Unified Sensor library
- Adafruit ADXL335 library
- Jumper wire – male to male (quantity: 4 no.)
- 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.
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.
0 responses on "Interface ADXL335 accelerometer with NodeMCU"