Skip to content

Latest commit

 

History

History
174 lines (118 loc) · 7.08 KB

Grove-Offline-Voice-Recognition.md

File metadata and controls

174 lines (118 loc) · 7.08 KB
description title keywords image slug last_update
Getting started for the Grove Offline Voice Recognition sensor.
Grove Offline Voice Recognition sensor
gesture
/Grove-Offline-Voice-Recognition
date author
01/02/2024
Allen

Grove Offline Voice Recognition

Introduction

Grove - Offline Voice recognition Module is apt for low power pure-offline voice recognition, based on VC-02 module. It has up to 150 pre-programmed commands that can be used to control your smart appliances. It features an identification time less than 100ms, in a compact form factor of 18mm * 17mm. The module can communicate through the UART peripheral and provide unique Hex Code to each recognised command. All this module needs is 5V and it's ready to recognise the commands!

Feature

  • Supports 150 voice commands
  • Low power consumption
  • ESD protected power rails
  • LED indicators for commands
  • Grove UART interface

Specifications

Parameter

Range/Value

Input Voltage 5V/3.3V
Default BaudRate 115200
Default Output Hex values of detected command

Getting started

Hardware setup

You need to prepare the following:

:::tip

Some USB cables can only supply power and cannot transfer data. If you don't have a USB cable or don't know if your USB cable can transmit data, you can check Seeed USB Type-C support USB 3.1.

:::

Step 1. Connect XIAO RP2040 to your computer via a USB Type-C cable.

Step 2. Connect XIAO RP2040 to XIAO expension board.

Step 3. Connect XIAO expension board to Offline Speech Recognizer on UART port via Grove cable.

Step 4. Connect Offline Speech Recognizer to a speaker.

Here is the connecting picture for your reference.

Software Setup

Step 1. Download and Install the latest version of Arduino IDE according to your operating system

Step 2. Select your development board model and add it to the Arduino IDE. If you want to use XIAO RP2040 for the later routines, please refer to this tutorial to finish adding.

:::tip If you want to use other types of XIAO, you can refer here. :::

Step 3. Install the Arduino code library.

Start by getting the code base from GitHub and downloading it to your local computer.

Since you have downloaded the zip Library, open your Arduino IDE, click on Sketch > Include Library > Add .ZIP Library. Choose the zip file you just downloaded,and if the library install correct, you will see Library added to your libraries in the notice window. Which means the library is installed successfully.

Offline voice recognition demo

Step 1. Open this file in your Arduino.

You will see the code like below.

#include "GroveOfflineSensor.h"
#include <SoftwareSerial.h>
#define RX_VC02 D7
#define TX_VC02 D6

SoftwareSerial groveSerial(RX_VC02, TX_VC02); // RX, TX

void setup() {
  Serial.begin(115200);
  // wait for serial port to connect. Needed for native USB port only , This port is for displaying data Grove Sensor sends
  while (!Serial); 
  // Make sure to set the baud rate to match your communication
  groveSerial.begin(115200); 
}

void loop() {
  // detect voice from voice recognition sensor
   uint8_t *voiceData = detectVoiceFromGroveSensor(&groveSerial);

  //transfer the voice to command string
  if(voiceData != NULL){
    String response = getCommandInString(voiceData);
    Serial.println(response);
  }
  delay(1000);
}

Step 2. Click the Upload button to upload the code to the board

Step 3. Say the wake word "hello pudding" to the sensor and then you will hear voice feedback from speaker and words feedback from serial monitor on Arduino IDE. For more instructions, your can find in Resources which located in bottom part of this article.

<iframe width="100%" height="460" src="https://files.seeedstudio.com/wiki/Offline_Voice_Recognition_Img/offlineVoiceRecognition.mp4" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

Resources

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.