LSM303DLH data jitter

Hi all,

I am using the LSM303DLH breakout board, I am attempting to use the device as an electronic tilt compensated compass. I think I have gotten good communication going, I am getting changing data from both sensors on 3 axis.

My question is; how much jitter should one expect from this unit? If the unit is motionless on a table top (ie level), all axis data seems to jump a bit - consecutive reads are different, the readings seem to jump about 15% (ax: range 27-33; ay: range 13-17; az: range 1007-1015; mx: range -165 -175; my: range 360-368 mz: range -545 - -560) I have configured the unit as the ST application note AN3192 (Acel 50Hz, +/- 2 Gauss, Mag 30Hz, +/- 1.3 Gauss). I am getting the readings and variations when reading the registers at 2Hz (ie once every 1/2 second).

I HAVE compensated for the fact that the Accel data is left shifted 4 bits (gee, thanks ST for NOT putting that little tidbit in the data sheet) :frowning:

Is this jitter normal for a motionless unit? Should I be reading the unit close to the configured Hz (ie 30 Hz) and then average ~30 readings to give an averaged (and hopefully smoother) output every 1 second?

Thanks for any help.

It’s pretty typical to get 3-5 bits of variation either way in these sensors even if they aren’t moving. If you sample at a higher rate and plot a histogram of the output it’ll look pretty Gaussian. Averaging the data or applying a low pass filter will smooth it considerably, but introduce some lag to the desired output.


OK, just wanted to make sure the jitter was normal - there does not seem to be a lot of discussion about the subject, so I was wondering if my data was somehow corrupted.

I actually already implemented a simple averaging filter which settled the readings quite a bit. My goal is when this unit is stationary, the heading reading should not waver when showing heading (down to nearest whole degree). I know the data sheet says accuracy of 2 degrees, but I think I am talking repeatability here, and I am not sure if the datasheet actually addresses that.

I guess my next step is to convert the (somewhat jittery) raw data to heading direction and see if it has stationary jitter below my desired 1 degree (I am not yet sure how the 3 - 7 bits of raw data jitter will translate to heading jitter, need to work the math first…)

If I need to settle the data more, I already have a idea of how to implement a VERY rough Kalman filter… (it is kind of a joke that I would even use that term…

Anyhow, thanks for your post.