2020-06-05 03:24 AM
Solved! Go to Solution.
2020-06-11 12:51 AM
Uhm... so basically the temperature increases correctly but it is always 4/5°C below the effective ambient temperature, right? For example, if outdoor is 34°C, the sensor will read 30°C? and same for negative temperatures?
Please note that the Toff (the temperature offset, is declared to be between -15°C and +15°C, so 4/5°C falls in this range. If your offset is constant, you can add it to your Temperature data via SW and apply it to all the temperature range of your interest.
Regards
2020-06-05 03:31 AM
Hi @tpham.1 , you can find details on the temperature reading conversion from lsb to celsius on the online available github C driver repository for the LSM6DSM.
float_t lsm6dsm_from_lsb_to_celsius(int16_t lsb)
{
return (((float_t)lsb / 256.0f) + 25.0f);
}
In your case:
--> FFFBh --> -4dec (two's complement conversion) --> -0.016 °C (divide by 256) --> 24.984°C (sum 25°C)
Regards
2020-06-10 06:59 PM
Thanks Eleon BORLINI so much,
I found that internal LSM6DSM temperature always lower than ambient about 4-5 °C.
Is it expected?
regards,
Tuyen
2020-06-10 11:59 PM
Hello Tuyen, no, it is not normal... but if you heat the device (for example with a finger), do you experience a temperature increase above 25°C? (it is important to see 00h or 0xh values instead of FFh in OUT_TEMP_H register) Regards
2020-06-11 12:25 AM
Hi Eleon,
I put it outdoor and saw that it can increase to 30-31°C. If you said it is not normal then any special setting when using internal temperature? value of OUT_TEMP_H always 0xFF
I almost hadn't setting, just write ODR to CTRL1_XL to using accelerator
thanks,
Tuyen
2020-06-11 12:51 AM
Uhm... so basically the temperature increases correctly but it is always 4/5°C below the effective ambient temperature, right? For example, if outdoor is 34°C, the sensor will read 30°C? and same for negative temperatures?
Please note that the Toff (the temperature offset, is declared to be between -15°C and +15°C, so 4/5°C falls in this range. If your offset is constant, you can add it to your Temperature data via SW and apply it to all the temperature range of your interest.
Regards
2020-06-11 01:02 AM
Uhm... so basically the temperature increases correctly but it is always 4/5°C below the effective ambient temperature, right? For example, if outdoor is 34°C, the sensor will read 30°C? and same for negative temperatures?
--> YES
My purpose is read internal temperature to compensation temperature for raw data accelerator X, Y, Z.
My question is: do I need offset to equal temperature environment or not?
thanks,
2020-06-11 01:06 AM
>> My question is: do I need offset to equal temperature environment or not?
Yes, the temperature to be used is the environmental temperature.
Regards
2022-03-30 10:53 PM
Hi, I am using the sensor lsm6dsl for reading ambient temperature. I am reading registers OUT_TEMP_L (20h), OUT_TEMP_H (21h). I got the a range of 08 - 0e while reading OUT_TEMP_H and got various values while reading OUT_TEMP_L. I calculated the actual temperature by concatenating the values OUT_TEMP_H and OUT_TEMP_L, Then converted to decimal from signed 2's complement, then divided the value by 256. then added +25. I am getting an output temperature value is +10 more than the actual temperature value. I read from the characteristics temperature offset value can be -15 deg C to +15 deg C, But even what could be the reason for a changes of +10 between reading ambient temp value and sensor temp value.