Skip to main content
Visitor II
November 12, 2021
Solved

fall detection process

  • November 12, 2021
  • 2 replies
  • 1522 views

Hi,

I am not getting the free-fall interrupt using lis12dh12.

configured all the register settings as per the below document, but not getting any Interrupt but I able to see the x,y,z raw values.

en.DM00500824.pdf (st.com)

please help me. not raised any fall interrupt?

Regards,

Ani

    This topic has been closed for replies.
    Best answer by Akuma.6

    Hi Eleon,

    Now I am able to get the interrupt. And with small movement also getting interrupt. please suggest a certain level of detection with some examples.

    need values to fine-tune as per our application.

    Regards,

    Ani

    2 replies

    ST Employee
    November 15, 2021

    Hi @Akuma.6​ ,

    did you already compared your code with the AN5005 application note suggested configuration for the free fall, as described in at p.26 and further?

    1. Write 57h into CTRL_REG1 // Turn on the sensor, enable X, Y, and Z
    // ODR = 100 Hz
    2. Write 00h into CTRL_REG2 // High-pass filter disabled
    3. Write 40h into CTRL_REG3 // Interrupt activity 1 driven to INT1 pad
    4. Write 00h into CTRL_REG4 // FS = ±2 g
    5. Write 08h into CTRL_REG5 // Interrupt 1 pin latched
    6. Write 16h into INT1_THS // Set free-fall threshold = 350 mg
    7. Write 03h into INT1_DURATION // Set minimum event duration
    8. Write 95h into INT1_CFG // Configure free-fall recognition
    9. Poll INT1 pad; if INT1 = 0 then go to 10 // Poll INT1 pin waiting for the free-fall event
    10. (Free-fall event has occurred; insert your code
    here) // Event handling
    11. Read INT1_SRC register // Clear interrupt request
    12. Go to 9

    You have to be sure that the ODR is high enough to detect also free fall drops from small heights, that the FS is 2g, the threshold is properly configured (e.g. 350mg), the event duration is at minimum and the interrupt is enabled and driven on the INTx pin.

    Please check all these steps.

    -Eleon

    Akuma.6Author
    Visitor II
    November 16, 2021

    Hi Eleon,

    Thanks for your response, I did the same steps and still not caught any free fall interrupt. plz find my hw portion. Is there any issue with my design to get the interrupt.

    But I am getting the xyz axis data and not free fall alert.

    0693W00000GXjlbQAD.pngRegards,

    Ani

    ST Employee
    November 16, 2021

    Hi Ani @Akuma.6​ ,

    the schematics looks correct, the SDA and SCL lines should be connected to the Vdd IO via pull-up resistors, but you might have done in another section of the schematic. Just one question: is the SA0 pint floating?

    Did you check from the raw data if you are actually crossing the free fall threshold limit? Can you share the raw data here?

    You might also try to configure the interrupt, latching it (i.e. acting on the LIR_INT1 bit of the CTRL_REG5 (24h) register), or reducing the interrupt duration from 03h to 01h or 00h.

    -Eleon

    ST Employee
    November 22, 2021

    HI Ani @Akuma.6​ ,

    this is a step further, glad to hear the improvement from your side.

    Did you changed something in you hardware or software configuration? The community will be grateful with you if you show your solution.

    The typical threshold suggested at app note level is 350 mg, meaning 16h into INT1_THS at FS +-2g.

    A fine-tuning might be required according to your application: for example, if the device is falling from a great height, the threshold can be set also lower (e.g. 200mg), since the device has more time to approach the 0g "free fall condition" on all the 3 axis.

    As side note, raw data have to be converted into physical units as shown below:

    float_t lis2dh12_from_fs2_hr_to_mg(int16_t lsb)
    {
     return ((float_t)lsb / 16.0f) * 1.0f;
    }

    -Eleon