Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMA253 principe of interrupt for any-motion detection

    BMA253 principe of interrupt for any-motion detection

    SoufienK
    Member
    Hi Bosch Sensortech Community,
     
    I am working with the accelerometer BMA253.  My aim is to understand how to compute activity from the interrupt.
     
    I will go for with two cases to clearify my aim and, finally, to understand the any-motion detection.
     
    Let's say we have  the Acceleration measurement range equal to +/- 4g and the "slope_th" equal to 5 LSB and the "slope_dur" equal to 2. We start with the accelerometer on table in a rest position. We make one and only one mouvement during 1000mS and then we return to rest position. We suppose that this move creates a slope on Z-axis higher than the threshold for 320 mS and then the slope becomes lower than the threshold. Let's work with the two following scenarios :
     
    • scenario 1  with bandwidth 7.81Hz (or Update Time equal to 64 ms) : for this scenario, we have the number of the slope samples, that are higher than the threshold, are 5 (the result of 320 ms divided by 64 ms is equal to 5). How can I do to get an integer equal to 5 ?
    • scenario 2  with bandwidth 15.63Hz (or Update Time equal to 32 ms) : for this scenario, we have the number of the samples of the slope, that are higher than the threshold, are 10 (the result of 320 ms divided by 32 ms is equal to 10).How can I do to get an integer equal to 10 ?
    Thanks
    4 REPLIES 4

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thank you for your question. BMA253 slope (or any-motion) interrupt uses the difference between two successive samples as input, which is the current sample minus the previous sample, the next sample minus the current sample, etc. When the difference or slope is beyond the slope_th threshold for the amount of slope_dur duration, the slope interrupt will be triggered. Once the condition is no longer valid, the slope interrupt will be cleared automatically.

    For example, if you set slope_th to 5 LSB at +/-4g range, then it means the slope_th threshold is 5*7.81 = 39.05mg. If you set slope_dur to 2, then it means there should be 3 samples of the difference go beyond the slope_th in order to generate the slope interrupt. If you use 7.81Hz or 15.63Hz bandwidth, then it will be very difficult for BMA253 to generate slope interrupt. You should use 1000Hz bandwidth and/or change slope_dur to 0 meaning that whnever there is one sample of the difference goes beyond the slope_th, the slope interrupt will be generated.

    In addition, the slope interrupt is sensitive to tapping motion, hitting motion or fast shaking motion, etc. If you wave the device in the air slowly, then you won't be able to see the slope interrupt because the difference is not too much. What you can do is monitor the rising edge or falling edge of the slope interrupt signal on one of the two interrupt output pins to count how many times the slope interrupt has been triggered.

    Hi,

    I am thankful for your reply and your suggestions.

    As far as I know, the any-motion interrupt has one, and only one, output which is "slope_int". The"no_slope_int" is based on other parameters than those used for the any-motion interrupt.

    When you mentionned the "rising edge" or the "falling edge", does it seem possible to check the state of the interrupt for each new acceleration sample (for  each of the three axis) ? If yes, do I need to apply a timer, before monitoring the rising/falling edge, to wait that the interrupt output will be updated fo this new sample ?

    Thanks !

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Yes, any-motion (or slope) interrupt has the slope_int output. No-motion interrupt also uses the difference of two successive samples as input. But the logic is opposite compared to any-motion interrupt. When the differences are within the slo_no_mot_th threshold for the amount of duration time slo_no_mot_dur, then no-motion interrupt will be triggered. If any-motion event happens before the no-motion duration ends, then the no-motion duration timer will get reset and will start counting again as long as the difference is within the threshold again.

    Back to any-motion interrupt, when the difference goes beyond the slope_th for the number of (slope_dur+1) samples, then slope interrupt will be triggered. If you map this interrupt to INT1 pin or INT2 pin, then the signal on that pin will go high. If the condition is no longer valid, the signal will go low automatically. This is so called rising edge and falling edge. However, counting the number of slope interrupts is not that helpful for real applications, because single even may trigger multiple pulses of the slope interrupt signal.

    Please let us know what you really want to achive. We then may be able to give you more helpful suggestions. Also please let us know your email address and where you are located.

    Thanks.

    Hi,

    Thank you for your reply. I understand better the any-motion process.

    I put my email address and my location within my profile.

    In fact, I would like to get more information about the movement that triggered the interrupt. One of the potential information, it could be the time duration of the movement. In my case, the value "slope_dur" is not higher enough because the human movements, like a step or stride, stayed longer than "4 samples" duration. Therefore, I want to compute the number of samples while the interrupt stayed High between a rising edge and the following falling edge. Such feature will help me to monitor the daily activity of a user of the accelerometer.

    I understand the risk behind the presence of "a single event that may trigger multiple pulses of the slope interrupt signal". However, event with multiple pulses could be filtered thanks to the parameters, like "slope_th" (i.e. a higher value can reduce the probability that random events trigger the interrupt) , or to the post data processing through some conditions on the time duration of the movement.

    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