Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    How to analyze the data of BMI270

    Eason
    Member

    How to analyze the data of BMI270

    Hallo everyone

    I have obtained the originaldata from BMI270, but  these data are not processed. How to convert these data into data with standard units. For example: m/s^2  (accelerometer) and rad/s (gyroscope).

    Thank you very much.

    Accel_xAccel_yAccel_zGyr_xGyr_yGyr_z
    19-42616660141
    10-42116646141
    2-43816671231
    205-5801667503-22
    -81888917469131-537-128
    2022-59116579333-93778
    3457151117143961-97177
    2104444715315849173-113
    -1136224156043838805
    -1441498015571-2761401-454
    -3889420614484-785900-792
    -600177216052-1714-758-587
    -3700-40216576-1230-909-234
    -3414-373817029-896-1380127
    1718-284216151836-904189
    2032787185601090-179217
    1 REPLY 1
    BSTRobin
    Community Moderator

    Re: How to analyze the data of BMI270

    Hello Eason,

    There were example code in github.

    For accelerometer,  you could example file "https://github.com/BoschSensortec/BMI270-Sensor-API/blob/master/examples/bmi270/accel/accel.c".

    /*!
    * @brief This function converts lsb to meter per second squared for 16 bit accelerometer at
    * range 2G, 4G, 8G or 16G.
    */
    static float lsb_to_mps2(int16_t val, float g_range, uint8_t bit_width)
    {
    float half_scale = ((float)(1 << bit_width) / 2.0f);

    return (GRAVITY_EARTH * val * g_range) / half_scale;
    }

    For gyroscope, you could example file "https://github.com/BoschSensortec/BMI270-Sensor-API/blob/master/examples/bmi270/gyro/gyro.c".

    /*!
    * @brief This function converts lsb to degree per second for 16 bit gyro at
    * range 125, 250, 500, 1000 or 2000dps.
    */
    static float lsb_to_dps(int16_t val, float dps, uint8_t bit_width)
    {
    float half_scale = ((float)(1 << bit_width) / 2.0f);

    return (dps / ((half_scale) + BMI2_GYR_RANGE_2000)) * (val);
    }

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist