Skip to main content
MErkc.1
Associate II
December 16, 2021
Question

Hi, I use LSM6DSO. I read raw data from sensor. How can I calculate meaningful data from raw data? I want to calculate gyroscope and acc values. I googleing it but I can't find anything. Am I read meaningful data from sensor?

  • December 16, 2021
  • 5 replies
  • 1917 views

..

    This topic has been closed for replies.

    5 replies

    KnarfB
    Super User
    December 16, 2021

    options:

    1. learn how to use Google
    2. read and understand the data sheet
    3. look for existing libraries like X-CUBE-MEMS1

    hth

    KnarfB

    MErkc.1
    MErkc.1Author
    Associate II
    December 16, 2021

    Hi, Thanks for your answer it is perfect answer. Do you tell me which part of data sheet? than I use zephyr os don't bare metal. I think you should learn how to communicate people in forum. @KnarfB​ 

    MFran.4
    Senior
    December 16, 2021

    @KnarfB​ answer may have been cold but the answer contains a lot of useful things. Did you read the datasheet? Did you understand everything you needed to understand?

    Googling can be tricky sometimes. I found this application note, look at the point 4.5, maybe it could be useful!

    https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjpmrX55Of0AhVUt6QKHdojAvcQFnoECA8QAQ&url=https%3A%2F%2Fwww.st.com%2Fresource%2Fen%2Fapplication_note%2Fdm00517282-lsm6dso-alwayson-3d-accelerometer-and-3d-gyroscope-stmicroelectronics.pdf&usg=AOvVaw2It03mShcwb7RvY2LLovew

    For the record, my google search was "lsm6dso calculate acceleration" and the Application Note was the first result.

    MErkc.1
    MErkc.1Author
    Associate II
    December 16, 2021

    Thanks, I read datasheet and application note, I read stm32duino library I found some value on library but I think it is not real value because I read 1400 value on Z acc. I finally decided to consult the forum. Maybe work with these sensor who write these topic thanks again.

    Eleon BORLINI
    ST Employee
    December 20, 2021

    Hi @MErkc.1​ ,

    you might also find useful to have a look to the LSM6DSO C drivers (lsm6dso_reg.c), where the conversion formulas from LSB to physical units are directly implemented. You have basically to multiply the LSB data for the sensitivity declared in the datasheet):

    // Accelerometer FS 2g (1g = 9.81m/s^2)
     
    float_t lsm6dso_from_fs2_to_mg(int16_t lsb)
    {
     return ((float_t)lsb) * 0.061f;
    }
     
     
    // Gyroscope FS 125dps (1dps = 1 degree per second)
     
    float_t lsm6dso_from_fs125_to_mdps(int16_t lsb)
    {
     return ((float_t)lsb) * 4.375f;
    }

    If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

    -Eleon