cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to detect significant motion with lsm6dso sensor without using step counter. Since I use it on cars, it can not detect location changes.

Iakgu.1
Associate III

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Iakgu.1
Associate III

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.

View solution in original post

10 REPLIES 10
Eleon BORLINI
ST Employee

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

Iakgu.1
Associate III

With significant motion , I mean change in user location. For example if the car moves and go some distance, I wanna detect it.

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

Iakgu.1
Associate III

Can I use motion/station event with fsm to detect moving of a car ?

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dso_STdC/example/lsm6dso_fsm.c

In this link can I use (lsm6so_prg_motion) values to detect motion ?

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:

0693W000008yTy2QAE.png0693W000008yTyMQAU.png 

-Eleon

Iakgu.1
Associate III

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dso_STdC/example/lsm6dso_fsm.c

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,};

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

I fixed the problem, thank you.

Hi @Iakgu.1​ ,

can you share your solution to help future users with the same issue?

Thanks,

-Eleon