cancel
Showing results for 
Search instead for 
Did you mean: 

how to understand the LIS3DH temperature reading

satyajit2
Associate
Posted on June 02, 2015 at 18:20

I have an application using the LIS3DH.  I need to read the values from the on chip Temperature Sensor.  I have properly setup the ADC_PD and TEMP_EN bit in the TEMP_CFG_REF (1Fh).  I'm reading the OUT_3_L (0Ch) and OUT_3_H (0Dh) at an ODR of 50 Hz.  The OUT_3_L seems to be random while OUT_3_H looks like valid data.  Three different chips measure (OUT_3_H)  as follows FA, F6 and FE.  This translates to -6, -9 and -2.  The Datasheet describes the TSDr as Temperature sensor output change vs temperature with a resolution of 1 digital/C.  So my assumption is that the translated values of -6, -9 and -2 are delta (changes) from some reference temperature (possible at MFG calibration).  The ambient temperature in the room is 23 C (~73 F).  My assumption per Datasheet was that the reference temperature is 25 C but this only correlated to the 3rd value.  Is there a reference temperature that is different in each chip? Is there a way to access this reference temperature? Possible in one of the reserved addresses?

Thank you,

#temperature-sensor #lis3dh
12 REPLIES 12
satyajit2
Associate
Posted on June 23, 2015 at 16:00

** BUMP **

Does anyone from ST look this forum? Anyone have information regarding my question?

zsolt2
Associate
Posted on April 01, 2016 at 15:02

Dear ketkar.satyaji,

Have you managed to solve the problem?

I have very a similar problem, but I always read out 0 from the OUT3_L/H registers.

Chip seems to be configured properly, because other registers of the accelerometer (e.g. X, Y, Z parameters )gives good values.

regards,

Zsolt

deval
Associate
Posted on June 21, 2016 at 18:49

Hi ketkar,

I am using lis2dh. If you know then can you please tell me how to convert temperature raw data to actual temperature. I didn't find this info in datasheet.

Is there any formula for this?

Thanks..

Miroslav BATEK
ST Employee
Posted on July 11, 2016 at 09:14

The temperature sensor can be used to measure temperature variations. It isn't suitable to return absolute temperatures measures. 

The value represents difference respect to a reference not specified value.

Do following to correctly work with temperature sensor:

- enable the bits 6 and 7 in TEMP_CFG_REG(1Fh): enable aux ADC and enable temperature sensor.

- enable Block Data Update, BDU, feature. CTRL_REG4(0x23) , BDU (bit#7)=1.

- read both the ADC output 3 registers (because of BDU enabled): OUT_ADC_3_L(0x0C) and OUT_ADC_3_H(0x0D).

Data representation: 2's complement.

Useful bits: 8, left aligned, hence useful data in OUT_ADC_3_H.

Temperature sensor output change vs temperature: 1digit/degrCelsius

Best regards

Miroslav

wittaya190
Associate
Posted on November 09, 2016 at 16:22

Finally it starts to make sense to me.

I also use the LIS3DH and trying to understand the temperature reading from OUT_ADC3_H (0x0D).

You may need a heat source to heat up the sensor to see the changes of the reading from OUT_ADC3_H.

Here is the scenario:

 -my initial reading from OUT_ADC3_H get a value 0xFA (translated to -6)

 -consider this -6 value as a relative indicator of the temperature at the time of the reading.

  assuming your ambient temperature was 24degree C.

 -heat up the LIS3DH sensor with your choice of heat source.

 -reading the OUT_ADC3_H again and you will see the new value goes up.

 -each 1 degree C rise in the LIS3DH temperature will increment OUT_ADC3_H value by 1.

 -ie, if a person apply a heat source and risen the LIS3DH temperature 10 degree C higher,

  the OUT_ADC3_H will now give a new reading of 0x04 (-6+10=4). (The sensor is now 34 degree C)

 -after cooling the sensor back down to the ambient temperature,

  the OUT_ADC3_H will again give 0xFA (-6)

 

 -According to ketkar.satyajit,

 each chip may give different reading from the OUT_ADC3_H even from the same temperature.

 Unfortunate, that's why the LIS3DH is not referenceing the reading to any fix reference.

 

 Anyway, Happy Programmming.

 Best regards,

 Witt

Posted on October 26, 2017 at 09:00

when  LIS3DH is in room temperature condition(about 20°C), temperature variation data from the LIS3DH is as below:

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

temperature viriation is: -2,

if '

temperature variation' is the

Comparison results

 (current temperature to a base temperature)? if the value -2 represent the temperature variation compared to the last time , then -2-2-2....-2  equal to a very large value . then what is the base temperature? why the 

temperature variation of my sensor is so much while the ambient temperature is about constant?

Posted on October 26, 2017 at 10:01

The temperature sensor can be used to measure temperature variations. The output value represents difference respect to a reference not specified value.

So it is not variation compered to the last measurement. The base temperature is not known, you would have to do a calibration for each device.

Lats say the base temperature for your device is 25°C, so your measurement is 25 - 2 = 23°C 

Posted on October 26, 2017 at 10:10

Thanks a lot!!!

Posted on October 27, 2017 at 00:49

Then what is the purpose of the embedded temperature device ?