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
demo1: Grove offline voice recognition module with Arduino IDE
Hardware setup
You need to prepare the following:
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.
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.
demo2: Grove offline voice recognition with ESPHome and Home Assistant
Hardware setup
you need to prepare the following:
- A device installed Home Assistant
The first step to getting started with Home Assistant is to install it on a device, you can follow here for step-by-step guide.
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. Hardware Preparation
Connect XIAO ESP32S3 to your computer via a USB Type-C cable. Connect XIAO ESP32S3 to XIAO expension board. Connect XIAO expension board to Offline Speech Recognizer on UART port via Grove cable. Connect Offline Speech Recognizer to a speaker. Connect antenna to XIAO ESP32S3.
Here is the connecting picture for your reference.

Step 2. Create your smart home Entered the Home Assistant device’s address in your browser’s address bar, and create a Home Assistant account, you can follow here for step-by-step guide.
Step 3. Install ESPHome on Home Assistant You can quickly setup ESPHome on Home Asssistant by follow here
Software
Add XIAO ESP32S3 to ESPHome
Click + NEW DEVICE
Click CONTINUE

- Enter a Name for the device and enter WiFi credentials such as Network name and Password. Then click NEXT.

Select ESP32-S3 and click NEXT
Click Install and choose Manual download.
After download successfully, Open ESPHome Web and choose Modern format.

- Connect port of your XIAO ESP32S3, and install the bin.file you just got, now it will download all the necessary board packages and flash the ESPHome firmware into the XIAO ESP32S3.

- Open the LOGS, if the flashing is successful, you will see the follow output, and now go back ESPHome page, if you see the board status as ONLINE, that means the board is successful connected to WiFi.
If you get the wanning that "[wifi_esp32:482][arduino_events]: Event: Disconnected …… reason='Auth Expired'", please ensure that the ESP32 device is within range of the WiFi network, poor signal strength can cause connection issues. You can replace your antenna to Rod Antenna.
Now you can disconnect the XIAO ESP32C3 from the computer and just power it via a USB cable. This is because from now on, if you want to flash firmware to the XIAO ESP32C3, you can simply do it OTA without connecting to the X86 board via a USB cable.
Click the three dots and click Install, Select Wirelessly and it will push the changes to the board wirelessly
Go to Settings and select Devices & Services,You will see ESPHome as a discovered integration. Click CONFIGURE. If it ask for the encryption key, go back to ESPHome page to copy the API Key and enter it.
Offline voice recognition
Step1. Inside the offline-voice-recognition.yaml file that we created before, add the following at the end of the file and push it OTA to XIAO ESP32S3
Click here to preview the full code
When we create a new device, the yaml.file that automatically generated will be vary because of different configuration and device type, so we recommend not changing the beginning of file, and just adding the code at the end.
- You can learn more about Uart Bus here
- You can learn more about Switch Component here
- You can learn more about Select Component here
Step2. Visualize on Dashboard
- Now go back the Devices, choose the offline voice recognition
- Click ADD TO DASHBOARD→NEXT→ADD TO DASHBOARD, and back to OVERVIEW, now your Home Assistant dashboard will look like below

Step3. Say the wake word "hello pudding" to the sensor and then you will hear voice feedback and see action feedback on the Home Assistant. For more instructions, your can find in Resources which located in bottom part of this article.
Resources
- [PDF] Offline Voice Commends
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.