Showing results for 
Search instead for 
Did you mean: 

LIS2DE12 configuration for interrupt when going from stillness to motion and vice versa



I'm having difficulties understanding how to configure the LIS2DE12. Especially the filter part is obscure to me.
I want the accelerometer to generate an interrupt when the device changes from being still to moving or the opposite.
The power consumption should be as low as possible, so an ODR of 1hz has been chosen, and also smaller movement should be filtered out. That means the device should have been moving for at least 5 minutes after having being still or vice versa before generating an interrupt.

I hope someone is able to help.


Federica Bossi
ST Employee

Hi @Kolbe ,

Welcome to ST Community!

For the activity detection you need to use the wake-up interrupt that allows interrupt generation when the acceleration on the configured axis exceeds a defined threshold.

Here below below an example code that gives a basic routine that shows the practical use of the inertial wake-up feature performed on high-pass filtered data. The device is configured to recognize when the high-frequency
component of the acceleration applied along either the X, Y, or Z-axis exceeds a preset threshold (250 mg used in
the example).
The event that triggers the interrupt is latched inside the device and its occurrence is signaled through the use of
the INT1 pin.

1. Write 57h into CTRL_REG1 // Turn on the sensor, enable X, Y, and Z
// ODR = 100 Hz
2. Write 09h into CTRL_REG2 // High-pass filter enabled on interrupt activity 1
3. Write 40h into CTRL_REG3 // Interrupt activity 1 driven to INT1 pin
4. Write 00h into CTRL_REG4 // FS = ±2 g
5. Write 08h into CTRL_REG5 // Interrupt 1 pin latched
6. Write10h into INT1_THS // Threshold = 250 mg
7. Write 00h into INT1_DURATION // Duration = 0
8. Read REFERENCE // Dummy read to force the HP filter to the current acceleration value
// (that is, set reference acceleration/tilt value)
9. Write 2Ah into INT1_CFG // Configure desired wake-up event
10. Poll INT1 pin; if INT1 = 0 then go to 9 // Poll INT1 pin waiting for the wake-up event
11. (Wake-up event has occurred; insert your code
// Event handling
12. Read INT1_SRC // Return the event that has triggered the interrupt and clear interrupt
13. (Insert your code here) // Event handling
14. Go to 9
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.