Voice Recognition and Speech using Arduino

Did you ever wanted to be able to tell the robot to do something for you? Did you find that you needed to use a computer for that reason alone? What about have the robot tell you something about what he was doing or just a simple response to your commands? Well, now it is possible to do both functions without the need for a computer.

The Voice Recognition it is done by a special module called VRbot, that you can buy from RobotShop or other places. To use it, all you need is to set a serial link and a few bits of code to get the basic Speaker Independent commands that are already programmed in the chip working. If you need to add more commands, the chip allows you to train up to 32 Speaker Dependent commands, by using the special VRbot GUI software.

The Text to Speech output is done by a software Speech Synthesizer written by our member Webbot some time ago. I have converted it into an Arduino library that people can import it in their project. 


This tutorial will take you step by step through the process of integrating voice commands and speech into your robot, as I have done it in MiniEric robot. It uses the Arduino software, but there are little modifications needed for the code to work on any other robot that uses AVR micros.



1. Implementing Voice Recognition in your robot.

2. Implementing Text to Speech in your robot.

1. Implementing Voice Recognition in your robot.

There are several ways to implement Voice Recognition into a robot. One way is to have your main microcontroller chatting over a serial line with the VRbot module, but this means it will have to stay on a loop until it recognizes the trigger word and then do something based on what command follows. An other way is to use a dedicated microcontroller that is somehow connected to the main microcontroller (using a serial line, the I2C bus, or whatever other means). This way you can have your robot do something until the dedicated microcontroller receives a vocal command and transmits it to the main one. I am going to show you how to add a dedicated microcontroller to your robot and how use the I2C interface to communicate with the main microcontroller. First, you need to order a VRbot module. Then you have to download the Arduino Demo PDF and the VRbot GUI software from Tigal. They already have a demo code for POP-BOT. I have modified their code to adapt it for my robot and made a library (see the attached file) that takes care of the bit bang serial communication with the VRbot module. Play with the VRbot module and train new commands. The VRbot GUI software can talk with the VRbot module directly, using any serial adapter, or through the microcontroller board it is connected to. The secon method did not work for me as it was written in the example code, so I used a FTDI Basic board that is basically a USB serial adapter and a few wires to make the connections. The FTDI Basic board also powers the VRbot module, so you don't need anything else. VRbot module comes with 4 wires, so you need to connect the Black wire to GND, the Red wire to 5V (or Vcc), the White wire to Tx and the Blue wire to Rx. The open up your VRbot GUI software, select the COMM port your FTDI is using and click the Connect button. If it doesn't connect, reverse the Blue and White wires. Read the PDF file, it goes in depth through training new commands to your VRbot module. Make sure you write down the Group number and the command number inside that group for each new command you train. You will need it when you program the actions triggered by that command. You may take a look at their sample code for the POP-BOT, just to get an idea how things are going. The POP-BOT uses an LCD to display the commands, a LED and a piezo speaker that beeps when the command is recognized. You will need at least one confirmation method, let's say a simple LED that lits up when waiting for a command and turns off after the command is recognized.