cancel
Showing results for 
Search instead for 
Did you mean: 

fall detection process

Akuma.6
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

6 REPLIES 6
Eleon BORLINI
ST Employee

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

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

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

Hi Eleon,

Thanks for your observations.

Pull-up is ok from our MCU end. Yes SA0 pin is floating not connected this line anywhere.

I am getting the XYZ raw data and seen the static to movement and movement to static.

But using with this XYZ RAW data can we implement the free fall? and i will provide the register value and raw data in next mail.

CTRL_REG5 (24h) register configured with 0x08 value and I tired interrupt duration 00, 01, 02, 03 and 2g/4g tested but no luck.

Regards,

Ani

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

Eleon BORLINI
ST Employee

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