cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH wrong out value +-16g

baks637202
Associate
Posted on September 28, 2016 at 12:35

Hi,

LIS3DH, I don't move it. Sampling rate 400 Hz, CTRL_REG2=0.

+-2g full scale : (0g;0g;1g) out value

+-4g full scale : (0g;0g;1g) out value

+-8g full scale : (0g;0g;1g) out value

+-16g full scale : (0g;0g;0,67g) out value

 

What is going wrong?
11 REPLIES 11
Posted on May 09, 2018 at 08:51

I'm not sure you function is correct, because I don't know what are the variable types.

For reference please see my code.

int16_t result_lsb;

float result_mg;

result_lsb = ((int16_t)high_byte<<8)+(uint16_t)low_byte;

result_mg = result_lsb * sensitivity; // LSB to mg, see sensitivity in datasheet

Did you check that you get 1g of gravity when the device is still?

EM
Associate

Hello

A bit late to the party but since i didn't find an answer, here's my scenario:

LIS3DSH configured at high resolution mode, being polled at 40 Hz

I read ZH=A6(166), ZL=F0 (240)

Converted to 16 bit, I get num=(A6<<8 )+ (F0)

I shift by 4: num=num>>4, i get 2671

then i get the signed value: -1425

Then i multiply by 12 mg/digit, the sensitivity, i get -17.1 g

The value in itself is not necessarily wrong (the sensor is subjected to shocks higher than 16g), but the question is why does the sensor report a higher value.

thank you