Skip to main content
Created By: Salman Faris Public Project: https://studio.edgeimpulse.com/public/188507/latest

Introduction

In this project I’m going to walkthrough how to port an existing project developed on the SiLabs Thunderboard Sense 2, to SiLabs’ newer and more powerful xG24 development board. The original project was developed by Manivnnan Sivan to detect correct / incorrect posture of manufacturing workers using a wearable belt.
Original wearable posture detector sending data to Edge Impulse Studio

Image from original project

I will walk you through how you can clone his Public Edge Impulse project, deploy to a SiLabs Thunderboard Sense 2, test it out, and then build and deploy to the newer SiLabs xG24 device instead.

About the project : Posture Detection for Worker Safety

You can find more about the project here in the original project documentation, Worker Safety Posture Detection. The project is intended to help workers in manufacturing. They work in conditions that can put a lot of stress on their bodies. Depending on the worker’s role in the production process, they might experience issues related to cramped working conditions, heavy lifting, or repetitive stress. Poor posture can cause problems for the health of those who work in manufacturing. Along with that, research suggests that making efforts to improve posture among manufacturing employees can lead to significant increases in production. Workers can improve their posture by physical therapy, or simply by being more mindful during their work day. Manivnnan Sivan has created a wearable device using a SiLabs Thunderboard Sense 2 which can be fitted to a worker’s waist. The worker can do their normal activities, and the TinyML model running on the hardware will predict the posture and communicate to the worker through BLE communication. The worker can get notified in the Light Blue App on their phone or smartwatch.

Running the Project on Thunderboard Sense 2

Before porting, we need to run the project on the existing platform to understand how it’s run and familiarize ourselves with it’s parameters. So let’s get started.

Installing Dependencies

Before you proceed further, there are few other software packages you need to install.
  • Edge Impulse CLI - Follow this link to install necessary tooling to interact with the Edge Impulse Studio.
  • LightBlue - This is a mobile application. Install from either Apple Store or Android / Google Play. This will be required to connect the board wirelessly over Bluetooth. The Android version can be found here. Apple / iOS users can download the App here.

Clone the Project

Go to the Edge Impulse project page using the link here, and clone it. Click Clone on the right corner button to create a copy of the project.
Edge Impulse public project page with the Clone button highlighted
Provide a project name in the text field, and click on the Clone project button.
Clone project dialog for naming the posture detection copy
Done, the project is successfully cloned into your Edge Impulse account:
Cloned posture detection project opened in Edge Impulse Studio
As we clone the project, it will be loaded with the dataset collected by Manivannan.
Data acquisition page loaded with the cloned posture dataset

Run the Project

We can try to deploy the project on a Thunderboard Sense 2:
  1. Connect the development board to your computer : Use a micro-USB cable to connect the development board to your computer. The development board should mount as a USB mass-storage device (like a USB flash drive), with the name TB004. Make sure you can see this drive.
  2. Update the firmware : The development board does not come with the right firmware yet. To update the firmware: 2.1 Download the latest Edge Impulse firmware. 2.2 Drag the silabs-thunderboard-sense2.bin file to the TB004 drive.
    Thunderboard Sense 2 mass storage drive with the firmware file
    2.3 Wait 30 seconds.
Next, open the CLI and run edgeimpulse-daemon From here, Log in with your Edge Impulse credentials and choose the cloned project from the followed project list.
Edge Impulse daemon prompting for project selection in a terminal
Then provide a name for the device that is connected to the computer.
Edge Impulse daemon prompting for the connected device name
After completing these steps, you will see that the device is connected to the Edge Impulse Studio via the CLI.
Edge Impulse Studio Devices page showing the Thunderboard connection

Build & Deploy the Project

Choose “Deployment” from the left toolbar and then choose the target device as “SiLabs Thunderboard Sense 2”, and click “Build” to start the process.
Deployment page building firmware for the Thunderboard Sense 2
After the build completes, a .bin file will be automatically generated and downloaded. You need to drag and drop it to the Thunderboard Sense 2 device drive.
Downloaded firmware file ready to drag onto the Thunderboard drive
Done, we can now open the LightBlue mobile app to run and see the inference:
LightBlue app connected to the Thunderboard posture detector
Alternatively you can run it on a computer, if you don’t have access to a phone. Run the command below to see if the tinyML model is inferencing. edge-impulse-run-impulse
Terminal showing live posture inference results from the Thunderboard
Nice, so far we cloned and implemented the project. Now we are going to port to the new board!

