cancel
Showing results for 
Search instead for 
Did you mean: 

Change ODR on SensorTile

CRoma.11
Associate II

Hello,

I programmed the sensorTile STEVAL-STLKT0V1 with ALLMEMS1 end I used STM32CubeIDE with NUCLEO32.

How I can change the sampling frequency (ODR) of accelerometers and gyroscopes?

Thanks,

Chiara

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Chiara @CRoma.1​ ,

you can try to download the FP-AI-SENSING1.

with this firmware, you should be able to set the environmental sensors sample rate using the AI data log.

there should be available only 13, 26, 52 and 104 Hz, but with it you don't have to change anything in the code.

I can also point you to this page where there are various links to start from scratch and learn how to program a datalog firmware for your board.

while this page you can find many tutorials with the same goal.

I think that the first solution is much faster, but the community is always happy to help you learning something new, if you want to learn the basics =)

Niccolò

View solution in original post

12 REPLIES 12
niccolò
ST Employee

Hi Chiara @CRoma.1​ ,

you can call the function BSP_MOTION_SENSOR_SetOutputDataRate (you can find it in the SensorTile_motion_sensors.c file) to set the ODR of your sensor before turning it on.

keep in mind that depending on which function you are using inside the application, you should call the function in different points in the program.

I hope this helps.

Niccolò

CRoma.11
Associate II

Thank you for your reply. I'm sorry but I'm new to programming. This is the screen of my program, but i didn't understand where i have to enter the sampling frequency i would like.  

I would be happy if you could help me, thank you.

Chiara 0693W00000AN9wUQAT.png

Hi Chiara @CRoma.1​ ,

I'm sorry, I answered without asking how much do you know about microcontroller programming =)

let's start from scratch: which application of the ALL_MEMS1 firmware are you using?

I mean the one you want to change the ODR of the sensors.

Niccolò

CRoma.11
Associate II

I have uploaded FP-SNS-ALLMEMS1 version 4.1.0 to my sensorTile with ST32CubeIDE. Now I have connected my sensorTile to my iPhone via Bluetooth with the ST BLE Sensor app. I have done 'data logging' and afterwards saved my data in .csv. but I would like to decide the sampling rate at which the data is saved and, if possible, also the sampling rate at which it is saved on the SD card.

I hope I have made myself clear. 

Thank you, Chiara

Hi Chiara @CRoma.1​ ,

I tried to change the datalog rate on my part but with this firmware it is not possible to easily change the rate for datalogging.

(it is organized with a timer that must be changed along with the ODR, but it is programmed to be used with seconds in between samples and would not work just by changing 2 parameters)

There is a way to use debug console to have something like 5 Hz datarate, but even that is not easy.

can I ask you which ODR were you thinking of? (you wanted low data rates like 52Hz or much higher?)

maybe I can find some other firmware that can help you

Niccolò

CRoma.11
Associate II

Thanks for the reply, I would need a high sampling rate (around 100 Hz) if possible. 

Chiara

Hi Chiara @CRoma.1​ ,

you can try to download the FP-AI-SENSING1.

with this firmware, you should be able to set the environmental sensors sample rate using the AI data log.

there should be available only 13, 26, 52 and 104 Hz, but with it you don't have to change anything in the code.

I can also point you to this page where there are various links to start from scratch and learn how to program a datalog firmware for your board.

while this page you can find many tutorials with the same goal.

I think that the first solution is much faster, but the community is always happy to help you learning something new, if you want to learn the basics =)

Niccolò

CRoma.11
Associate II

Thanks for the reply and advice. I loaded FP-AI-SENSING and it seems to work well. I have one last question, I can only save data on SD with AI dataLog? Or is there a way to save them differently?

Thanks,

Chiara

Hi Chiara @CRoma.1​ ,

the AI datalog is programmed to be save data on sd-card.

there is also the cloud logging application (just swipe right from the AI datalog) where you have to configure your AWS cloud account and you can send data there, but the ODR cannot be modified there.

Niccolò