Offline Voice Recognition Sensor

Offline Voice Recognition Module: Arduino Programming & Custom Voice Commands

Harnessing the Power of Offline Voice Recognition: Arduino Programming & Custom Voice Commands

Introduction:
Explore the world of offline voice recognition with Arduino programming and custom voice commands. In this article, we delve into the capabilities and potential of an innovative offline voice recognition module. Discover how to unlock new possibilities for interaction and control in your projects without relying on a network connection. Join us as we delve into the exciting realm of offline voice recognition using Arduino.

  1. The Advantages of Offline Voice Recognition:
  • Privacy: Learn how offline voice recognition modules offer enhanced privacy by eliminating the need for constant internet connectivity.
  • Low Latency: Discover the benefits of reduced latency in real-time voice recognition applications, ensuring faster response times.
  1. Introducing the Offline Voice Recognition Module:
  • Explore the features and specifications of the module, including the supported MCU, wake word options, and user-defined commands.
  • Learn about its compatibility with various hardware platforms such as Arduino boards, Raspberry Pi, SBCs, and ESP32 modules.
  1. Arduino Programming for Voice Recognition:
  • Step-by-step guide on setting up the module with Arduino and establishing communication via I2C or UART.
  • Get hands-on with programming examples to understand how to implement voice commands and customize wake words.
  1. Customizing Voice Commands:
  • Unlock the module’s potential by creating personalized voice commands to suit your project’s specific needs.
  • Discover the process of training the module to recognize and respond to user-defined commands, expanding its functionality.
  1. Real-World Applications:
  • Explore diverse applications where offline voice recognition can be integrated, from home automation and robotics to assistive technology and IoT projects.
  • Gain insights into how offline voice control can enhance user experience and accessibility in various domains.

Conclusion:
With the Offline Voice Recognition Module and Arduino programming, developers and hobbyists can tap into the power of voice control without the need for an internet connection. Unlock the potential of custom voice commands and elevate your projects to new heights. Explore the possibilities and revolutionize the way your creations interact with the world.

Introducing DFRobot’s Gravity: Offline Voice Recognition Sensor for Arduino Programming and Custom Voice Commands

“Discover a new solution: DFRobot’s Gravity: Offline Voice Recognition Sensor offers Arduino compatibility and customizable voice commands, solving previous documentation and usability challenges

Discover an affordable offline voice recognition module supporting Arduino programming and custom voice commands. Enhance your projects with improved privacy and low latency. Previous challenges have been overcome with the new “Gravity: Offline Voice Recognition Sensor – I2C & UART” module from DFRobot. Explore its user-friendly customization features and documentation in this article.

Offline Voice Recognition Sensor

Here are the specifications of the Gravity Voice Recognition DF2301QG module:

  • Voice recognition module: WS-2520-TR module
  • MCU: To be determined
  • 121 pre-set voice commands, including one fixed wake word
  • Support for 1 user-defined wake word and 17 custom commands
  • Audio:
    • Output: Built-in speaker and external speaker interface
    • Input: Dual microphones with -28dB sensitivity
  • Host interface: I2C (0x64 address) and UART via 4-pin “Gravity” connector; compatible with 3.3V and 5V
  • Miscellaneous features: Power LED (red), recognition status LED (blue)
  • Supply Voltage: 3.3V to 5V
  • Maximum current: Up to 370 mA (at 5V)
  • Dimensions: 49mm x 32mm

What sets this module apart is its user-friendly nature compared to previous offline voice modules. While the default wake word is “Hello robot,” you have the flexibility to change it by simply using the voice command “learning wake word” and repeating your new wake word three times, like “hello, there.”

Similarly, the module offers over 100 pre-set commands such as “Turn left ninety degrees,” “Tag recognition,” “Forget,” “Turn off the light,” and more. Additionally, users can teach the module up to 17 custom commands by using the voice command “Learning command word” for a specific ID. Registering the command involves repeating it three times. You’ll find detailed instructions on all these features in the wiki documentation.

Offline Voice Recognition Module: Arduino Programming & Custom Voice Commands

In the article, you’ll find the DF2301QG offline voice recognition module connected to an Arduino clone via an I2C board. However, it has the flexibility to support various other hardware options, including different Arduino boards, Raspberry Pi boards, SBCs (Single Board Computers), ESP32 modules, and more, through UART or I2C interfaces.

Up to this point, no programming has been done. The customization of the module has been solely voice-based. Each wake word and voice command is associated with its unique ID, which is utilized in an Arduino Sketch. Below is an example code snippet showcasing the usage of the DF2301Q Arduino library after its installation.

#include "DFRobot_DF2301Q.h"

#define Led 8

//I2C communication
DFRobot_DF2301Q_I2C asr;

void setup() {
  Serial.begin(115200);

  pinMode(Led, OUTPUT);    //Init LED pin to output mode
  digitalWrite(Led, LOW);  //Set LED pin to low 

  // Init the sensor
  while (!(asr.begin())) {
    Serial.println("Communication with device failed, please check connection");
    delay(3000);
  }
  Serial.println("Begin ok!");

  /**
   * @brief Set voice volume
   * @param voc - Volume value(1~7)
   */
  asr.setVolume(4);

  /**
     @brief Set mute mode
     @param mode - Mute mode; set value 1: mute, 0: unmute
  */
  asr.setMuteMode(0);

  /**
     @brief Set wake-up duration
     @param wakeTime - Wake-up duration (0-255)
  */
  asr.setWakeTime(20);

  /**
     @brief Get wake-up duration
     @return The currently-set wake-up period
  */
  uint8_t wakeTime = 0;
  wakeTime = asr.getWakeTime();
  Serial.print("wakeTime = ");
  Serial.println(wakeTime);

  // asr.playByCMDID(1);   // Wake-up command

  /**
     @brief Play the corresponding reply audio according to the ID
     @param CMDID - command word ID
  */
  //asr.playByCMDID(23);  // Command word ID
}

void loop() {
  /**
     @brief Get the ID corresponding to the command word 
     @return Return the obtained command word ID, returning 0 means no valid ID is obtained
  */
  uint8_t CMDID = asr.getCMDID();
  switch (CMDID) {
    case 103:                                                  //If the command is “Turn on the light”
      digitalWrite(Led, HIGH);                                 //Turn on the LED
      Serial.println("received'Turn on the light',command flag'103'");  //Serial transmits "received"Turn on the light",command flag"103
      break;

    case 104:                                                  //If the command is “Turn off the light”
      digitalWrite(Led, LOW);                                  //Turn off the LED
      Serial.println("received'Turn off the light',command flag'104'");  //The serial transmits "received"Turn off the light",command flag"104""
      break;

    default:
      if (CMDID != 0) {
        Serial.print("CMDID = ");  //Printing command ID
        Serial.println(CMDID);
      }
  }
  delay(300);
}