The New SiLabs EFR32MG24

SiLabs have launched the new EFR32MG24 also known as xG24 Wireless SoCs and they are full of interesting sensors and features making them very good for mesh IoT wireless connectivity using Matter, OpenThread, and Zigbee protocols for smart home, lighting, and building automation products or any other use case you see fit to this combination of sensors and connectivity.
Diagram of the EFR32xG24 Dev Kit board layout
The sensors present onboard are an accelerometer, a microphone, environmental sensors comprising temperature, humidity, and air pressure, a Hall sensor, an inertial and an interactional sensor.
SiLabs xG24 Dev Kit hardware board with connectors and onboard sensors

Collect More Data Using the xG24

Compared to the Thunderboard Sense 2, the xG24 does have some changes while connecting to Edge Impulse and uploading the firmware.
  1. First - Download the base firmware image - Download the latest Edge Impulse firmware, and unzip the file. Once downloaded, unzip it to obtain the firmware-xg24.hex file, which we will be using in the following steps.
  2. Connect the xG24 Dev Kit to your computer - Use a micro-USB cable to connect the xG24 Dev Kit to your development computer, and download and install Simplicity Commander.
xG24 Dev Kit connected to a computer for firmware flashing
  1. Load the base firmware image with Simplicity Commander - You can use Simplicity Commander to flash your xG24 Dev Kit with the Edge Impulse base firmware image. To do this, first select your board from the dropdown list on the top left corner:
Simplicity Commander device selection for the xG24 Dev Kit
Then go to the “Flash” section on the left sidebar, and select the base firmware image file you downloaded in the first step above (i.e., the file named firmware-xg24.hex). You can now press the Flash button to load the base firmware image onto the xG24 Dev Kit.
Simplicity Commander Flash page with the xG24 firmware file selected
After this, we can follow the usual method on how we select the device in the Edge Impulse Studio via the CLI. Next, open the CLI and run edgeimpulse-daemon From here, log in with your Edge Impulse credentials and choose the cloned project from the project list that follows.
Edge Impulse daemon prompting for project selection in a terminal
Then provide a name for the device that is connected to the computer.
Edge Impulse daemon terminal connecting the xG24 device
After doing these steps, you can see the device is connected to the Edge Impulse Studio via the CLI.
Edge Impulse Studio Devices page showing the xG24 connection
I collected a bit of additional data using the xG24, and it looks good.
Data acquisition page with newly collected xG24 posture samples
Now, we need to retrain the data set, but before that we need to set the target as SiLabs EFR32MG24.
Edge Impulse target device setting changed to SiLabs EFR32MG24
Great, we got nice accuracy in model training.
Model training results showing posture detection accuracy
Now, we can build the model and deploy to the xG24. For the build, we need to choose the correct device first, then click “Build”.
Deployment page building the model for the xG24 Dev Kit
After generating the .bin file, we need to use Simplicity Commander to flash your xG24 Dev Kit with this firmware. To do this, first select your board from the dropdown list on the top left corner:
Simplicity Commander device selection for the xG24 Dev Kit
Then go to the “Flash” section on the left sidebar, and select the generated firmware image file you downloaded after the build process. You can now press the Flash button to load the generated .hex file firmware image onto the xG24 Dev Kit.
Simplicity Commander Flash page with the xG24 firmware file selected
Next, we can use the LightBlue mobile app to run and see the inference.
LightBlue app displaying inference output from the xG24 posture detector
Alternatively, we can run on computer as we did for the Thunderboard Sense 2, if you don’t have access to a phone. Run the command below to see if the tinyML model is inferencing. edge-impulse-run-impulse
Terminal output from edge-impulse-run-impulse on the xG24 model
Awesome, we have now successfully ported a project from Thunderboard Sense 2 to the xG24 Dev Kit!

Conclusion

We can see here, the xG24 does a faster classification of these tinyML datasets without compromising the accuracy. Here you can see the comparison data, and we can see 91.1765% increased inferencing speed in the NN Classifier, while the RAM and Flash usage are the same.
Edge Impulse model optimization table comparing xG24 inference speed
Similar results are achieved in the field data when we are inferencing the live data stream. Here we can see a 92.3077% increase in speed in the classification, which is more than what was calculated in the model optimization.
Live inference timing comparison for the xG24 field data stream
To conclude the porting project post, we can confirm that it’s worth to upgrade products and projects using the Thunderboard Sense 2 to the new and efficient SiLabs xG24 Dev Kit.