cancel
Showing results for 
Search instead for 
Did you mean: 

L3GD20H Motion Sensor

PCote
Associate

Hello,

I am using the ​L3GD20H Motion Sensor for flight application and I need to compensate for temperature variation. There is a registry that I can read that provides a temperature value. Could you tell me what this value means and what it is referenced to? At 22C the value is 5, when I freeze the chip the value is around 14. How is this value used to correct the reading as a function of temp?

Regards,

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi Patrice, please consider the L3GD20H C drivers from the Github repository:

float32_t l3gd20h_from_lsb_to_celsius(int16_t lsb)
{
  return ((float32_t)lsb +25.0f);
}

consider also that from ds the sensitivity is -1LSB/°C... When you "freeze" the component, are you going below 0° celsius? Which is the specific purpose of your application? Regards

PCote
Associate

​Hello Eleon,

The application is Stratospheric balloons. The balloon is launched from ground to approx. 40 km altitude. The balloon will go thought areas where there is a temperature variation from 20C to -60C. However the module will be placed inside case surrounded by processors so It is estimated that the ambient temp will be around -15C. Not less that -30C.

it seems that I multiply the value by -1 and add 25C to it. But the value I read does not seem to have decimals. It is 5.0, 6.0, 7.0 etc..... So converting to float does not really do anything except data type compatibility.

Also it is not obvious how to apply it to the Angle rate for temp correction. I checked Table 3 of the datasheet and it says OffDr = +- 0.04 dps/C.

I can remove the bias via averaging on the ground but I would need to ability to correct for temp.

Patrice

Eleon BORLINI
ST Employee

Hi Patrice,

>> But the value I read does not seem to have decimals. It is 5.0, 6.0, 7.0 etc.....

This because the sensitivity is 1°C/LSB, so you cannot have a decimal part. The (float32) cast type is related to the FW management of the variables, because the temperature could be a float (even though not in this specific case).

>> Also it is not obvious how to apply it to the Angle rate for temp correction

Consider that the drift offset vs Temperature in the datasheet is not a fixed value that can be directly applied to compensate the sensor output, but is an average on some characterization parts. To have a precise idea of a specific part behavior, you should characterize it before embedding it in the application.

Regards