cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH Raw output to Temperature conversion

BBQ
Associate II

I saw below topics.

How can i see discussion 71915817?

***

The datasheet doesn't specify how to convert register (OUT_TEMP_L (0Ch), OUT_TEMP_H (0Dh) ) data to actual temperature. 

let's say for example if reg 0x0c = 0x7 value and reg 0x0d = 0x00 value, then what will be the temperature.

https://community.st.com/s/question/0D50X00009XkeF4SAJ/lis2dh-raw-output-to-temperature-conversion

***

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @BBQ​ ,

I suggest you to check the C drivers on Github for the LIS2DH --> lis2dh_reg.c

  • For the Normal mode:
float_t lis2dh_from_lsb_nm_to_celsius(int16_t lsb)
{
  return (((float_t)lsb / 64.0f) / 4.0f) + 25.0f;
}
  • For the Low power mode:
float_t lis2dh_from_lsb_lp_to_celsius(int16_t lsb)
{
  return (((float_t)lsb / 256.0f) * 1.0f) + 25.0f;
}

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon

View solution in original post

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @BBQ​ ,

I suggest you to check the C drivers on Github for the LIS2DH --> lis2dh_reg.c

  • For the Normal mode:
float_t lis2dh_from_lsb_nm_to_celsius(int16_t lsb)
{
  return (((float_t)lsb / 64.0f) / 4.0f) + 25.0f;
}
  • For the Low power mode:
float_t lis2dh_from_lsb_lp_to_celsius(int16_t lsb)
{
  return (((float_t)lsb / 256.0f) * 1.0f) + 25.0f;
}

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon