Skip to main content
ankushkhare89
Associate II
August 16, 2016
Question

LIS3MDL

  • August 16, 2016
  • 1 reply
  • 848 views
Posted on August 16, 2016 at 15:01

Hello folks, 

I am trying to obtain temperature value from LIS3MDL magnetometer as I need it to see the magnetic field variation based on temperature. But the temparature values are not seem to be correct. I am dividing the signed 16 bit value by 80.f. Then I am adding +25.0f as it shows 0 reading at 25 degree Celsius. But still no exact reading. Anyone tried different scaling factor for this device ?

#!stm32
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    August 16, 2016
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    keith239955
    Associate
    July 25, 2017
    Posted on July 25, 2017 at 01:28

    LIS3MDL doc says take 16 bit signed Temperature Register values, divide by 8, and add 25 degrees C.   I get a value that is always about 11.5 degrees  warmer than what the ASM330LXH on the same board is reporting, and the ASM330LXH appears to be pretty close to actual room temperature.    Is it really a 25 degree offset? or should it be 12.5 degree offset?  value 0x0057 = 87;  87/8 = 10.875;  10.875 + 25 = 35.875 degrees C = 96.575 degrees F.  It just isn't that hot in here, and the two sensors are very close to each other.