Skip to product information
1 of 1

Blue PCB Electronics

5AAA Voice Recognition Module V3

5AAA Voice Recognition Module V3

Regular price Dhs. 110.00
Regular price Sale price Dhs. 110.00
Sale Sold out
View full details

Description

It is one of the most compact and easy-to-control voice recognition modules on the market.

There are two ways to use this module, using the serial port or through the built-in GPIO pins. The V3 board has the capacity to store up to 80 voice commands, each with a duration of 1500 milliseconds. This one will not convert your commands to text but will compare them with an already recorded set of voices. So technically, there are no language barriers to using this product. You can record your command in any language, or literally, any sound can be recorded and used as a command. So you need to train it first before you let it recognize any voice commands.

If you're using the module with it's GPIO pins, the module will deliver outputs for only 7 commands out of the 80. For this method, you need to select and load 7 commands into the recognizer, and the recognizer will send outputs to the respective GPIO pins if any of these voice commands get recognized. As we're using this with Arduino, we don't need to worry about the limited features.

The device works in an input voltage range of 4.5–5 volts and will draw a current of less than 40 mA. This module can work with 99% recognition accuracy if it is used under ideal conditions. The choice of microphone and the noise in the environment play a vital role in affecting the performance of the module. It's better to choose a microphone with good sensitivity and try to reduce the noise in your background while giving commands to get the maximum performance out of the module.

Datasheet

Features:

  • Recognizes 7 pre-programmed voice commands
  • Can be trained with new voice commands
  • On-board microphone for voice input
  • Input voltage: 4.5-5.5V DC
  • Current consumption: <40mA
  • Output format: TTL-level serial port
  • Supports baud rates: 9600, 19200, 38400, 57600, 115200
  • Can be controlled by any microcontroller with TTL serial port
  • Small size: 30mm x 47.5mm
  • Comes with header pins for easy connection to a breadboard or PCB.

Package includes

  1. Voice Recognition Module x1
  2. Microphone x1 

Pin-out description

  • VCC: positive power supply pin
  • GND: ground power supply pin
  • RXD: Receiver pin from Arduino
  • TXD: Transmitter pinto Arduino

Required Parts

  • Arduino Uno
  • USB cable for Arduino Uno
  • Dupont Wire Set
  • Voice Recognition Module V3

Connecting the Voice Recognition Module

In this section, I will show you how to connect the Voice Recognition Module V3 to the Arduino. Luckily, it is very simple.

Connecting the Voice Recognition Module to the Arduino

As you can see, we only need to connect power (5V and GND) to the module and then connect the UART interface:

  • RXD -> Pin 2
  • TXD -> Pin 3

Make sure that RXD is connected to Pin 3 and TXD to Pin 2. It is a common mistake to swap those and even the documentation within the code examples for the module is confusing this.

The picture below shows you how this circuit looks in reality. However, I added an additional LED and used different wires since my module did not come with soldered pins. Though later, I soldered the pins on and switched to Dupont wires for better connection.

We will use the internal LED of Arduino to test the voice control but if you want to add an external LED (like I did) here is the schematics for it. Note that we connect the LED to pin 5, which means you will have to change that in the code shown below. Also don’t forget the 220 Ohm resistor to limit the current through the LED and avoid damaging your Arduino.

Connecting the Voice Recognition Module and an LED to the Arduino

Installing and Testing the Software

We start by downloading the VoiceRecognitionV3 library from the github repo.

DownloadVoiceRecognitionV3master.zip

ext we need to add the library to the Arduino environment. For that go to Sketch -> Include Library -> Add .ZIP library ... and select the file location where you downloaded VoiceRecognitionV3-master.zip to.

Add the VoiceRecognitionV3 library to the Arduino environment

Load example code

After that you should find some example code for the library under File -> Examples -> VoiceRecognitionV3-master. Open the vr_sample_train example.

Open example file vr_sample_train

