Bosch Sensortec Community

    Detecting "some" motion from flat with the BMX160

    Highlighted
    Occasional Visitor

    Detecting "some" motion from flat with the BMX160

    I am designing a wearable device and want to detect when there is "some" motion.  The device is worn by someone laying down face-up.
    I do not want to detect "breathing" (so "any-motion" (0x50) won't work since that is too sensitive), but if there was a pizza box laying on a person's stomach while lying down and the person moves such that the pizza box would fall off the person, I would want to know. In other words, if the device is no longer "flat".

    I am working with code from https://github.com/BoschSensortec/BMI160_driver

    I am confused as to which interrupt to look at.
    Should I looking at "upside" (0x65-0x66)?

    or at INT_MOTION (0x5f-0x62)?Or should I just be reading the X/Y/Z accell numbers with

    bmi160_get_sensor_data(BMI160_ACCEL_SEL, &accel, NULL, &motionSensor);  // from the MBI160_driver code.

    Must I enable 0x50 to get INT_motion? and is INT in 0x62 exclussive to the 0x50?  This spec is confusing to me.  

    Just reading accel numbers does not seem like it would do the trick. Ideally, I want to set a threshold in the X/Y/Z orientation (not accel). SOmething like int_slo_no_mot_th but for gyro, not accel.

    Are there application engineers I can hire to help resolve this in  a timely manner?  

    ANY help / pointers would be appreciated.  

    Thanks,

    -Edouard

     

    1 REPLY 1
    Highlighted
    Community Moderator

    Re: Detecting "some" motion from flat with the BMX160

    What interrupt do you want to use? 

    From your description of the requirement,  i think you can use either flat detect interrupt (BMI160_ACC_FLAT_INT) or orientation interrupt (BMI160_ACC_ORIENT_INT).  

    If you enable orientation interrupt,  you can get status from register 0x65 - 0x66. 

    Before using interrupt you need to enable it and map to interrupt pin,  which is through register 0x50 - 0x57.

    But actually,  there is already function call in the API you are currently use to take care of those setting.   You just need to call it. 

     

     

    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