2018-01-29 12:55 PM
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
#lis3dsh2018-01-30 01:30 AM
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.
2018-06-12 05:36 PM
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
2018-06-19 02:31 AM
I would recommend you to measure real output data rate using DRDY signal, which you can connect to a timer in you microcontroller.
2018-06-28 11:53 AM
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.
2018-07-06 06:42 AM
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.