Bosch Sensortec Community

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

    BHI360 built in sensor

    BHI360 built in sensor

    Newguy
    New Poster

    Hello, I am currently using BHI360 to extract aceleartion to get velocity and distance, and I have been processing readings from linear accelerometer using average and LP and HP filters as can be seen in the file below.

    I have heard that there are built-in filters in Bosch's library, but I haven't found any library in C that I can instantly use. Can anyone point me to where or how I can use these filters in a C environment?

     

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Newguy,

    BHI360 has a built-in algorithm that outputs sensor data and algorithm results to the host in FIFO format. For a detailed description, please refer to Section "15 FIFO Data Type and Format" in data sheet.

    I don't see mentions of a filter implementation, so I am moving towards using accelerometer correct data.
    But when I run BHY2_SENSOR_ID_ACC using this c file (I just changed the sensor name on line 167, 191, 193), it outputs uncalibrated data, which I found by reading META event.

    Newguy_0-1709238858559.png

     

    Is there a way to have the sensor calibrated before output data?

    Additionally, I would prefer a way to have the sensor calibrated without having to go through the calibration process for a 6 axis accelerometer, where you have to rotate the sensor to certain positions.

     

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Newguy,

    BHI360 fw has not disclosed any implementation of filters. But you can obtain different data through different virtual sensor IDs.
    BHY2_SENSOR_ID_ACC is the virtual sensor ID that has been calibrated for acceleration data.

    You can find the code annotation in bhy2_defs.h
    #define BHY2_SENSOR_ID_ACC_PASS UINT8_C(1) /* Accelerometer passthrough */
    #define BHY2_SENSOR_ID_ACC_RAW UINT8_C(3) /* Accelerometer uncalibrated */
    #define BHY2_SENSOR_ID_ACC UINT8_C(4) /* Accelerometer corrected */
    #define BHY2_SENSOR_ID_ACC_BIAS UINT8_C(5) /* Accelerometer offset */

    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