Showing results for 
Search instead for 
Did you mean: 

Temperature drift LSM303AGR

Associate II

we made a compas with the LSM303AGR. it is with endusers already. the problem we encounter is that the RAW sensor values drift with temperature change. we tested fom -8C Celcius to +29C Celsius. the RAW values drift substantially. we have set the Comp_Temp_En at 1. so compensation is enabled.

is there anything else we can do to stop the drift?

kind regards, Rob

Senior II

Hi Rob, how did you perform the measure? And did you have the possibility to use a reference thermometer to check if the drift is due to the device or to environmental factors? And how many samples did you measured? Maybe the thermal inertial resistance due to the custom pcb has to be taken into account in the test, so that you have to wait that the device is thermalizing.

Maybe it's better to share a graph of your data (raw or converted units).

float_t lsm303agr_from_lsb_lp_to_celsius(int16_t lsb)
  return (((float_t)lsb / 256.0f) * 1.0f) + 25.0f;


Associate II

Hello Tom, Thanks for the reply. We measure the temperature not from the LSM303 but from a pressure sensor(MS583730BA01-50). This sensor is also located in the same housing. Since we want to measure the water temperature. The device is a compass with GPS that is used on diving scooters.

So the housing has the same temperature as the temperature of the LSM303, and stabises after some time.

I figured out that some of the drift is caused by thermal stress in the pcb. Although the sensor is at the edge of the 4 layer pcb, it still suffers from that. The EVAL 303 board is less susceptibel to this stress. From the 4 screws, I released 3 of them to have only one tight to the housing. no change.

I thought about isolating the sensor to 3 or 4 s shaped legs to encounter the thermal stress in the board. It is what is done for precision voltage references( eq LTZ1000)

but, maybe you have a better solution? Also, maybe you know other reasons that can cause this stress?

btw, we are still looking for software to calibrate the compas. We would like to have it the same way as your telephone; bij tumbling in all directions.

At the moment we use tumbling heading north in x and y. And additional we calibrate the sensor in x and y on a flat surface. We want to get rid of that step. I found a lot of software on your website, but not a complete, in C written example. Maybe you have this for us?

kind regards,


Associate II

Hello Tom forgot to answer your questions. I have three units for testing. All show the same drift problem.

I do have RAW data; I will put it in an Excel and send it. Our temperature span is only about 10 degrees for the measurements.

The working temperature is between 0 degrees C and 35 degrees C.



Associate II

herewith the raw values from -9 degrees C till +29 degreesC.

Associate II

Any response, Tom?