Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Voice-Controlled Buzzer System with VC-02 Module

View and Edit Project In Cirkit DesignerImage of Voice-Controlled Buzzer System with VC-02 Module

Circuit Documentation

Summary of the Circuit

The circuit in question consists of a VC-02 Module, a buzzer, and a 5v battery. The VC-02 Module is the central component and is responsible for voice command recognition and controlling the buzzer. The buzzer serves as an output device that can make a sound when triggered by the VC-02 Module. The 5v battery provides the necessary power to the circuit.

Component List

VC-02 Module

Buzzer

5v Battery

Wiring Details

VC-02 Module

Buzzer

5v Battery

Documented Code

The following code is written for the VC-02 Module and is responsible for initializing the module, handling voice commands, and controlling the buzzer.

// Define the pin connected to the buzzer
#define BUZZER_PIN 7 // Assuming TX(IOB7) is mapped to pin 7

// Function to initialize the VC-02 Module
void initializeVC02() {
    Serial.begin(9600); // Initialize serial communication at 9600 baud rate
    // Additional initialization code for VC-02 if required
}

// Function to handle recognized voice commands
void handleVoiceCommand(String command) {
    if (command == "can you make a sound") {
        digitalWrite(BUZZER_PIN, HIGH); // Turn the buzzer on
        delay(1000); // Keep the buzzer on for 1 second
        digitalWrite(BUZZER_PIN, LOW); // Turn the buzzer off
    }
}

// Setup function to initialize the pin modes and VC-02 Module
void setup() {
    // Set the buzzer pin as an output
    pinMode(BUZZER_PIN, OUTPUT);
    
    // Initialize the VC-02 Module
    initializeVC02();
}

// Main loop function
void loop() {
    // Check if data is available from the VC-02 Module
    if (Serial.available() > 0) {
        // Read the incoming command
        String command = Serial.readStringUntil('\n');
        
        // Handle the recognized voice command
        handleVoiceCommand(command);
    }
    
    // Add a small delay to avoid overwhelming the module
    delay(100);
}

This code is stored in a file named vc.ino. The code initializes the serial communication for the VC-02 Module, sets up the buzzer pin, and contains a loop that listens for voice commands. When the command "can you make a sound" is recognized, the buzzer is activated for one second.