ADXL356C interface with controller

Hello All,

I’m trying to interface ADXL356C accelerometer to Teensy 4.0 microcontroller. The teensy controller has 12 bit ADC.
The sensor is configured in +/-10g mode and in Normal Wok mode. It is been supplied with 3.3V supply from teensy microcontroller.

The sensor is placed in Z axis direction to measure vibration generated from vibrator source.
The vibrator source constantly generates 1g rms value, so the Vp will be 1.414g vibration with a peak frequency of 159.2 Hz.

The sensor detects peak frequency correctly but the g value detection is not correct.

The g value detected by the sensor is -1.79g instead of 1g rms which is not correct and also it is greater than Vp value.

I used below formula to calculate g value.

int sensorvalue = analogRead(A0);
float g = ( ( ( (double)(sensorvalue *3.3 )/4095.0) - 0.9) / 0.08);

4095 is the ADC resolution, 3.3V is the vref, 0.9 is the zero g offset, 0.08 is the sensitivity.

I also noticed that all the values are shown with negative sign even though I change the orientation of sensor in Z axis

Any help will be appreciated.