2021-03-30 08:52 AM
lsm6dso sensor generates significant motion interrupt when a change in user location is detected. It generates an interrupt when the difference between the number of steps counted from its initialization/reset is higher than 10 steps. So it uses step counter. I will use this sensor on car. So I can not take interrupt, when the car changes location. Since there is not any steps. Is there any way to detect significant motion interrupt without using step counter in lsm6dso sensor ?
Solved! Go to Solution.
2021-04-09 12:22 PM
In the array every byte has a meaning. It may be command, condition, fixed data, threshold, etc.
I used another array from datasheet and problem is fixed.
2021-03-31 07:02 AM
Hi @Iakgu.1 ,
I believe you should first define what you mean with significant motion (if not specifically referred to the human walk).
If you just need a threshold comparison, you can use the Motion/Stationary recognition described, which allows you to detect a movement without changing the operating mode (as happens for the Activity/Inactivity or the Wake-up features). They are described in the AN5192 application note, and a C-code example can be found on Github (lsm6dso_activity.c).
If otherwise you want to recognize a more specific pattern, you could use the Finite State Machine feature of the LSM6DSO, described in the application note AN5226. You can also find some example on Github repository, same folder (lsm6dso_fsm.c).
For even more advanced features, that exploit an embedded Machine Learning core, I suggest you the use of the LSM6DSOX, for which there are a lot of example of specific motion recognition (such as activity, head gesture, vibrations...) always on Github.
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-03-31 07:14 AM
With significant motion , I mean change in user location. For example if the car moves and go some distance, I wanna detect it.
2021-03-31 07:26 AM
If the car is in rest condition and then it starts moving, you can use a simple threshold comparison such as the one of the Motion/Stationary event.
If you want to track the position of the car (for example calculating the distance from the starting and the ending point), you have to use more complex solutions, such as Teseo-LIV3F module.
-Eleon
2021-03-31 08:03 AM
Can I use motion/station event with fsm to detect moving of a car ?
In this link can I use (lsm6so_prg_motion) values to detect motion ?
2021-04-01 12:41 AM
I believe so: this is a generic flow for motion detection.
You might have to fine-tune the threshold and the timings for taking into account a car motion instead of a person motion, but should work.
Here below I share you some more details on this FSM algorithm:
-Eleon
2021-04-02 12:03 AM
I don't understand how this array is filled. What is the meaning of every byte ?
/* Program: motion */
const uint8_t lsm6so_prg_motion[] = { 0x51, 0x10, 0x16, 0x00, 0x00, 0x00, 0x66, 0x3c, 0x02, 0x00, 0x00, 0x7d, 0x00, 0xc7, 0x05, 0x99, 0x33, 0x53, 0x44, 0xf5, 0x22, 0x00,};
2021-04-08 01:15 AM
Hi @Iakgu.1 ,
the array have been created from the Unico .ucf file, as described in the LSM6DSO: Finite State Machine - Application note, p.52.
Those values are basically the values written in the FSM registers starting from the (that are common to all the FSM examples in that file).
#define LSM6DSO_START_FSM_ADD 0x0400U
/* Write Programs */
fsm_addr = LSM6DSO_START_FSM_ADD;
Which kind of error are you receiving? Compilation error or "runtime", in the sense that the movement is not detected?
-Eleon
2021-04-08 08:04 AM
I fixed the problem, thank you.
2021-04-09 07:31 AM
Hi @Iakgu.1 ,
can you share your solution to help future users with the same issue?
Thanks,
-Eleon