Skip to main content
Visitor II
April 25, 2019
Question

Is it possible to read outside temperature from IIO LSM6DSL linux driver ?

  • April 25, 2019
  • 6 replies
  • 1190 views

I downloaded linux driver for LSM6DSL from official ST repositiory (https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.9.y-gh ) and seems that It works as expected.

One problem is that I can't find place where I can read temperature from OUT_TEMP_ register.

Is it somewhere hidden in IIO directory structures or this is not provided (most probably - based on sources) ?

Thanks

    This topic has been closed for replies.

    6 replies

    ST Employee
    June 7, 2019

    Hi, sorry for the delay in our answer, but did you try to read OUT_TEMP_L and OUT_TEMP_H (reg 20h and 21h) in the same way the data out of the LSM6DSL imu is read? Regards

    SigmoidAuthor
    Visitor II
    June 12, 2019

    Hi,

    I managed to read temperature next day after my post :). I implemented this in similar way like reading of other properties.

    I thought that this is independent temperature sensor but these registers returns 0 in case If there is no acc/gyro "data collection" enabled.

    Anyway I was able to read temperature data but seems that it is not accurate enought.

    In tests between -40 -> 85 I noticed following difference (compared to referance LM75)

    Set: -40 LM75: -39 LSM: -48

    0 0.5 -4

    40 40 39

    85 84 86

    Right now it is not So much important for me So take this as a information only.

    Regards

    ST Employee
    June 12, 2019

    Hi, which temperature accuracy do you need? Please note that more accurate motion sensor + T feature ​will be soon released. Regards

    SigmoidAuthor
    Visitor II
    June 12, 2019

    Hi, Temperature itself (no acc/gyro samples).

    LIke you can see on my previous email temperature values are different compared to onboard LM75 chip.

    I saw difference up to 8 degrees on lower temperatures.

    ST Employee
    June 12, 2019

    ​@Sigmoid​ ​ please consider that the temperature is very dependent on the position on the board, especially if the motion sensor is nearer than LM75 t sensor reference to the more heat dissipating components (LDO, app processor...). Consider also that the T sensor embedded in LSM6DSL is not a precision sensor (the offset declared at datasheet is +-15°C!). Btw, a pretty new class of motion + T sensor with higher accuracy -comparable with LM75 one- is available (example here). Regards

    SigmoidAuthor
    Visitor II
    June 12, 2019

    Hi, I know all things that you mentioned here,

    Thanks for suggestion.