cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DSH sample rate accuracy

Stathis Voukelatos
Associate II
Posted on January 29, 2018 at 21:55

Hi there,

Is there any spec on how accurate the sample rate of the LIS3DSH accelerometer is? In our application we configure the module to sample at 1600 Hz and apply to it vibration of a known frequency. However, after performing some frequency analysis on the accelerometer output samples, the measured frequency seems to be a few Hz out from what was expected. As an example the measured frequency content would correspond to a sampling frequency of 1660 Hz, rather than 1600. However, that drift is variable from one device to the other. Is that variability something that is expected?

Thank you,

Stathis

#lis3dsh
5 REPLIES 5
Miroslav BATEK
ST Employee
Posted on January 30, 2018 at 10:30

Unfortunately the accuracy of sample rate is not specified.

Yes, there will be an inaccuracy, so your observation is expected.

I would recommend you to measure real sample rate by using data ready signal and a timer in your microcontroller.

Knut Odman
Associate II
Posted on June 13, 2018 at 02:36

Hi, sorry for the bump, but I have the same issue. I'm using LSM6DS3 connected over SPI.

I'm setting ODR to 1660 Hz

My application needs an accurate sample timing since the output is used for spectrum analysis.

By reading the CPU clock at the time I got the first sample in FIFO_STATUS and at the time 

I got all the samples I require, I can estimate the sample rate varies between 1704 and 1706 Hz.

On another 

LSM6DS3 chip with identical hw and sw I get between 1713 and 1714 Hz.

By using a vibration source with known frequency I can deduce that the actual sample rate is

closer to 1720 Hz.

Assuming there is no way to control the actual sample rate, what is the most precise way to

measure it? My method of estimating of course also introduce inaccuracy due to software 

execution, bus communication, etc. While these are minimal, I can tell from the variations in

estimated sample rate that it's not a precise enough method. What to do?

thanks

Knut

Posted on June 19, 2018 at 09:31

I would recommend you to measure real output data rate using DRDY signal, which you can connect to a timer in you microcontroller.

Knut Odman
Associate II
Posted on June 28, 2018 at 20:53

Thanks Miroslav,

I did what you suggested and got 1723 on one chip and 1732 on the other, so no it fits much better with my math.

If anyone else is interested, you have to read on the direct output registers, not the FIFO. Make sure the interrupt from the accelerometer has a high priority (or that nothing else is running) and you can timestamp each read to for instance your clock cycle counter in the CPU. I do 1000 reads at bootup to get a good average. If your environment has significant temperature changes you might have to run the calibration again for the new temperature. I haven't looked into that.

chaitanya chippada
Associate II
Posted on July 06, 2018 at 15:42

Hi ,

I am using LIS3DSH for my project, there is any way to increase data samples per second ,more than 1600 samples per second by increasing I2C clock from 100kHz to 400 KHz. or we can use SPI for for getting more data samples.

I am having one doubt like we can interface two LIS3DSH sensors we can interface on I2C simultaneously with raspberry 3b plus board,if we can do ,how to do ?

waiting for your reply,

Regards,

chaitanya.