2026-04-13 3:58 AM
Hello. I have LIS2DUX12 accelerometer and have sucessfully ran machine learning example from STMems (activity_recognition_for_mobile) on our custom hardware.
https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lis2dux12_STdC/examples/lis2dux12_mlc_activity_mobile.c
For our application, we need to be able to reliably detect when our device is being transported with a car but its not so straightforward. The few difficulties include:
1. The device orientation is not fixed
2. The device may shake gently or move very slowly during its normal application. This is perfectly fine and we should somehow not detect that.
I have looked at different application_examples :
https://github.com/STMicroelectronics/STMems_Machine_Learning_Core/tree/master/application_examples
but not sure which would work best for us. If we cant find any suitable application example, we can try and train our own model with our own data.
I would appreciate if someone could share their insights and provide any feedback regarding our application. How should we handle different orientation problem and gentle shaking/slow movement?
2026-04-13 6:55 AM
Hi @LPetr.1 ,
For your application, the LIS2DUX12 MLC is well-suited to detect car transport in an orientation-independent manner and to reject false positives from gentle shaking or slow movement. You should:
2026-04-13 9:30 PM - edited 2026-04-13 9:31 PM
First of all thanks for your response. Additionally, I forgot to mention that MCU will not be actively sampling the data since it will be in sleep mode. I only want to receive INT from the accelerometer when it detects the correct movement pattern.
Regarding your tips, could you be more precise please?
Could you elaborate a little bit more about how to achieve orientation independence? What kind of features exactly I should look into and what is "norm of the accelerometer data" ?
Could you also elaborate on this a little bit more? What features precisely are you talking about, could you point me in the right direction so I could look into this more on the LIS2DUX12 datasheet. Are there any examples available of these features in STMems example projects so I could look into more?
2026-04-13 9:42 PM - edited 2026-04-14 9:18 PM
First of all thanks for your response. Additionally, I forgot to mention that MCU will not be actively sampling the data since it will be in sleep mode. I only want to receive INT from the accelerometer when it detects the correct movement pattern.
Regarding your tips, could you be more precise please?
Could you elaborate a little bit more about how to achieve orientation independence? What kind of features exactly I should look into and what is "norm of the accelerometer data" ?
Could you also elaborate on this a little bit more? What features precisely are you talking about, could you point me in the right direction so I could look into this more on the LIS2DUX12 datasheet.
I am just curious how would I need to train the data for orientation independance. Would it be enough to train data in one specific orientation and then let the tool handle everything or I would need to train the data in many different orientations?
Additionally, I am concerned if using accelerometer is sufficient enough to reliably detect car movement whilst filtering out gentle shaking and small movement. I have seen some car movement detection examples but they all use accelerometer + gyroscope.
2026-04-16 12:57 AM
Hi @LPetr.1 ,
Use the norm of the accelerometer data and extract statistical features (mean, variance, energy, peak, zero-crossing) for orientation-independent detection.
Configure the MLC's debounce and false-positive rejection features to avoid spurious interrupts and collect and train data in multiple orientations for robust model performance.
Accelerometer-only detection is possible, but for maximum reliability, a combined accelerometer + gyroscope solution may be preferable.
2026-04-16 1:16 AM - edited 2026-04-16 1:17 AM
It is a little bit more clear but it still seems that you are just spitting random fancy words such as "MLC debounce and false-positive rejection features".
Can you please tell me specifically which features are you referring to and point me to relevant pages in the datasheet, because the LIS2DUX12 MLC datasheet has no mention of words "debounce" or "false-positive rejection"