Inquiry About Data Collection Rate Issue with KX13X Accelerometer and ESP32 Thing Plus

In a lab setup using a KX13X Accelerometer and an ESP32 Thing Plus from SparkFun to collect data, the sensor is expected to collect data at a frequency of 50 Hz (i.e., 50 data points per second) as per the documentation. However, the setup consistently records only 45-46 data points per second.

I’m looking for insights into what might be causing this discrepancy and how to achieve the expected 50 Hz data collection rate.

Any advice or suggestions would be greatly appreciated.

Hi,

Maybe try using interrupts? Also, make sure nothing else - like Serial prints - are slowing down the data collection.

I hope this helps,
Paul

If you are using interrupts to trigger data collection, there may be latency in servicing the interrupt, leading to a slight reduction in the data collection rate. To reduce latency, your interrupt service routine (ISR) should be optimized and as short as possible. If possible, handle data collection outside the ISR.