cancel
Showing results for 
Search instead for 
Did you mean: 

I do not set the low power mode of the LIS3DH sensor properly.

EEstr.1
Associate II

I am using the ST LIS3DH sensor, and would like to try the low power operation mode, but the results I see on the display are not what I expected, since at rest, instead of seeing values of + -1g, I see values of + -3g, with a full scale of 2g.

And I would also like to know when in the data sheet that says READ REFERENCE, what does the default value of the REFERENCE record mean?

8 REPLIES 8
EEstr.1
Associate II

Could someone help me?

Piranha
Chief II

If you don't care translating your texts, then why should others care investing their time in helping you?

It's already changed to English, it was put in Spanish by mistake, sorry for the inconvenience. Would you know what's going on with the sensor or did you just comment that you don't want to see questions in Spanish?

Eleon BORLINI
ST Employee

Hi @EEstr.1​ , can you pls share the register configuration you used for the LP mode setting on LIS3DH? I can suggest you to check the standard C drivers for the LIS3DH configuration and data reading on github (LINK). For example, the following one is the function for the conversion of the raw data in LP 2g FS into mg:

float lis3dh_from_fs2_lp_to_mg(int16_t lsb)
{
  return ( (float)lsb / 256.0f ) * 16.0f;
}

Regarding the second question, the "REFERENCE" is a register used for the High-pass filter mode reset (p. 36 of the datasheet).

Regards

EEstr.1
Associate II

Hello! Yes, thank you, I have looked at the Githug and it has solved some doubts for me.

On the other hand, I have a doubt in the example of wake-up interrupt, because I don't understand why in the threshold if we want it to have 250mg we put in the register 0x10(16 in decimal).

Hi @EEstr.1​ , you should calculate the threshold from the selected Full scale FS, and divide it for 2^8 (eight bits). For example, for +-2g full scale you will have the following LSB value:

  • 2g/2^8 = 0.015625 g \\ 2g because the negative value is "mirrored", and you can choose a positive value for the threshold from 0g to 2g

and, setting 10h into INT1_THS register this will led to:

  • dec 16 * 0.015625 = 0.25mg

Regards

EEstr.1
Associate II

Hello Eleon! Thank you very much for your help, I understand the problem of the threshold.

On the other hand, I would like to know why in the LIS3DH project configuration and data reading in GitHub (drivers), for example to calculate the value read with 2g FS in Normal mode you do the following operation:

0693W000001cHW9QAM.png

I mean, I don't understand why you divide by 64 and multiply by 4. Wouldn't that be multiplying by 4000 and dividing by 65536?

Thanks in advance.

Regards

Hi @EEstr.1​ , this formula is a direct consequence of the info reported in the datasheet:

  • Full scale 2g --> sensitivity 4mg (p.10 of the datasheet);
  • Normal Mode operation --> 10-bit representation of the data (p.16 of the datasheet);

So, to get the physical units from the LSB you have to undergo the following operations (e.g. for the X-axis data):

  1. OUT_X_H and OUT_X_L bit concatenation --> for example 2A50h
  2. conversion into int16 (it means you have to convert the 2A50h 16 bit value into signed decimal value via two's complement conversion)
  3. but your accuracy in normal mode is 10 bits, so you have to drop 6 bits --> or, equivalently, you can divide your 16 bit value for decimal 2^6 = 64
  4. finally, you have to multiply the value for the mg/LSB sensitivity --> 4mg/LSB

Regards