Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BHI260AP Modify Dynamic Range of Accelerometer

    BHI260AP Modify Dynamic Range of Accelerometer

    jbarton
    New Poster

    I see a few posts on this forum about changing the dynamic range of my sensor, BHI260AP, however I do not understand how to actually implement this change. 

    This is a quote from one of the links below: 

     

    You could refer the following code to modify sensor range.
    In bhi2.c file, bhy2_set_virt_sensor_range() function support to set sensor range.
    int8_t bhy2_set_virt_sensor_range(uint8_t sensor_id, uint16_t range, struct bhy2_dev *dev)

    To set sensor range, you could call bhy2_set_virt_sensor_range() in begin().
    BoschSensortec.cpp
    bool BoschSensortec::begin()
    {
    ...
    bhy2_set_virt_sensor_range();
    ...
    }

     

    -- I cannot find a BHI2.c file, Does this mean the BHY2.c file? 

    -- I found the refered function but its within the BHY2.c file. I also am not sure what to modify or how to call the function.  SEE SCREENSHOT

    jbarton_0-1663169647104.png

    I also found the sensortec file and where the function is being called from.  SEE SCREENSHOT

    jbarton_1-1663169754959.png

    I feel quite dumb, but can someone explain this better to me? 

     

    https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/Nicla-Sense-BHI260-Is-calibration-affect...

    https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/How-to-configure-acceleration-range-of-N...

    https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bhi260ap-ds000.pdf (GO TO PAGE 149 for dynamic ranges)

     

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hi jbarton,

    The previous posts discussed how to modify the measurement range on Nicla Sense ME board, the software environment is Arduino. If you install the Arduino code of the Nicla Sense ME board, you will see bhi2. c in this directory "C:\Users\you name\Documents\Arduino\libraries\Arduino_BHY2\src\bosch" on you PC.

    For information of Nicla Sense ME, you could find it from here: https://docs.arduino.cc/hardware/nicla-sense-me

    Generally, the acceleration range is initialized once rather than set dynamically. Cou we know background information from you:
    1. Could we know your current hardware and software environment?
    2. What is your application and need to modify the acceleration dynamic range?

    I am also using the Nicla Sense ME board with Arduino IDE1.8.19. It’s a standalone device that reports back to an app I am developing through BLE.

    I will double check the pathway, I am not on my computer right now, but I’m pretty sure that’s where I was able to find the BHY2.c file. It must be the same file just one letter different in title. I don’t know how to modify this file.


    I am developing a device to track the throwing motion of a disc golf player and provide feedback to user. It’s worn on the throwing wrist, and when I am testing my design I noticed that on the y axis accelerometer I repeatedly hit the same value, 32768. I believe that to be the max for the 2g sensitivity range, that’s why I could hit the exact same value numerous times over.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi jbarton,

    According your application, you can set a range greater than 2g to retest instead of dynamically changing the range.

    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