cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12 self test query

kghin.1
Associate II

Hello,

We are using LIS2DH12 sensor in our product.

We are following the self test procedure mentioned in AN 5005 Section-12.

0693W000007Bz5WQAS.pngWe have confusion about how to use the raw data from OUT_L and OUT_H of each axis.

(1) Do we need to convert raw data into gravity and then do average and difference or

can we use raw data as is for average and difference ?

(2) while device is in test mode, OUT_L and OUT_H are result of simulated force only or it can be sum of simulated force and external force ?

Regards,

khodidas

1 ACCEPTED SOLUTION

Accepted Solutions

Hi khodidas,

it should not (in case of static or quasi-static "small-signal" disturbance), since the effect should cancel out in the subtraction calculation.

If you have found this reply helpful, please select it as best to close the case.

-Eleon

View solution in original post

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi khodida @kghin.1​ ,

You can first check the example available on Github --> lis2dh12_self_test.c

(1) Do we need to convert raw data into gravity and then do average and difference or can we use raw data as is for average and difference?

It is better to follow the procedure and use the converted data (in mg), as you can see from the sample code, since it is easier to manage the two's complement conversion

  /* Calculate the mg values for self test */
  for (i = 0; i < 3; i++) {
    test_val_mg[i] = fabs((acceleration_st_mg[i] - acceleration_mg[i]));
  }

(2) while device is in test mode, OUT_L and OUT_H are result of simulated force only or it can be sum of simulated force and external force?

As stated in the AN5005 p.56: "when the self-test is activated, the device output level is given by the algebraic sum of the signals produced by the acceleration acting on the sensor and by the electrostatic test-force". So, it can be the sum of the test and the external force. for this reason it is better to leave the device in a rest condition while performing the self-test.

-Eleon

Hello Eleon,

Thanks for your response.

In our production environment, there is possibility of device movement while doing selftest.

Does there possibility that device movement make the selftest fail?

Regards,

khodidas

Hi khodidas,

it should not (in case of static or quasi-static "small-signal" disturbance), since the effect should cancel out in the subtraction calculation.

If you have found this reply helpful, please select it as best to close the case.

-Eleon