Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Detecting "some" motion from flat with the BMX160

    Detecting "some" motion from flat with the BMX160

    Occasional Visitor

    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

    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.  




    1 REPLY 1

    Community Moderator
    Community Moderator

    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.