Compile the software and download it to your Arduino as usual. Next, open the Serial Monitor, set the baud rate to 115200 and the line ending to New Line. See the picture below.Settings for Serial Monitor

Setting the correct baud rate is important, otherwise the Arduino will not be able to communicate with the module. Check this and if you have issues also check what baud rate is actually set in the code.

Check status of Voice Recognizer

If you now restart your Arduino or reload the software you should see the following output on your Serial Monitor.

Serial Monitor output for vr_sample_train after restart

Finally, type the command vr in the message box of the Serial Monitor and hit Enter. If everything is working correctly, you should see the status of the voice recognizer (vr) shown below.

Serial Monitor shows status of voice recognizer

It indicates that we can communicate with the voice recognition module and that there are currently none of the 7 available commands (Record) are loaded. The system is untrained. But we are going to change that in the next section.

If you can’t see the status of the voice recognizer make sure that your wiring is correct. TXD needs to be connected to pin 2 and RXD to pin 3. Also make sure that the module has power. The yellow power LED should be on.

Training Voice Commands

Assuming you still have vr_sample_train uploaded to the Arduino and it is running, we can now start to train the module to recognize voice commands. Type “train” in the message box and then the number (0..79) this command should be stored under. For instance, train 0 and then hit Enter.

Training the Voice Recognition Module

The LED on the module will switch to yellow blinking mode and then to a red color. At the same time the line “Record 0 Speak now” will appear on the Serial Monitor. Say your command, for example “Light on” and if successful the line “Record 0 Speak again” will appear. If unsuccessful, you will read “Record 0 Cann't matched“. (yes, I know the spelling and grammar are wrong, but that’s what it says 😉

After two successful recordings the Serial Monitor will indicate that the training was a success and that the command is now stored under index 0: “Record 0 Trained“

Repeat this process for a second command “Light off” by entering “train 1” in the message box. Once done, you can verify if the commands are trained. Type “record 0” and then “record 1” in the message box and you should see the following picture.

Checking the commands recorded in the Voice Recognition Module

Testing the Trained Commands

After the successful train type “load 0 1” to load the commands and start the recognition. The LEDs should now blink in a yellow color; indicating that the module is listening. If you now say your trained commands, for instance “Light on” followed by “Light off”, you should see the following output.

Testing the trained commands

If the yellow LED is not blinking the module is not listing. I found that this to happen occasionally and the only way to resolve this issue was to quickly remove and then reattach the power supply. Others have reported this issue as well but no good solution was reported. It seems that the module is somewhat finicky.

In the next section we will use the trained commands to switch the built-in LED of the Arduino on and off.

Controlling an LED with your Voice

You could load the vr_sample_control_led example to control the built in LED of the Arduino with your voice but I found the code unnecessarily complex and partially confusing. For instance, you will find this piece of code in the example:

/**        
 * Connection
 * Arduino    VoiceRecognitionModule
 * 2   ------->     TX
 * 3   ------->     RX
 */
VR myVR(2,3);    // 2:RX 3:TX, you can choose your favourite pins.

It contradicts itself in the pin assignment. Is RX=2 or is RX=3? It turns out the correct assignment is RX=3!.

Anyway, we will implement our own solution that is easier to understand and to extend. See the complete solution for controlling an LED below.


#include "SoftwareSerial.h"
#include "VoiceRecognitionV3.h"

VR vr(2, 3);  // 2:TX 3:RX!
uint8_t buf[64];

const int led = 13;  // built-in
const uint8_t lightOn = 0;
const uint8_t lightOff = 1;

void setup() {
  vr.begin(9600);
  Serial.begin(115200);
  pinMode(led, OUTPUT);
  vr.load(lightOn);
  vr.load(lightOff);
}

void loop() {
  if (vr.recognize(buf, 50) > 0) {
    switch (buf[1]) {
      case lightOn:
        digitalWrite(led, HIGH);
        break;
      case lightOff:
        digitalWrite(led, LOW);
        break;
    }
  }
}

