cancel
Showing results for 
Search instead for 
Did you mean: 

How to augment a wearable application with the new ST IMU LSM6DSV32X

Denise SANFILIPPO
ST Employee

Introduction

This knowledge article provides an example of a wearable application based on the new ST IMU LSM6DSV32X.

There are ready-to-use examples for LSM6SV32X inside the repository on GitHub github.com/STMicroelectronics/STMems_Overall_Offer.

In fact, the STMEMS_Overall_Offer repository is made up of different repositories related to MEMS sensors, among which:

  • STMems_Standard_C_drivers, which contains examples of integration of different sensors including the LSMDSV32X written in the C programming language.

    Here you can find the source code of the drivers of our devices and examples about how to use different features available in the sensor itself.
  • Repository of the finite state machine examples STMems_Finite_State_Machine
  • Repository of the machine learning core examples STMems_Machine_Learning_Core.

Open the repository of the machine learning core STMems_Machine_Learning_Core to see what is available inside:

  • A folder called tools including some tools for development like Python scripts.
  • A folder called configuration example containing step by step examples and tools to be used in the application example folder with ready-to-use examples.
  • If we are considering wearable applications, we can choose from the available application examples a configuration for the activity recognition for wrist devices like smartwatches. This example of application recognized conditions like stationary, walking, and jogging with a limited power consumption since the algorithm consists in an execution of a decision tree run on the MEMS sensor itself.

1. Hardware setup

Since our example is for wearable application, we are going to use a board called the SensorTile.box PRO.  SensorTile.box PRO is a programmable wireless box kit for developing an IoT application equipped with a wide variety of MEMS sensor and wireless connectivity.

We are going to use a specific 3D-printed case for SensorTile.box PRO to be able to mount a board on our wrist like a smartwatch. To do this, we decided to use a dedicated case, whose 3D drawing Model can be found as STEVAL-MKBOXPRO 3D Drawing Model 1.0 in the CAD resources section.

 

Figure 1: 3D model of the SensorTile.box PRO case for wearable applications.Figure 1: 3D model of the SensorTile.box PRO case for wearable applications.

 

In general, a DIL24 adapter of an external MEMS sensor can be connected to the DIL24 socket of the SensorTile.box PRO. So, we have connected a DIL24 adapter of the LSMDSV32X sensor, STEVAL-MKI240KA, on the top of the SensorTile.box PRO to develop our wearable application, as shown in Figure 2.

 

Figure 2: Hardware setup for a wearable application: SensorTile.box PRO + LSM6DSV32X DIL24 adapterFigure 2: Hardware setup for a wearable application: SensorTile.box PRO + LSM6DSV32X DIL24 adapter

 

2. Setting up the STBLESensor app

The SensorTile.box PRO can be easily connected via Bluetooth to your smartphone through an app called the STBLESensor app. From the STBLESensor app we can control the SensorTile.box PRO and develop our application. To start creating our application, we need to do the following in the STBLESensor app:

Go to [Flow] -> [Expert View] -> [New App] and then select IMU with the MLC in the Expansion DIL24 section.

 

 

Figure 3: Setting of the parameters inside STBLESensor app.Figure 3: Setting of the parameters inside STBLESensor app.

 

Now, we can load the LSMDSV32X configuration to our sensor through a configuration file (lsm6dsv32x_activity_recognition_for_wrist.ucf).
Then we can enable the data stream from the board to the phone through Bluetooth.
Finally, we can save the application created and download it to the SensorTile.box PRO. Figure 4 sums up all these steps.

 

Figure 4: The new flow created inside STBELSensor app.Figure 4: The new flow created inside STBELSensor app.

 

3. Testing the new wearable application

Once the board is programmed, we can test the application by checking the outputs of the decision tree configured in the machine learning core of the LSMDSV32X sensor.

You can see that the output is:

  • 0x1 when the user is steady

Figure 5: Stationary class is detected by the wearable application.Figure 5: Stationary class is detected by the wearable application.

 

  • 0x4 when the user is walking

Figure 6: Walking class is detected by the wearable application.Figure 6: Walking class is detected by the wearable application.

 

  • 0x8 when the user is jogging

Figure 7: Jogging class is detected by the wearable application.Figure 7: Jogging class is detected by the wearable application.

 

As you remember, we have selected the activity recognition for wrist from the GitHub application examples related to the machine learning core features for LSMDSV32X.
There are of course other examples available for both MLC and FSM that you can use, or you can also build your own configuration for the sensor.

Conclusion

We have created a wearable application based on the new IMU LSM6DSV32X.

Explore all the ready-to-use examples on the GitHub repository for ST MEMS sensors!

Related links

Details are available at the following links:

Version history
Last update:
‎2024-06-10 07:11 AM
Updated by: