Skip to main content
Visitor II
October 3, 2019
Solved

LSM9DS1 Temperature

  • October 3, 2019
  • 4 replies
  • 1835 views

HI,

I've problems on the temperature detected by the LSM9DS1. I used the "Unico" software to configure the Acc/Gyro and the Magnetometer, in particular I used the "Easy configuration button".

I read the temperature (Unico page Acc/Gyro Registers) from registers OUT_TEMP_L/OUT_TEMP_L and the values are:

OUT_TEMP_L: around 3-7 (in hex)

OUT_TEMP_H: always zero (it's ok)

I'm in office and at the moment the temperature is around 24°C. Is something I'm missing?

Thanks,

Giorgio

    This topic has been closed for replies.
    Best answer by Eleon BORLINI

    In this case the ​OUT_TEMP_H + OUT_TEMP_L is a negative value, because the value must be read in two's complement. So FFD0h is -48 decimal, and /16 means -3°C. In your room (or outside, maybe not here in Milan...) you should have around 25-3=22°C. Regards

    4 replies

    ST Employee
    October 4, 2019

    Ciao Giorgio, consider that the 0 output of the temperature registers is at 25°C, and that sensitivity is 16 LSB/°C (so basically only the 12 MSbit of OUT_TEMP_H + OUT_TEMP_L are significant), p16 of the datasheet. In your case the output is 03h-07h, so basically 25°C. Not the top accuracy this temperature sensor indeed, but you can check heating it with your finger if temperature is changing. Please refer to these drivers.

    float_t lsm9ds1_from_lsb_to_celsius(int16_t lsb)
    {
     return (((float_t)lsb / 16.0f) + 25.0f);
    }

    Regards

    Visitor II
    October 4, 2019

    Ciao Eleon,

    thank you very much! Really appreciated.

    I'm experiencing another kind of problem at the moment. Same steps I mentioned above but the temperature registers are now:

    OUT_TEMP_L: 0xD0

    OUT_TEMP_H: always 0xFF

    It seems the device is not configured but I've done the same operations I mentioned.

    BR,

    Giorgio

    ST Employee
    October 4, 2019

    In this case the ​OUT_TEMP_H + OUT_TEMP_L is a negative value, because the value must be read in two's complement. So FFD0h is -48 decimal, and /16 means -3°C. In your room (or outside, maybe not here in Milan...) you should have around 25-3=22°C. Regards

    Visitor II
    October 4, 2019

    You're right and I understood your explanations. The point is that the sensor (EVAL BOARD) is in office as when it was detecting 25°C.

    I configured the sensor with Unico as all other times.

    Any clue?

    Visitor II
    October 4, 2019

    Hi,

    forget the previous message...now I really got!!!

    BR,

    Giorgio