Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Porcupine Wake Word
Arduino Quick Start

Platforms

  • Arduino Nano 33 BLE Sense

Requirements

  • Arduino IDE

Picovoice Account & AccessKey

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Quick Start

Setup

  1. Install and select desired board from Tools -> Board.
    • Install Arduino Mbed OS Nano Boards for Arduino Nano 33 BLE Sense.
  2. Select the desired device Serial Port to upload package via Tools -> Port.
  3. Open the Library Manager in the Arduino IDE.
  4. Search for the Porcupine_EN package, and click on the Install button.

Usage

Initialize audio and construct the porcupine object in the setup function:

#include <Porcupine_EN.h>
#define MEMORY_BUFFER_SIZE ${MEMORY_BUFFER_SIZE}
static const char* ACCESS_KEY = "${ACCESS_KEY}";
uint8_t memory_buffer[MEMORY_BUFFER_SIZE] __attribute__((aligned(16)));
const uint8_t keyword_array[] = ${KEYWORD_ARRAY};
const int32_t keyword_model_sizes = sizeof(${KEYWORD_ARRAY});
const void *keyword_models = keyword_array;
const float sensitivity = 0.5f;
pv_porcupine_t *porcupine = NULL;
void setup() {
pv_status_t status = pv_audio_init_rec();
if (status != PV_STATUS_SUCCESS) {
// error starting audio
while(1);
}
status = pv_porcupine_init(
ACCESS_KEY,
MEMORY_BUFFER_SIZE,
memory_buffer,
1,
&keyword_model_sizes,
&keyword_models,
&sensitivity,
&porcupine);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
while(1);
}
}

Get the audio frames and pass them in to pv_porcupine_process in the loop function:

void loop() {
const int16_t *buffer = pv_audio_rec_get_new_buffer();
if (buffer) {
int32_t keyword_index;
const pv_status_t status = pv_porcupine_process(porcupine, buffer, &keyword_index);
if (status != PV_STATUS_SUCCESS) {
// handle error logic
while(1);
}
if (keyword_index != -1) {
// keyword detected
}
}
}

Release resources explicitly when done with Picovoice:

pv_porcupine_delete(porcupine);

Custom Keywords

  1. Obtain the UUID of the chipset:
    1. Open File -> Examples -> Porcupine_EN -> GetUUID.
    2. Click Upload and check the Serial Monitor for the UUID of the board:
UUID: xx xx xx xx xx xx xx xx
  1. Go to Picovoice Console to create models for Porcupine Wake Word engine.
  2. Select Arm Cortex-M as the platform when training the model.
  3. Select appropriate board type and paste in your board UUID.
  4. Train your models.
  5. Download your custom keyword model.
  6. Decompress the zip file. The .ppn file inside is the binary model for the Porcupine Wake Word. The zip archive also contains a .h header file containing the C array version of the binary model.
  7. Copy the contents of the arrays inside the .h header files and update the keyword_array:
const uint8_t keyword_array[] = ${CUSTOM_KEYWORD_ARRAY};

Non-English Languages

Open the Library Manager in the Arduino IDE and search for Porcupine. Click Install on the language desired and add the header file to the project:

#include <Porcupine_{$LANGUAGE_CODE}>

Demo

For the Porcupine Wake Word Arduino SDK, we offer demo projects for several evaluation boards to demonstrate how to use the Porcupine engine on Arduino.

Setup

  1. Open the Library Manager in the Arduino IDE.
  2. Search for the Porcupine_EN package, and click on the Install button.

Usage

  1. Open File -> Examples -> Porcupine_EN -> PorcupineExcample.
  2. Replace ACCESS_KEY with the AccessKey obtained from picovoice console.
  3. Press Upload and check Serial Monitor for outputs.

Resources

API

  • Microcontroller API doc

GitHub

  • Porcupine Wake Word SDK for Arduino boards - English language
  • Porcupine Wake Word SDK for Arduino boards - German language
  • Porcupine Wake Word SDK for Arduino boards - Spanish language
  • Porcupine Wake Word SDK for Arduino boards - French language

Benchmark

  • Wake Word Benchmark

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word Arduino Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Custom Keywords
  • Non-English Languages
  • Demo
  • Setup
  • Usage
  • Resources
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.