On your Syntiant TinyML Board
Last updated
Last updated
Impulses can be deployed as an optimized Syntiant NDP 101 library. This packages all your signal processing blocks, configuration and learning blocks up into a single package. You can include this package in your own application to run the impulse locally. In this tutorial you'll export an impulse, and run the application on the Syntiant TinyML Board to control GPIO pins when the keyword 'go' or 'stop' is uttered, or if a circular motion is detected.
Make sure you followed the Responding to your voice - Syntiant - RC Commands or Motion recognition - Syntiant tutorial, have a trained impulse, and can load code on your Syntiant TinyML Board.
Audio acquisition - Windows OS
Using the Syntiant TinyML board as an external microphone for data collection doesn't currently work on Windows OS.
A fully customizable Arduino-based project is provided here. Follow the instructions in the Readme for instructions on how to build and run the Arduino sketch for Win 10, Mac, and Linux. If this is your first time working with the Arduino IDE, you will need to install both the Arduino IDE as well as the Arduino CLI for your system before proceeding with the next steps.
For Windows, follow these steps:
Install Board package SAMD v1.8.9 (go to Tools -> Board -> Boards Manager)
Then, run the update_libraries_windows.bat script.
For Linux and Mac, use:
./arduino-build.sh --build
for audio support
./arduino-build.sh --build --with-imu
for IMU support to build the firmware.
Run ./arduino-build.sh --flash
to flash the Syntiant TinyML Board.
After this, you can add your custom logic to this and control external actuators such as servo or DC brush motors using the provided user accessible GPIOs. We've demonstrated this by lighting up the respective onboard LEDs and setting the appropriate GPIO pins based on whether 'go' or 'stop' is uttered (audio firmware), or if a circular motion is detected (IMU firmware).
Once you've customized your code, take the .bin file output by Arduino and rename it to firmware.ino.bin before using the same flashing script from before to flash your dongle with updated functionality. In Windows, the .bin file will be located in the output directory like so: C:\Users\username\AppData\Local\Temp\arduino_build_106482 (replace username with your own)
Creating custom firmware with different classes
If you're creating a project with classes different from our default firmwares, you will need to use the 'Create library' option on the deployment page. This will create an output zip that contains a model-parameters folder that contains dsp_blocks.h and model_metadata.h that you will need to drop into* src/model-parameters* folder of the custom firmware build directory. This export will also create an ei_model.bin that can be flashed using the same flashing script from before.
Great work! You've captured data, trained a model, and deployed it to the Syntiant TinyML Board. You can now control LEDs, activate actuators, or send a message to the cloud whenever you say a keyword or detect some motion!