cancel
Showing results for 
Search instead for 
Did you mean: 

We are using a LIS2DH12TR. In our application if we set to 2G we get a result of 400 4G = 200 8G = 100 but 16G goes to 33 and we expected 50 Are we missing something? We get same result over 20 devices Thanks Dan

DStan.3
Associate
 
1 REPLY 1
Eleon BORLINI
ST Employee

Hi Dan, as reported in the conversion table of the datasheet p.10, please note that the conversion factor for the FS=16g case is not the double of the FS=8g one.

0693W000001spagQAA.png

Please consider also the ST official C drivers for the LIS2DH12 on Github, in particular the lis2dh12_reg.c file. Assuming you are running the device in Normal mode, these are the functions to be used to convert raw-data into engineering units:

float lis2dh12_from_fs2_nm_to_mg(int16_t lsb)
{
  return ( (float)lsb / 64.0f ) *  4.0f;
}
 
float lis2dh12_from_fs4_nm_to_mg(int16_t lsb)
{
  return ( (float)lsb / 64.0f ) *  8.0f;
}
 
float lis2dh12_from_fs8_nm_to_mg(int16_t lsb)
{
  return ( (float)lsb / 64.0f ) * 16.0f;
}
 
float lis2dh12_from_fs16_nm_to_mg(int16_t lsb)
{
  return ( (float)lsb / 64.0f ) * 48.0f;
}

You can see that if you insert your raw data inside these expressions, you will always get 25mg.

Regards