Hello,
I am having a problem with achieving sampling rate more than 40 s/s while using https://circuitpython.readthedocs.io/pr ... -rate-test, suggested acceleration data rate test for ICM20948 sensor.
Could you please provide me suggestions how to achieve expected results of 1000 s/s that is claimed to be possible?
Thank you for your support.
Sample rate
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Sample rate
The output data rate of the sensor is the rate at which it generates readings and updates its registers. That is independent of the frequency at which your code polls those registers. To speed up your poll rate, you can eliminate things like print and sleep statements inside your polling loop. The Python language also has significant overhead. Faster poll rates are likely possible using the Arduino IDE (C++).
- Matr777
- Posts: 5
- Joined: Fri Aug 27, 2021 9:11 am
Re: Sample rate
Hello,
thank you for your reply and suggestions and when I eliminate print and sleep I can see it is recording data as it should.
If you please can suggest me how to print and display sensors registers?
thank you for your reply and suggestions and when I eliminate print and sleep I can see it is recording data as it should.
If you please can suggest me how to print and display sensors registers?
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Sample rate
That depends on the requirements of your application.
One approach is to collect data as fast as possible to an array and print that out later. That limits the number of samples to the available memory in the processor you are using.
Another way is to write the data to an SD card and print it out later. That will increase your logging capacity, but you will have some periodic delays for writing to the card.
And a third approach is to send the data via serial - but in binary format instead of ASCII. That will allow continuous monitoring - but will require some code on the other end to decode the binary data.
One approach is to collect data as fast as possible to an array and print that out later. That limits the number of samples to the available memory in the processor you are using.
Another way is to write the data to an SD card and print it out later. That will increase your logging capacity, but you will have some periodic delays for writing to the card.
And a third approach is to send the data via serial - but in binary format instead of ASCII. That will allow continuous monitoring - but will require some code on the other end to decode the binary data.
- Matr777
- Posts: 5
- Joined: Fri Aug 27, 2021 9:11 am
Re: Sample rate
Thank you a lot for your help!
Best regards :D
Best regards :D
Please be positive and constructive with your questions and comments.