Let’s have a closer look at the individual sections of the code.

Constants and Variables

We start by including the necessary libraries and defining the necessary constants and variables.

include "SoftwareSerial.h"
#include "VoiceRecognitionV3.h"

VR vr(2, 3);  // 2:TX 3:RX!
uint8_t buf[64];

const int led = 13;  // built-in
const uint8_t lightOn = 0;
const uint8_t lightOff = 1;

Here, we include the SoftwareSerial library to enable serial communication, and the VoiceRecognitionV3 library to interface with the speech recognition module. We create an instance of the VR class, specifying the RX and TX pins for communication. We also define an array called buf to store the recognized voice commands.

Additionally, we define the pin number for the built-in LED and two constants to represent the commands for turning the light on and off. If you want to control an external LED change the led constant to the pin the LED to connected to, e.g. pin 5 as in the schematic example shown before.

Setup function

In the setup() function, we initialize the speech recognition module, set the baud rate for serial communication, set the LED pin as an output, and load the voice commands for turning the light on and off.

void setup() {
  vr.begin(9600);
  Serial.begin(115200);
  pinMode(led, OUTPUT);
  vr.load(lightOn);
  vr.load(lightOff);
}

We start by calling the begin() function of the VR instance to initialize the module with a baud rate of 9600. We also initialize the serial communication with a baud rate of 115200. The LED pin is set as an output using the pinMode() function.

Finally, we load the voice commands for turning the light on and off using the load() function of the VR instance. Remember that you can only load 7 commands at a time. But you can use commands to switch or load other commands to build chains of commands.

Loop function

In the loop() function, we continuously check for voice commands and control the LED accordingly.

void loop() {
  int ret = vr.recognize(buf, 50);
  if (ret == -1) return;

  switch (buf[1]) {
    case lightOn:
      digitalWrite(led, HIGH);
      break;
    case lightOff:
      digitalWrite(led, LOW);
      break;
  }
}

Fist, we call the recognize() function of the VR instance to check for voice commands. The recognized command is stored in the buf array. If no command is recognized, the function returns -1 and we exit the loop. Otherwise, we check the value of the second element in the buf array (buf[1]) to determine the command. If the command id is lightOn, we set the LED pin to HIGH using the digitalWrite() function. If the command is lightOff, we set the LED pin to LOW.

Should you have problems understanding the code for controlling an LED have a look at our tutorial How To Blink An LED Using Arduino (4 Different Ways). And if you want to switch a relay instead of an led, just replace the LED by a Relay Module. For more details, see the tutorial How To Use A Relay With Arduino.

And that’s it. Now you have a voice controlled LED. Have fun playing with it ; )

Applications

Here are a few ideas of how you can use this module in your projects:

  1. Home Automation: Controlling your lights, appliances, and other devices with just your voice..
  2. Voice-Activated Security System: Enhance the security of your home or office by implementing a voice-activated security system.
  3. Voice-Controlled Robotics: With the Voice Recognition Module you can command your robots to perform specific actions or navigate through obstacles using voice commands.
  4. Voice-Enabled Assistants: Create your own voice-enabled assistant, similar to Amazon Alexa or Google Assistant.
  5. Accessibility Solutions: The Voice Recognition Module can be used to develop assistive technologies for individuals with disabilities. For example, you can create a voice-controlled wheelchair or a hands-free communication device for people with limited mobility.
  6. Educational Projects: Incorporate voice recognition into educational projects to make learning more interactive and engaging. Students can use voice commands to control simulations, answer quiz questions, or interact with virtual characters.

Conclusion

The Voice Recognition Module V3 provides a simple way to control devices using your voice. Since it does not rely on a server with an internet connection for the voice recognition, the recognition is fast and privacy concerns are not an issue.

On the other hand, the voice recognition is speaker dependent and the recognition is limited to simple phrases. Also, I found the recognition accuracy of very low, definitely below the 99% stated. However, your experience might be different.