cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3MDL

ankushkhare89
Associate II
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
2 REPLIES 2
Posted on August 16, 2016 at 15:10

The documentation says it reports in Celsius and it is divided by 8.0

http://www.st.com/content/ccc/resource/technical/document/datasheet/54/2a/85/76/e3/97/42/18/DM00075867.pdf/files/DM00075867.pdf/jcr:content/translations/en.DM00075867.pdf

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
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.