Skip to main content
Visitor II
May 3, 2021
Solved

Change ODR on SensorTile

  • May 3, 2021
  • 7 replies
  • 3312 views

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

    This topic has been closed for replies.
    Best answer by niccolò

    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ò

    7 replies

    ST Employee
    May 3, 2021

    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.11Author
    Visitor II
    May 3, 2021

    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

    ST Employee
    May 3, 2021

    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.11Author
    Visitor II
    May 3, 2021

    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

    ST Employee
    May 3, 2021

    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.11Author
    Visitor II
    May 3, 2021

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

    Chiara

    niccolòAnswer
    ST Employee
    May 3, 2021

    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.11Author
    Visitor II
    May 3, 2021

    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

    ST Employee
    May 4, 2021

    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ò

    CRoma.11Author
    Visitor II
    May 4, 2021

    Thank you very much for the useful advice. 

    Best Regards,

    Chiara

    ST Employee
    May 4, 2021

    @CRoma.1​ 

    you're welcome =)

    just as a reminder, if you "select a best answer" in this thread you can help other community members with a similar question

    Niccolò

    Visitor II
    April 3, 2023

    Good Evening,

    I have the same problem as Chiara. I would set a sample rate of 100Hz or higher. If I wanted to modify ALLMEMS1 firmware to do that (perhaps telling that from the app and saving results on the SensorTile SD ), how would I do?