Help with reading data from ADXL373 Accelerometer

Hi, I am using ADXL373Z accelerometer with Arduino Uno for a project.

When I run the code, I am getting incorrect values which are probably not even acceleration data. I am thinking it might be a wiring problem, I attached circuit diagram below. This is my first Arduino project, and I couldn't find any other applications with the sensor I am using so any help would be much appreciated. Thanks in advance.

Datasheet for sensor : https://www.analog.com/media/en/technical-documentation/data-sheets/adxl373.pdf

Code ( for x-axis data only) :

// ADXL373 Accelerometer Test

#include <Wire.h>

/* -------- REGISTERS -------- */
#define ADDRESS_ADXL373 0x53 // sensor adress (assumes MISO pin high)
#define ADDRESS_POWER_CTL 0x3F // power control
#define ADDRESS_MEASURE 0x0E // measurement control
#define ADDRESS_TIMING 0x3D // output data rate and extarnal timing triggers
#define ADDRESS_XDATA_H 0x08 // x-axis acceleration data [11:4]
#define ADDRESS_XDATA_L 0x09 // x-axis acceleration data [3:0]
#define ADDRESS_YDATA_H 0x0A // y-axis acceleration data [11:4]
#define ADDRESS_YDATA_L 0x0B // y-axis acceleration data [3:0]
#define ADDRESS_ZDATA_H 0x0C // z-axis acceleration data [11:4]
#define ADDRESS_ZDATA_L 0x0D // z-axis acceleration data [3:0]
/* -------- REGISTERS -------- */

void setup() {
  Serial.begin(115200);
  while(!Serial);
  Serial.println("ADXL373 Accelerometer Test");
  Wire.begin();
  Wire.beginTransmission(ADDRESS_ADXL373);
  Wire.write(ADDRESS_POWER_CTL);
  Wire.write(0x03); // activate full bandwith measurement mode
  Wire.endTransmission(true);
  delay(50);
  Wire.beginTransmission(ADDRESS_ADXL373);
  Wire.write(ADDRESS_MEASURE);
  Wire.write(0x04); // set output signal bandwith to 2560 Hz
  Wire.endTransmission(true);
  delay(50);
  Wire.beginTransmission(ADDRESS_ADXL373);
  Wire.write(ADDRESS_TIMING);
  Wire.write(0x80); // set output data rate to 5120 Hz
  Wire.endTransmission(true);
  delay(50);
}

void loop() {
  byte xAxisH, xAxisL;
  Wire.beginTransmission(ADDRESS_ADXL373);
  Wire.write(ADDRESS_XDATA_H);
  Wire.endTransmission(false);
  Wire.requestFrom(ADDRESS_ADXL373, 1, true);
  xAxisH = Wire.read();
  Wire.beginTransmission(ADDRESS_ADXL373);
  Wire.write(ADDRESS_XDATA_L);
  Wire.endTransmission(false);
  Wire.requestFrom(ADDRESS_ADXL373, 1, true);
  xAxisL = Wire.read();
  int16_t xAxisFinal;
  xAxisFinal = xAxisH << 4 | xAxisL; // bit shift 12-bit output data
  Serial.print("Xa = ");
  Serial.println(xAxisFinal);
  delay(200);
}

Circuit Diagram :

Results from the serial monitor :

What does a measure of "1" indicate? Is this range "mapped" from MIN/MAX bits to another range? Do you have a fan running nearby? Refrigerator? A large roommate on a wood floor? Misbehaving neighbors?

The accelerometer is 3.3V operation only, and requires logical level shifters on SCL and SDA when used with a 5V Arduino.

Something like this will work: https://www.sparkfun.com/products/12009

Better, use a 3.3V Arduino. No level shifters needed.

Yes, ADXL373 can be powered with 1.6-3.5V but I am using the 3.3V pin on Arduino Uno to supply voltage for accelerometer already.

Great! But it still won't work properly, until you add logic level shifters.

Good luck with your project.

I see, I will look into logic level shifters and try to find a 3.3V Arduino to experiment with. Thank you.

I tried the same setup with Adafruit Feather 32u4 Bluefruit LE. Unfortunately there were no changes in the results. I would appreciate any other suggestions.

You may have damaged the sensor by exposing it to 5V I/O.

Try another sensor.

Your code does nothing to check whether any of the attempts at communication with the sensor actually work as expected, so there is no guarantee that the sensor is even responding, or has ever worked.

Most people start with a simple example program that checks some fixed and known feature, for example, read a register that contains the sensor ID. Take a look at the data sheet to find examples.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.