Petoi Voice Recognition Module is a simple Arduino compatible accessory to make your Bittle or Nybble robots much more lively. It can recognize upto 35 preset commands and 10 other commands that you can record yourself (in any language). Since the voice recognition happens on chip, it is extremely fast, and the Bittle robot reacts quickly. Take a look at the following video to understand how the voice module works.
You can use the voice module in three different ways. If you have a NyBoard, the voice module can be attached to Nyboard via the Grover connector pins D8, and D9. With a BiBoard, you need the Biboard extension hat, and you can then attach the module to it. The voice module also comes built in the Petoi BittleX. The following figure shows how to connect the voice module to Nyboard.
Programming the Voice Module
The best part of the voice module is that you can program Bittle to respond to your your own commands. In the above video, we programmed Bittle to respond to the word “Danger” and move a few steps backwards. Did a similar thing for the word “Caution”. Let us show you how to program.
You first need to edit the voice.h file to customize your commands. The default code looks like:
const char voice1[] PROGMEM = "T"; //call the last skill data sent by the Skill Composer ## Will cause bug when skill is longer than 5 frames
#ifdef BITTLE
const char voice2[] PROGMEM = "kpu1"; //单手俯卧撑 single-handed pushups
#elif defined NYBBLE
const char voice2[] PROGMEM = "kwsf"; //洗脸 wash face
#endif
const char voice3[] PROGMEM = "m0 80 0 -80"; //动头 move head
const char voice4[] PROGMEM = "kmw"; //moonwalk
const char voice5[] PROGMEM = "b14,8,14,8,21,8,21,8,23,8,23,8,21,4"; //小星星 twinkle star
const char voice6[] PROGMEM = "6th";
const char voice7[] PROGMEM = "7th";
const char voice8[] PROGMEM = "8th";
const char voice9[] PROGMEM = "9th";
const char voice10[] PROGMEM = "10th";
const char *const voiceTable[] PROGMEM = {
voice1,
voice2,
voice3,
voice4,
voice5,
voice6,
voice7,
voice8,
voice9,
voice10,
};
To customize, you need to alter the voiceTable to reflect your own commands. Note that since the voice module supports recording up to 10 voice commands, this table also has 10 different entries. As an example, in our case, we made Bittle walk back upon hearing the word “Danger”. So the change is to code voice1 to:
const char voice1[] PROGMEM = "kbk";
Remember that once you made your changes, you would have to recompile and upload the OpenCat firmware. Also remember to un-comment the #define VOICE line in OpenCat.ino
Next, you need to program the command in the Voice Module. Power up Bittle with the updated firmware. By default, the voice module works in Mandarin Chinese, so you need to switch it to English by using the phrase “Bing Bing”. Test that the Voice Module works by giving it a few simple commands such as “stretch” or “sit”. Then you can begin programming the module by saying “Start Learning”. You can follow the verbal instructions to teach as many voice commands (up to 10). Remember to match the voice commands with what you put in the code. Saying “Stop Learning” terminates recording the voice commands at any point in time.
Your Bittle is now ready to respond to your voice commands. This feature is very powerful, because you can now build your own skills and then verbally ask Bittle to play that skill.
Advanced Usage
The voice module can be combined with other features of the Bittle such as the skill composer. This allows you to create your own skill, and program Bittle to respond to a voice command with that skill. In this way, you get a lot of flexibility in using the voice commands to control your Bittle.
Summary
In summary, the Petoi Voice Recognition module provides you a lot of opportunities to enhance your Bittle experience at a small price. You can play with voice recognition on a chip, and learn about the subtilties on how devices can repond to voice. If you had a chance to explore the Petoi Voice Module, please add to the discussion with your comments below.