Jump to content
Electronics-Lab.com Community

Simple Voice Automation with DFRobot Beetle ESP32 C6


CETECH

Recommended Posts

Let’s create an offline voice-controlled LED system using the DFRobot Beetle ESP32 C6 and the DFRobot Offline Voice Learning Sensor. This project combines hardware components and programming to create an interactive system that responds to voice commands. Here’s a detailed step-by-step guide:

1️⃣Project Overview

We’ll build a voice-controlled LED system that turns on and off NeoPixel lights based on spoken commands. The DFRobot Gravity Offline Voice Recognition Sensor will listen for voice input, and the Beetle ESP32 C6 will process the commands and control the LED.

Get PCBs for Your Projects Manufactured

2_sS1dUXE2bz.PNG?auto=compress%2Cformat&
 

You must check out PCBWAY for ordering PCBs online for cheap!

You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Also, check out this useful blog on PCBWay Plugin for KiCad from here. Using this plugin, you can directly order PCBs in just one click after completing your design in KiCad.

2️⃣Components Needed

  • DFRobot Beetle ESP32 C6: This compact ESP32 board will serve as our microcontroller.
image_2vI7Ad6EQo.png?auto=compress%2Cfor
 
  • DFRobot Gravity Offline Voice Recognition Sensor: An offline voice recognition module with built-in command words and self-learning capabilities.
image_djnnyH9PtF.png?auto=compress%2Cfor
 
  • Breadboard and Jumper Wires: For connecting the components.

3️⃣Wiring Diagram

  • Connect the DFRobot Gravity Sensor to the Beetle ESP32 C6 using jumper wires.
image_Fha3leVK5Z.png?auto=compress%2Cfor
 

4️⃣ Install the Arduino IDE :

  • If you haven’t already, download and install the Arduino IDE.
image_JPwaqY3cer.png?auto=compress%2Cfor
 

5️⃣Add the ESP32 Board to Arduino IDE:

Follow these steps to add the ESP32 board to your Arduino IDE:

image_a6NZC5JDkP.png?auto=compress%2Cfor
 
  • Go to Tools > Board > Boards Manager.
  • Search for “esp32” and install the “esp32” package.
image_XlYIjxeSx3.png?auto=compress%2Cfor
 
  • Select the Beetle ESP32 C6 as your board under Tools > Board.
image_GgXtwSgwHt.png?auto=compress%2Cfor
 

6️⃣Download the DFRobot Voice Recognition Library:

image_7jKB9Bc3ud.png?auto=compress%2Cfor
 

7️⃣Write the Arduino Sketch:

  • Create a new Arduino sketch (File > New).
  • Copy and paste the following sample code into your sketch:
#include "DFRobot_DF2301Q.h"
DFRobot_DF2301Q_I2C DF2301Q;
int led = 15;
void setup() {

    Serial.begin(115200);
    pinMode(led, OUTPUT);
    while (!(DF2301Q.begin())) {
        Serial.println("Communication with device failed, please check connection");
        delay(3000);
    }
    Serial.println("Begin ok!");
    DF2301Q.setVolume(7);
    DF2301Q.setMuteMode(0);
    DF2301Q.setWakeTime(15);
    uint8_t wakeTime = 0;
    wakeTime = DF2301Q.getWakeTime();
    Serial.print("wakeTime = ");
    Serial.println(wakeTime);
    DF2301Q.playByCMDID(23);  // Common word ID

}

void loop() {

    uint8_t CMDID = 0;
    CMDID = DF2301Q.getCMDID();
    Serial.print("CMDID = ");
    Serial.println(CMDID);
    if (CMDID == 5) {
        digitalWrite(led, HIGH);
    }
    if (CMDID == 6) {
        digitalWrite(led, LOW);
    }

}

8️⃣Voice Commands:

  • The DFRobot Gravity Sensor comes with 121 built-in fixed command words. You can also add 17 custom command words.

For example:

  • “Turn on the lights”
  • “Change color to blue”
  • “Dim the lights”

9️⃣Upload the Sketch:

  • Connect your Beetle ESP32 C6 to your computer via USB.
  • Select the Arduino IDE's appropriate COM port and board (ESP32 Dev Module).
  • Click the Upload button to upload the sketch to your Beetle ESP32 C6.

🔟Test Your Voice-Controlled LED System:

  • Power up your system.
  • Speak the predefined voice commands to control the led

Conclusion

image_t2gLDyjxsJ.png?auto=compress%2Cfor
 

With this setup, you’ll have an offline voice-controlled LED system that responds to your spoken commands. Feel free to expand the project by adding more custom commands or integrating other devices!

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...