Improve sample rate of MLX90393 sensor with SPI

Hello, I'm trying to improve the sample rate of the MLX90393 sensor with ARDUINO. The safe highest sample rate is about 500Hz according to the datasheet.

However, I use Bluetooth to connect to the sensor with SPI protocol and read the sensor using Python language, the highest sample rate I obtain is about 100Hz when I set the FILTER to 2 and OSR to 0.
Also, if I use wire to read the sensor, the sample rate will reach about 300Hz in Serial Monitor, however, if I use the PySerial package in Python to read the sensor and the sample rate decreases to 70~80Hz. I think the reason may be the read speed of PySerial is slow?

Hence, I'm wondering how to improve the sample rate of MLX90393. I want to use the Burst Mode provided by the MLX90393 code, but I can't find the proper arduino code, anyone can help me?
Thanks a lot!

Your code is the limiting factor. If you are printing every sample, that is very slow. So is an interpreted programming language.

Thank you a lot!
But I need to get every sample for analysis, how can I do this with a higher sample rate? Right now I use bleak in Python to connect to the sensor with BLE, I agree with you that the code is the limiting factor, how can I improve it?

Use C/C++ instead of Python and an appropriate means of data transmission to the host (absolutely not BLE), or do the calculations locally.

The sensor supports I2C and SPI, with SPI being the fastest, so that will not be limiting.

Thank you a lot!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.