This article will take you through the process of creating a custom natural-language understanding model that runs fully on-device using Picovoice Rhino Speech-to-Intent Engine, and deploying it into Arduino Nano 33 BLE . The entire process will take less than 15 minutes from the start to a working demo! Things you need to follow along:
- Arduino IDE (free)
- Arduino Nano 33 BLE
- Picovoice Console Account (free)
The process can be broken down into three main steps:
Create an NLU Model
- Sign up for Picovoice Console if you haven't already.
- On Picovoice Console, go to the
Rhino Page
. - Click on
New Context
. - Enter a name for your model; I went with
arduino_coffee_maker
. - Select the language for your model;
English
in our case. - Choose
Coffee maker
from the list of available templates.
- Click on
Create Context
; this will take you to the context editor.
- The
Coffee maker
template only has one intent,orderBeverage
, and three slots,beverage
,size
, andnumberOfShots
. Let's make it more interesting by adding one more intent,donateBeverage
and one more beverage type:- Inside the
new intent
box inside the left panel, typedonateBeverage
and click on the+
button - Click on the
donateBeverage
intent to open the expression editor - Add a new expression by typing
I would like to donate a $beverage:donation
and clicking on the+
button. This expression will match phrases likeI would like to donate a coffee
orI would like to donate a cappuccino
. - Click on the
beverage
slot to open the slot editor - Type your favorite beverage,
chai
in my case, and click on the+
button
- Inside the
You can try out your context within your browser by clicking on the mic button on the right side of the editor as you modify it.
Once you are happy with your context, save it.
Train an NLU Model for Arduino
- Click on the
Download
button. - Pick
ARM Cortex-M
as the platform. - Select
Arduino Nano 33 BLE
as your board type.
- Enter the
UUID
for your board. To get the UUID:- Open the Arduino IDE
- Download
Picovoice_EN
library - Run the
GetUUID
example fromPicovoice_EN
- Check the
Serial Monitor
to find the UUID of your board. Copy and paste it into theUUID
field in the console
Click on the Download button. You should have a
.zip
file in your download folder now.Unzip it. Open the header file with a text editor. The
CONTEXT_ARRAY[]
contains your custom context model!
Deploy into Arduino Nano 33 BLE
- Open the
Picovoice_EN
example from the library. - Replace
CONTEXT_ARRAY[]
defined inparams.h
with the one you just generated. - Go to Picovoice Console's dashboard. Copy your
AccessKey
.
- Put your
AccessKey
inPicovoiceExample.ino.
Don't forget to wrap it in"
and terminate the line with;
! - Upload the sketch to your Arduino Nano 33 BLE Sense board.
- Open the
Serial Monitor
and sayPicovoice, I would like to donate a chai
. You should see the following output:
Picovoice SDK enables developers to create production-quality voice models within minutes. It runs on anything,
including Arduino Nano 33 BLE
and Arduino Portenta H7
. Picovoice SDK is also available on STM32
, NXP i.MX RT
, Raspberry Pi
, BeagleBone
, NVIDIA Jetson
, Android
, iOS
, web browsers
, Linux
, macOS
, and Windows
!
What's Next?
Learn More About Rhino
To learn more about Picovoice Rhino Speech-to-Intent Engine and the context editor, check out the following resources:
Custom Wake Word
In this demo, we used the default wake word, Picovoice
. To learn how to train your own wake word, check
out Arduino Voice Recognition in 10 Minutes or
Less.
Non-English Models
Picovoice supports a wide range of languages, and the list is growing. If you train your models in a language other than
English, you need to also use the corresponding library. For instance, if you train your models in German, you need to
use Picovoice_DE
library. You can find the list of supported languages and their corresponding libraries on
the Arduino Quick Start page.