cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH Activity/Inactivity detection

neil young
Associate II
Posted on May 17, 2017 at 21:36

This document

http://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:content/translations/en.CD00290365.pdf

provides information regarding an 'Activity/Inactivity recognition' on page 51ff. The section has been added in Jan 2017. I recently purchased a Sparkfun LIS3DH breakout and I cannot make this function work. Is there any pseudo code (what register has to be initialized how?)Regards

28 REPLIES 28
Posted on September 22, 2017 at 07:24

Thank you for an exceptional support. But my only concern is that if a controller is in sleep mode and I configured that threshold seeting in accelerometer then is it possible to accelerometer can send a high or low pulse to the controller GPIO pin?

Posted on September 22, 2017 at 13:05

Yes, of course the accelerometer can generate positive or negative pulse on one of the interrupt pin when the threshold is reached.

Even if you are using IIS2DH I encourage you to check application note for LIS3DH

http://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:content/translations/en.CD00290365.pdf

 especially chapter 5 and 6 about the interrupts.
Posted on October 10, 2017 at 05:38

I have done following configuration for activity/inactivity interrupt. In that, I have successfully got interrupted when a sensor is in freefall and when freefall occurs my controller goes into sleep mode for someduration of time. But my requirement is when some minimum amount of motion occurs it will give interruptto microcontrollerbecause I will use this sensorfor door open/close application. So, in that sensor is in sleep mode when the door is in the closed condition and it will interrupt when door starting to open.

I2C_WriteByte(&ctrl_1,1,0x27);

I2C_WriteByte(&ctrl_4,1,0x10);

I2C_WriteByte(&ctrl_6,1,0x08);

I2C_WriteByte(&int2_config,1,0x3F);;

I2C_WriteByte(&act_ths,1,0x50);

I2C_WriteByte(&act_dur,1,0x32);

Could you please provide proper configuration for my requirement. Thank you for your time.

Posted on November 17, 2017 at 04:20

Hi , this is really useful. But during constant motion with same velocity , acceleration= 0 right.. At that time it detects as  inactivity. Any suggestions on while accelerometer moving under constant speed ? I'm using LIS2DE12. It should n't detect inactivity while moving with constant speed. Thanks in advance. 

Posted on November 17, 2017 at 14:42

From the principle the accelerometer, measures the acceleration so if the device is moving at the constant speed the acceleration is 0 and the output of the accelerometer will be 0, you can't do anything about it. This is theory, in practice it would be difficult to move some device with exactly constant speed, so some acceleration should be measurable.

Posted on January 18, 2018 at 10:48

Hi Miroslav, I have configured activity interrupt and its duration. My requirement is to that in between activity duration of time I want to clear the interrupt on (INT2). So, is it possible to clear interrupt without time over which is configured into activity duration register? For example, If I have configured duration for 15sec of time and some activity is triggered when movement occurs than interrupt got on INT2 pin and after the sensor is stable after supposing 10sec of time at that time I want to make the sensor to sleep mode by clearing the interrupt instead of 15sec of time which is configured on the activity duration. So, how I achieve it?

Posted on January 23, 2018 at 11:22

Could you please give some solution to my previous comment for interrupt timer configuration?

Miroslav BATEK
ST Employee
Posted on January 24, 2018 at 10:45

I'm not sure that I understand you request, but you can change the duration without impact on the duration counter. So I think you request is not possible. 

Posted on June 12, 2018 at 08:30

Hello,

as usual I'm facing the very same issue but I can't seem to get the example running (the one from the link). I'm 100% that I'm transmitting the same exact configuration but I guess I'm missing something, my INT1 stays low. Is there anything else not mentioned in the article that I'd have to consider, e.g., reading REFERENCE or thelike after the configuration step ?

Thanks.M