cancel
Showing results for 
Search instead for 
Did you mean: 

Custom algorithms using finite state machine (FSM) on LSM6DSO sensor.

ASoni.2
Associate III

Hello, there,

I would like to know about the application of FSM feature of LSM6DSO sensor.

I can see in the example that every embedded functions are implemented using FSM.

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

We have developed three algorithm and looking at implementing via state machine diagram.

Can FSM be used for our custom algorithms?

Does FSM only supports sensor's internal features such as 4D, Free Fall, Wrist-tilt, Basic Pedometer, Motion and so on?

Kind regards,

Aakash Soni.

3 REPLIES 3
niccolò
ST Employee

Hi Aakash @ASoni.2​,

yes, FSM can indeed be used for your custom algorithms.

you can read the application note below to learn how to program it:

https://www.st.com/resource/en/application_note/dm00537590-lsm6dso-finite-state-machine-stmicroelectronics.pdf

what algorithm are you planning to implement?

ASoni.2
Associate III

Hi Niccolo @niccolo.ruffini​ 

Thank you for your reply.

We are developing a smartwatch.

We have fall detection and sleep monitoring algorithms as well as small features such as step counting and wrist tilting.

We might also use accelerometer for PPG sensor.

Kind regards,

Aakash Soni.

That is really cool.

As you can see, there is a version of a wrist tilting algorithm in the sample code at the link you posted, for the other ones you should try and program it using the application note I linked.

keep up the good work!