In this project I am not going to explore or research on new use-cases rather focus on how can reuse or extend edge impulse public projects for a different microcontroller.
Manivannan Sivan had created a project "Patient Communication with Gesture Recognition" which is a wearable device running tinyML model to recognize gesture pattern and send the signal to mobile app via BLE. Check out his work here for more information.
In this project, I am going to walk you through how you can clone his public edge impulse project, deploy to Silabs Thunderboard Sense 2 first, test it out and then build and deploy on Silabs xG24.
Before you proceed further, there are few other softwares you need to install.
- Edge Impulse CLI - Follow this link to install necessary toolings to interact with edge impulse studio.
- Simplicity Studio 5 - Follow this link to install the IDE
- Simplicity Commander - Follow this link to install the software. This will be required to flash firmware to xG24 board
- LightBlue - This is a mobile app. Install from either apple play store or android store. This will be required to connect the board wirelessly over bluetooth
If you don't have edge impulse credential, signup for free and log into edge impulse. Then open below public project on your browser.
https://studio.edgeimpulse.com/public/147925/latest
Click on the "Clone" button at top-right corner of the page.
That will bring below popup modal. Enter a name of your project and click on "Clone project" button.
The project will be cloned to edge impulse studio. You can verify by looking at the project name you type before. Now if you navigate to "Create impulse" from left pane, you will notice how the model was created originally.
As you already noticed the model was created based on 3 axis accelerometer data. Window size was set as 4s and window increase was set to 4s as well which ensures there is no overlap. That means if the input data is of 20s, there will be 5 samples from that data. Spectral Analysis was selected as digital signal processing and Keras was selected as learning block.
Next, navigate to "Retrain model" from left menu and click on "Start training". At this point, you may like to collect more data and train the model with your gesture movement or may be with few others.
Follow this document to connect your board to edge impulse studio and capture data. Once you are done with collecting more data, retrain the model.
Deploy And TestNavigate to the "Deployment" page from left pane, select "SiLabs Thunderboard Sense 2" under "Build firmware", then click on "Build" button which will build your model and download as a bin file.
If not connected, connect Thunderboard Sense 2 to your computer via USB cable. You should see a drive named TB004. Drag and drop the bin file to the drive. If you see any error like below, you need to use Simplicity Studio 5 to flash the application.
LEDs on TB2 will flash indicating firmware is updated on the board. Open LightBlue app, scan for devices. You should see a device named "Edge Impulse" connect to that. Then tap on "0x2A56" characteristic, then "Listen for notifications". Change the format from "Hex" to "UTF-8 String".
Then, go to terminal and issue below command which will start inference on the board.
edge-impulse-run-impulse
Alternatively you can write boolean 1 to write characteristic to start the inference on the board. Checkout the gif for xG24
Then move your finger to create the gesture pattern and you should see notification on your phone.
Well, now you have learned how to clone a public edge impulse project, capture more data and deploy to Thunderboard Sense 2 directly.
Deploy To xG24 Dev KitNow, we will explore how we can deploy the same model on Silabs xG24.
In fact, you can deploy the model straight to xG24 without making any changes to the model. Go to deployment tab on edge impulse studio, select "SiLabs xG24 Dev Kit" under build firmware and build.
This will download a zip file containing a hex file and instruction.
Now you can use Simplicity Studio 5 to flash the hex file as shown before or use Simplicity Commander. You can read more about commander here.
Once flashing is done, use LightBlue app to connect to the board and test as you did for Thunderboard Sense 2.
I did a quick comparison between two boards and as expected xG24 seems twice as faster.
Try it yourself. Happy coding!
Comments
Please log in or sign up to comment.