It’s right to use the generic interrupt to detect the shock.
To make sure all the shocks from normal movements can be detected, you need to
Collect raw acceleration data and find the differences between normal movements and shocks.
Configure the parameters of the generic interrupt for shock detection. First, you need to check how short the shock will be, and then select the suitable ODR. At a higher ODR, you can define the sampling duration as more than one sample.
To prevent missing detection, you can try with lower reference, for example, ref= 0g, threshold = 2g (max_value@16g_range), and duration = 3~10 samples (depending on the ODR setting).
With this configuration, the detecting formula is:
actual_acc- 0g > threshold(2g) (@3~10samples).
So, the range of detection is (-16g, -2g) and (2g, +16g).
The generic interrupt system can operate at 800Hz, but it can significantly consume higher current, and perform more calculations per second.
When When the BMA400 is configured to the 16g range, the detection range is max. 16g, the higher acceleration will be saturated to +/-16g, and the calculation of generic interrupt will take +/-16g into consideration.
... View more