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 May 22, 2017 at 14:11

The status of the activity/inactivity is not available in the 

INT2_SRC register or any other register.

In my trial, I was monitoring the INT2 pin.

Posted on May 22, 2017 at 14:13

OK, did the same. No movement. Will try again. What do you think about my code? Looks OK to you?

Posted on May 22, 2017 at 14:38

Your code seems OK to me.

I have got an information that the activity/inactivity feature is in the sensor since beginning, but was not fully tested in the past, so on old devices this function is not guaranteed.

Posted on May 22, 2017 at 15:10

OK, thanks for clarification. I can confirm: It works. I was probably not measuring good enough or too focused on the SRC register.

I'm wondering if the activity detection could be supported by the HP filter, what do you think? In order to have just relative measurements. Then I was trying to run with CTRL_REG1 01F. Then the smallest amount of time is 1s followed by 8 and so on with +8s per LSB. The 'free fall abuser' has a finer granularity here (1s per LSB). 

And I'm wondering about the power consumption. The 'free fall abuser' can be driven at 1 Hz ODR, with HP enabled. Even sometimes the +-1 s delay in activity detection is noticeable, it is more or less a very smart and reliable solution.

So having a means here, which can come from 1Hz ODR and will automatically go to 10 Hz ODR low power after acceleration and sleep again is in my eyes not as good as the free fall abuse is, in terms of power consumption.

What do you think?

Miroslav BATEK
ST Employee
Posted on May 25, 2017 at 12:50

I think it deepens on your application requirements. The latency can be important for some application.

The advantage of the activity/inactivity feature is that it is managed automatically by the sensor.

For current consumption please check the following table from application note.

0690X000006076tQAA.png
Posted on May 25, 2017 at 15:36

OK, what I wanted to say is: The free fall abuse allows me to stay at 1Hz low power all the time, which results in 2 uA overall power consumption, regardless of activity or inactivity.

The Actvity/Inactivity detection as outlined above _automatically_ stays at 10 Hz low power, which means 3 uA in inactivity phases. 

Posted on September 20, 2017 at 11:57

Hi, Miroslav, I am using IIS2DH accelerometer at 10Hz and low power mode. So, I have doubt about that if the accelerometer is working as my configuration and I want to use the sensor in power down mode and wakeup when some activity will happen. So, is it possible to a configuration for this requirement? Because in the datasheet it showing that when a sensor is going into sleep mode it will work at 10Hz. Give some solution on that. Thank you for you time.

Posted on September 20, 2017 at 16:41

If you you want to use the accelerometer with ODR 10Hz the sleep feature will not give you any advantage.

This feature is useful if you want to monitor acceleration at 10Hz and increase the ODR if some significant movement happen. In this case you can set the ODR (> 10Hz) and enable sleep feature, then the sensor will automatically switch between 10 Hz and selected ODR.

If you want to reduce the power consumption you can use the ODR 1Hz but you have to switch to higher ODR manually (using a microcontroler).

Posted on September 21, 2017 at 05:07

Thank you for a reply. My requirement is to use accelerometer at 10Hz and it is fixed. I would like to inform you that my application is door open/close detection and it is working well. As per application, I will design the microcontroller in sleep mode instead of accelerometer so can you provide me the configuration for accelerometer generates an interrupt on specific GPIO pin so when this pin will get high or low level detect controller gets wakeup and do the rest operation. 

Posted on September 21, 2017 at 09:14

Please have a look to my answer in this topic 

https://community.st.com/0D50X00009XkXKtSAN

. There is a example how to configure the threshold interrupt. The configuration is valid also for II2DH.