To create a new project in MakeCode web version, click on the "more" button (gear icon) in the top right corner. From the drop-down menu, select "Extensions" to open the extension interface.
Type "https://github.com/DFRobot/pxt-DFRobot_voiceRecognition.git " in the search bar and click on the magnifying glass icon to search. You will see the voiceRecognition plugin (as shown in the image below). Click on it to load the plugin into your project.
In the programming interface, you will see the Voice Recognition (SEN0539) module. Clicking on it will bring up the command blocks.
This example shows how to connect the Voice Recognition module to the Micro:bit board, and then read speech recognition results from the Voice Recognition module. The Micro:bit controls the LED matrix to display smiley faces, sad faces, and hearts.The communication interface between the Voice Recognition (SEN0539) and the Micro:bit uses the I2C interface.
Hardware
micro:bit V2 x 1
4-pin connection cable (or Dupont cable)
Properly connect the micro:bit motherboard and IO expansion board, and set the communication mode selection switch of the voice recognition module to I2C end according to the diagram below, then connect it to the expansion board.
Below: Wiring: D/T--->SDA. C/R--->SCL
To wake up the voice recognition module, say either the fixed wake-up word or the learned wake-up word. To display a smiley face on the LED matrix of the micro:bit, say "Display smiley face". To display a sad face on the micro:bit, say "Display crying face". To display a heart on the micro:bit, say "Display heart". To turn off all LED matrix displays on the micro:bit, say "Turn off dot matrix".
Initialization. It only needs to be executed once and should be placed at the beginning of the main program. The communication mode selection switch for the speech recognition module needs to be set to I2C end.
Adjust the volume of the module. The range of the volume is from 0 to 7, with a larger number representing a higher volume.
Enable or disable the mute mode of the module.
Configure the time in seconds for the module to return to sleep mode after awakening. This time will be refreshed after each successful command recognition.
Retrieve the duration in seconds for the module to return to sleep mode after awakening.
Play the corresponding response for the recognized command word.
Select the Wake-up Word ID.
Retrieve the recognition result from the speech recognition and save it to the recognition result module.
Determine if the speech recognition has recognized the command.
Select the ID of the command word to be learned.
Select a fixed command word ID.
Select the ID of the word to be learned.
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.
Get Gravity: Voice Recognition Sensor - I2C & UART from DFRobot Store or DFRobot Distributor.
Voice recognition is a computer technology that recognizes and converts speech signals into editable text or operational commands through analysis. It allows people to interact with computers by speaking without using a mouse, keyboard, or other input devices. Voice recognition technology has been widely used in applications such as voice assistants, smart homes, voice search, and voice recognition notebooks.
This Gravity: Offline Voice Recognition Sensor is built around an offline voice recognition chip, which can be directly used without an internet connection. It comes with 121 built-in fixed command words and supports the addition of 17 custom command words. Meanwhile, this voice recognition module compatibility with multiple common controllers enables it to provide a flexible solution for makers and electronics enthusiasts in terms of voice interaction. It can be applied to any application that requires voice control or interaction, such as various smart home appliances, toys, lighting fixtures, and robotics projects, among others.
The Voice Recognition module is equipped with a self-learning function and supports the addition of 17 custom command words. Any sound could be trained as a command, such as whistling, snapping, or even cat meows, which brings great flexibility to interactive audio projects.
For instance automatic pet feeder. When a cat emits a meow, the offline voice recognition module can recognize the meow and trigger the feeder to automatically provide food for the cat. This innovative design ensures that the owner can promptly meet the cat's dietary needs. Moreover, the product is equipped with excellent noise resistance and long-distance recognition capabilities, allowing for precise identification of the cat's meows even in noisy environments.
The offline voice recognition module boasts a user-friendly design. It comes with 121 built-in fixed command words, eliminating the need for users to record their own voices. For instance, in an intelligent window system, when it starts to rain or thunder, there's no need for manual window operation. The offline voice recognition module can recognize the pre-set command word "close the window," triggering the automatic closing of the window to cope with sudden weather changes.
The module features a dual microphone design with better noise resistance and a longer recognition distance, making it relatively accurate and reliable even in noisy environments. It comes with a built-in speaker and an external speaker interface for real-time voice feedback of recognition results.
For instance, one can wake up a voice assistant using a wake-up word, and the assistant promptly responds and begins learning or utilizing command words. When learning or deleting command words, the voice assistant also provides immediate feedback on the success of the operation. This greatly enhances the user's experience and convenience.
The module boasts high compatibility, supporting both I2C and UART communication methods, while also being compatible with various 3.3V or 5V controllers, such as micro:bit, Arduino (Arduino UNO, Arduino Leonardo, Arduino MEGA), Raspberry Pi, FireBeetle series, and more. This provides a flexible solution for building smart home systems, robotics projects, and more.
Self-learning function: Control the module to learn command words by the voice, and any audio can be trained as a command
Support I2C and UART, with a Gravity interface
Compatible with 3.3V/5V
Built-in with 121 commonly-used fixed command words
The module has a built-in speaker and an interface for an external speaker, which can provide real-* time voice feedback on recognition results
Equipped with power indicator (red) and recognition status indicator (blue)
Dual microphones provide better noise resistance and longer recognition distance
Compatible with Arduino controllers: Arduino UNO, Arduino Leonardo, Arduino MEGA, FireBeetle series controllers, Raspberry Pi, ESP32
Operating Voltage: 3.3 - 5V
Maximum Operating Current: ≤370 mA (5V)
Communication: I2C/UART
I2C Address: 0x64
Fixed Command: 121
Fixed Wake-up Command: 1
Custom Command: 17
Learning Activation Command: 1
Onboard Microphone Sensitivity: -28db
Module Size: 49×32 mm/1.93×1.26”
Wake-up word
The wake-up word refers to the word that switches a product from standby mode to operational mode. It serves as the initial point of interaction between users and voice-enabled devices.
Learning wake-up word:
Initiate the voice assistant by employing the default wake-up word, then utter "Learning wake word" Follow the prompts to learn the new wake-up word (prior to each learning command, it is necessary to remove the previously learned wake-up word; kindly refer to the instructions for wake-up word and command phrase deletion)
Indication: Learning now, be quiet, please say the wake word to be learned!
The designated wake-up word to be acquired (taking "hello, there" as an example): "hello, there"
Indication: Learning successful, please say it again!
The designated wake-up word to be acquired : "hello, there"
Prompt: Learning successful, please say it again!
The designated wake-up word to be acquired : "hello, there"
Prompt: Ok, learning completed!
Once the learning process is accomplished, you will be able to utilize the phrase "hello, there" to awaken the voice assistant!
Fixed command words:
Fixed command words refers to the designated vocabulary used by users to issue specific instructions to voice interactive products, enabling effective communication with them.
Learning command words:
Use a wake-up word (default or learned) to wake up the voice assistant, and then say "Learning command word" to initiate the process of learning command phrases, following the provided prompts. Before each session of learning command phrases, it is necessary to delete the previously learned command phrases. Please refer to instructions on how to delete wake-up words and command phrases.
Indication: Learning now, be quiet, please learn the command word according to the prompt! Please say the first command to be learned!
Command phrase to be learned (using "Turn on red light" as an example): "Turn on red light"
Indication: Learning successful, please say it again!
Command phrase to be learned : "Turn on red light"
Indication: Learning successful, please say it again!
Command phrase to be learned : "Turn on red light"
Indication: OK, learned the first command successfully! Please say the second command to be learned!
... (Continue learning)
Command phrase to exit learning mode: "Exit learning"
After the completion of the learning process, an ID will be automatically generated. Please refer to the subsequent document titled "Command Words/Wake-up Words & ID Table" By utilizing this unique ID, you can author programs to exercise control accordingly.
Delete Wake Words and Command Words:
Summon the voice assistant using the awakening word (default or customized), and articulate the phrase "I want to delete" Follow the prompts to eliminate the specified command phrase as instructed.
Indication: Do you want to delete the learned wake word or command word?
Delete command word: Remove the previously acquired command phrases.
Delete wake word: Erase the learned awakening words from the system.
Delete all: Eliminate the assimilated awakening utterances and command phrases from memory.
Exit deleting.