1
\$\begingroup\$

I am using a LIS3DHH. It is an accelerometer but has a temperature sensor inside as well. It is read out using SPI interface. I believe that I have followed the boot sequence properly and am storing the data correctly. However, some things do not make sense. One of these is the temperature sensor reading.

The temperature sensor characteristics are contained in section 2.3. The temperature value is read out from address 25 and 26. The section 7.7 discusses these registers. It can be seen that the lowest four LSBs are all zero permanently so that the temperature reading itself comes to 12 bits rather than 16 bits.

The 16-bit reading I am getting is 0xFEC0. The table 23 says that "The value is expressed as two's complement sign. 0 LSB represents T=25degC ambient".

The 0xFEC0 I am able to read out is -320 in two's complement. If I divide this by 16 I get -20. Both of these are far from the room temperature. What is going on here?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

-20°C is your offset to the temperture at 0 LSB, which is 25°C. So your reading actually means +5°C.

Notice how the specs in section 2.3 only guarantee an accuary of \$\pm 15°C\$. If you want to have a more accurate reading you will have to do some calibration yourself (read the value at a known temperature and correct for the offset in software).

The temperature sensors on these IMUs are there only to correct drift over temperature. This does not require them to be accurate, so they are not calibrated. I assume adding them comes with basically no additional cost in manufacturing, so they just throw them in. But a calibration would be quite some additional cost.


I actually was wondering myself some time ago if the temperature accuracy is really that bad and wrote an email to the support team of ST. This was their answer:

The embedded temperature sensor can be used to perform an external temperature compensation (when it’s not necessary to have a very accurate absolute temperature value but only regarding the relative accuracy). About your question, yes, you are right. In case you need to measure environmental temperature more accurately, I can recommend using one of our temperature sensors.

\$\endgroup\$
2
  • \$\begingroup\$ I would be grateful if you could describe a bit about the correct drift over temperature part as well \$\endgroup\$
    – quantum231
    May 9, 2021 at 14:20
  • \$\begingroup\$ If you really need temperature stabilized operation you could measure the sensor behaviour over temperature range. The datasheet only gives a range of \$\pm 0.4mg/°C\$. If you have the drift data, you can compensate that in your system with the data from the temperature sensor. But this requires you to measure your system behaviour over temperature, so not sure how often this really is used... \$\endgroup\$
    – jusaca
    May 9, 2021 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.