1
\$\begingroup\$

I'm trying to read the temperature sensor from the LSM303C. I have enabled the sensor and can see the values move when the temperature is changed. But, the format of the sensor data is not provided by any data sheet or resource I can find on the web. Does anyone have this information?

Thanks in advance.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

From the datasheet:

It's 16 bits, as you can see from 8.38, and 2's complement.

enter image description here

It's in °C and the radix point is left of the 3rd bit, which you can tell from 2.2 enter image description here

So 25.0 degrees C is 0x00C8

and -40.0 degrees C is 0xFEC0

Edit: From actual experiment (see comments from OP) the °C temperature is offset so +25 must be added to get the correct temperature. That does not contradict the datasheet but adds an unexpected bias that contradicts assumptions.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you for your comments. I'm getting closer, but I do believe there is a temperature offset calibrated within the device from the factory. I have seen mention of this with other similar devices. With my device if I apply an offset of 25°C then the numbers work out as you outlined above. \$\endgroup\$
    – Glenn
    Commented Dec 16, 2018 at 16:31
  • \$\begingroup\$ I'm a little disappointed with the data sheets on MEMs that these facts are not explicitly stated. After all that is the purpose of a data sheet. Thanks again \$\endgroup\$
    – Glenn
    Commented Dec 16, 2018 at 16:32
  • \$\begingroup\$ @Glenn Yes, they don't specify that .. it's indeed very sketchy. I have seen this before where the data was only half specified. My condolences. Some datasheets are really bad. \$\endgroup\$ Commented Dec 16, 2018 at 17:44
0
\$\begingroup\$

8.38 TEMP_L_M(2Eh), TEMP_H_M (2Fh) Temperature sensor data. The value of the temperature is expressed as two’s complement.

source

\$\endgroup\$

Your Answer

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

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