cancel
Showing results for 
Search instead for 
Did you mean: 

Self-test for IIS2DH Accelerometer Always Failing

Jennifer D
Associate II
Posted on November 30, 2017 at 18:09

Axis

Measurement values (mg)

Self-Test Values (LSb)

x

y

z

x

y

z

Z

-46.92

0

-1047.88

5

3

204

-31.28

93.84

1000.96

7

15

185

Y

78.2

969.38

-218.92

14

187

41

-46.92

-969.68

203.32

8

183

43

X

938.4

125.12

49.62

181

23

24

-985.32

-172.04

93.84

190

43

11

Above are the results of a self-test done on an IIS2DH accelerometer.

The acceptable spec for the self test on all axes is between 17 and 360 LSb

, so in all of the above orientations the self-test fails on my accelerometer almost every time on one or more of the axes. Does this mean my sensor is not working? I've tried the self-test on multiple sensors (placed on different PCBs) and they always fail (the results are all similar to the table shown above). Am I performing the self-test incorrectly? Below are the notes from the datasheet that I am following in order to perform and make my calculations.
  • The sign of �Self-test output change� is defined by the ST bit in CTRL_REG4 (23h), for all axes. 
    • I am just taking the magnitude of the difference between the self test enabled and self test disabled results, but I am in Self-Test Mode 0. (ST1 and ST0 are 0 and 1 respestively in CTRL_REG4)
  • �Self-test output change� is defined as the absolute value of:

    OUTPUT[LSb](Self test enabled) - OUTPUT[LSb](Self test disabled). 1LSb = 4 mg at 10-bit representation, �2 g full scale
    • The FS bits in CTRL_REG4 ( FS[1:0] are set to 00 )
    • I am in normal mode, which gives 10-bit representation 
  • After enabling the ST bit, correct data is obtained after two samples (low-power mode / normal mode) or after eight samples (high-resolution mode)
    • I discarded the first two readings before making the passing calculation given in note 5. 

I'm not sure what the next step is to diagnose this problem. Any help is much appreciated!!

#iis2dh #accelerometers #self-test
3 REPLIES 3
Miroslav BATEK
ST Employee
Posted on December 01, 2017 at 17:37

I think, it is very

https://slovnik.seznam.cz/en-cz/?q=improbable

mprobable that all sensors are bad, I think there is something wrong in the self-test procedure.

Can you please explain me more what means the values in the table?

- Are The measurement values (mg)  the values taken without self-test enables?

- Are the Self-Test values (LSB) the absolute difference between value with and without self-test enables?

Maybe you can share the your real self test procedure and I can check it.

Posted on December 01, 2017 at 17:47

Hi Microslav

-The measurement values were me holding the accelerometer so g-force was exerted mostly along the z-axis, the y-axis and the x-axis. I tried to do this in both the negative and positive direction for all three axes (hence the six lines of measurement). The values that I was getting matched what I expected (~1g in each case),  but the self-tests were still off. The measurement values were taken without self test enables. 

- Yes ...the self-test values are the absolute difference between the value with and without the self-test enables. 

Procedure: 

0. Put accelerometer in normal mode, 10-bit resolution , with ODR = 10 Hz. 

1. Take a measurement with self-test disabled ( ST[1:0] = 00)

2. Enable Self-Test

3. Discard first two self-test measurements. 

4. Take a measurement with self-test enabled ( ST[1:0] = 01) . 

5. Take the magnitude of the difference between the values obtained from Step 1 and Step 4. Since the self-test units

   are LSb I did not convert to mg before taking the absolute difference. The math was done on 10-bit raw register values

   on each axis. 

Posted on December 01, 2017 at 18:11

OK, I though I will check the self-test procedure directly in C code (or other language), anyway there could be a problem with timing.

Could you please update the procedure according to following flow (it is for similar sensor so you should discard two samples as it is written in the datasheet). The import is to enable BDU, wait some time after the sensor is power up and when self-test is enabled, check data ready before reading data from output registers.

0690X000006092jQAA.png