Voice Recognition Module Control

Voice Recognition Module Control

Introduction

This experiment demonstrates how to control devices (e.g., LED) using voice commands with a voice recognition module.

Voice Recognition Module

Components Needed

Circuit Setup

  1. Connect the voice recognition module to the Arduino using the appropriate pins for TX and RX.
  2. Connect the LED to one of the digital pins of the Arduino, using a 220-ohm resistor in series.

Ensure that the module is powered and properly wired to the Arduino.

Voice Recognition Circuit Setup

Code for Voice Recognition Module Control

Upload the following code to your Arduino to control an LED using voice commands:


#include 

VoiceRecognitionV3 voiceRecognition;
int ledPin = 13;

void setup() {
  pinMode(ledPin, OUTPUT);
  voiceRecognition.begin();
  voiceRecognition.load(1, "voice_commands.dat");  // Load the voice commands
}

void loop() {
  int voiceCommand = voiceRecognition.readVoice();
  if (voiceCommand == 1) {
    digitalWrite(ledPin, HIGH);  // Turn on LED
  } else if (voiceCommand == 2) {
    digitalWrite(ledPin, LOW);   // Turn off LED
  }
}
            

Explanation

The voice recognition module listens for predefined commands. When a recognized command is spoken, the corresponding action (e.g., turning an LED on/off) is performed.

Troubleshooting