Interfacing EasyVR with PIC Microcontroller

Easy VR 3.0 Speech Recognition Module is a multi-purpose speech recognition module designed to easily add versatile, robust and cost effective speech recognition capabilities to almost any application. The Easy VR 3 module can be used with any host with an UART interface powered at 3.3V – 5V, such as PIC and Arduino boards.

Some application examples include home automation, such as voice controlled light switches, locks, curtains or kitchen appliances, or adding “hearing” to the most popular robots on the market.

It can be easily plugged into a solder-less breadboard or standard prototyping board using the male headers provided.

Specification

  • A selection of 26 built-in Speaker Independent (SI) commands (available in US English, Italian, Japanese, German, Spanish, and French) for ready to run basic controls.
  • Supports up to 32 user-defined Speaker Dependent (SD) triggers or commands (any language) as well as Voice Passwords.
  • With the optional Quick T2SI Lite license you can add up to 28 Speaker Independent (SI) Vocabularies, each one with up to 12 SI different commands. Therefore an overall number of up to 336 additional SI commands!
  • SonicNet to control one or more EasyVR 3.0s wirelesly with sound tokens generated by the module or other sound source.
  • DTMF tone generation
  • Easy-to-use and simple Graphical User Interface to program Voice Commands to your robot
  • Compatible with Arduino boards that have the 1.0 Shield interface (UNO R3) and legacy boards including:
    1. Arduino Duemilanove
    2. Arduino Uno
    3. Arduino Mega
    4. Arduino Leonardo
    5. Arduino Due
  • Module can be used with any host with an UART interface (powered at 3.3V – 5V).
  • Supports direct connection to the PC on main boards with a separate USB/Serial chip and a special software-driven “bridge” mode on boards with only native USB interface, for easy access by the EasyVR Commander.
  • Simple and robust serial protocol to access and program the module through the host board.
  • Make your own sound tables using Sensory QuickSynthesis4 tool.
  • Supports remapping of serial pins used by the Shield (in SW mode).
  • The new EasyVR GUI includes a command to process and download custom sound tables to the module (overwriting existing sound table)
  • Provides a 3.5mm audio output jack suitable for headphones or as a line out
  • 8 ohm speaker output
  • Access to EasyVR I/O pins
  • LED to show feedback during recognition tasks
  • Live message recording and Fast SD/SV recognition
  • Arduino Libraries provided

Pinout

The outer headers J1 and J2 are the mikroBUS™ interface connectors, providing selectable 3.3V/5V power input  to  the module and voltage  translated digital  I/O  lines,  including: UART  receive/transmit  lines and control pins.

The header  J3 provides configurable  I/O expansion  lines  (inputs with weak  internal pull-up by default), powered at the internal logic voltage VDD.

The header J4 contains  the main analog  signals,  such as microphone  signals and amplified DAC outputs, which are also available on the internal right angle connectors J5 and J6.

The module  can  also be operated  through  the programming  connector  J7  alone, by  using  the QuickUSB Adapter Cable.

Pin Assignment

Communication protocol

Communication with the EasyVR module uses a standard UART interface compatible with 3.3-5V TTL/CMOS logical levels, according to the powering voltage VCC.

A typical connection to an MCU-based host:

 

The initial configuration at power on is 9600 baud, 8 bit data, No parity, 1 bit stop. The baud rate can be changed later to operate in the range 9600 – 115200 baud.

The  receiver  input data  line  is RX, while  the  transmitter output data  line  is TX. No handshake  lines are used.

EasyVR Commander

The EasyVR Commander software can be used to easily configure your EasyVR module connected to your PC  through  a  QuickUSB  cable,  an  adapter  board,  or  by  using  the micro-controller  host  board.

You can define groups of commands or passwords and generate a basic code template to handle them. It is required to edit the generated code to implement the application  logic, but the template contains all the functions or subroutines to handle the speech recognition tasks.

Connect  the QuickUSB  cable, an adapter board or a micro-controller host board with a  running “bridge” program6 to your PC, then check that all devices are properly turned on and start the EasyVR Commander. Select  the  serial  port  to  use  from  the  toolbar  or  the  “File”  menu,  and  then  go  with  the  “Connect” command.

There are five kinds of commands in the software (see Figure ):

  • Trigger – special group where you have the built-in SI trigger word “Robot” and you may add one user-defined SD trigger word. Trigger words are used to start the recognition process
  • Group – where you may add user-defined SD commands, organized in subsets
  • Password – special group of “voice passwords” (up to 5), using Speaker Verification (SV) technology
  • Wordset – built-in set of SI commands (for instance in Figure 3 above, the Wordset 1 is selected)
  • Grammar – custom set of SI commands (created with QuickT2SI TM Lite software).

There are also two other categories of data shown:

  • SoundTable – list of compressed audio samples (prompts, sounds, etc.) loaded into the module
  • Messages – run-time sound recordings stored on internal memory

Speech Recognition

The  recognition  function  of  the  EasyVR works on  a  single  group at  a  time,  so  that users  need  to  group together all the commands that they want to be able to use at the same time.

When  EasyVR  Commander  connects  to  the  module,  it  reads  back  all  the  user-defined  commands  and groups, which are stored into the EasyVR module non-volatile memory.

Adding a Command to the EasyVR

You can add a new command by first selecting the group in which the command needs to be created and then using the toolbar icons or the “Edit” menu.

A command should be given a label and then it should be trained twice with the user’s voice: the user will be guided throughout this process (see Figure 5) when the “Train Command” action is invoked.

Training a Command to the EasyVR

First click on the Training a command icon.

After clicking on “Phase 1” or “Phase 2” buttons, remember you have to start speaking only when you see a little window of Speak now.

If any error happens, command training will be cancelled. Errors may happen when the user’s voice is not heard correctly, there is too much background noise or when the second word heard is too different from the first one.

Testing the trained Command

If you want to test the trained commands, select the group in which the trained commands are present then click on the Test group icon on the toolbar or the “Edit” menu.

Sound Table

The  EasyVR  module  can  play  one  of  the  sounds  or  sentences  saved  on  its  internal  flash  memory.  A predefined  “beep”  sound  is  also  always  available,  even when  no  sounds  have  been  downloaded  to  the module. 

The custom sounds are organized  in a so-called “sound table” that users can prepare and build with the special QuickSynthesis TM tool. Please refer to this application’s own manual for details about the creation of a sound table. Let’s summarize the basic steps here:

  • Prepare the audio files you want to include in the sound table in WAV format, uncompressed 16-bit  22050Hz  mono.  To  create  the  sound  files  you  may  use  a  free  software  like Audacity  for example (http://audacity.sf.net)
  • Open Sensory’s QuickSynthesisTM 5 and create a new project, specifying “RSC4 family”
  • Add your WAV files and specify one of the supported compression scheme (see table below)
  • Optionally add sentences, by combining basic WAV sounds. That allows you to save memory when you  have  speech  audio  files,  if  they  share  some  pieces  (like  “You  said”  +  “One”,  “You  said”  + “Two”, and so on)
  • Build the project with QuickSynthesis TM and use default settings (“Build  linkable module”, “Load in CONST space”, “Load above or at: 0”). You will be asked to recompress new or modified sound files, just confirm and proceed
  • Now save your project and build it once again, so that the EasyVR Commander will see that your build is up to date.

The  audio  compression  formats  supported  by  the  EasyVR module  (from  highest  to  lowest  compression rate):

For audio file containing speech, the SX-3 compression is usually a good choice. If you need higher quality try  lower  compression  rates.  Please  note  that  due  to  the  sampling  rate  used,  the  audio  files  cannot contain very high frequencies (less than half the sampling rate).

Adding a wave to the sound table

Inorder to add a wave to the Sound Table we need another software called Sensory QuickSynthesis.

First of all create a new file,

Then create a new project

Then add wave files, next you get a compression window, click ok for all.

After that your wave files are added to the list. Next you need to build it by clicking on the build icon

Again click on the Build icon then OK

Import and Export of Custom Commands

Starting with  firmware revision 4 of the EasyVR 3 module,  it  is possible to export all the data,  including training, of the existing commands and passwords into a file. You can then use that file to import all the commands at once into another module or just as a backup for your commands.

While the module is connected, click on “Export Commands…” under the “File” menu and write the name of  the  file  that  will  contain  the  exported  commands.  In  the  same  way  you  can  select  “Import Commands…” and then choose the file with the commands you would like to import.

During the  Import/Export process some feedback  is provided with pop-up windows and with the progress bar on the main window.

 Updating Custom Data

Once the sound table and/or custom recognition grammars have been created, they can be processed by the  EasyVR  Commander  and  downloaded  to  the module.  Note  that  you must  first disconnect  from  the module and do the steps required to start it in “boot-mode”.

Now the command “Update Custom Data” is enabled, either on the toolbar or the “File” menu, and it can be used to start the update process. First you are required to list all the QuickSynthesis TM and QuickT2SI TM projects  you want  to  use.  A  new  file  containing  the  specified  custom  data  will  be  generated  and  the contents will be displayed, so that you can verify them before updating the module.

Once back in the EasyVR Commander the project can be reloaded by pressing the “Refresh” button. If the process completes successfully, the “Download” button will be enabled and the flash update process can start. 

The default format of generated data is suitable for the EasyVR 3. For previous versions of the module or the shield please make sure to check the option “Old Format (EasyVR 2.0)”.

The  download  process will  connect  at  a  higher  speed  to  the  EasyVR module,  so  the “bridge”  program running on your host device might not work  (in particular Robonova and Basic Stamp cannot be used  for this purpose) and you might need a true “serial adapter”.

The full speed used is 230400 bps, but the option “Slow transfer” can be used to reduce it to115200, for better compatibility with  slower serial adapters 7. One adapter that can go to  full speed  is the QuickUSB cable. Otherwise any USB/Serial adapter with TTL/CMOS interface can be used for updating the flash. The EasyVR Shield can be used for the download, provided that the mode jumper is in UP or LEO position.

After the download completes, a new connection can be established with the EasyVR module (in “normal mode”)  and  the  new  sounds  will  be  displayed  by  the  EasyVR Commander,  in  the  special  group “SoundTable” (the last one in the list with a yellow icon). They can be played back and tested using the “Play Sound” command on the toolbar or in the “Tools” menu. See also how to do that in your application in the code example Use custom sound playback.

Custom grammars will be displayed just after the built-in word sets and they work exactly the same way. Trigger words, when specified, will have their own vocabulary with only one entry. You can test and use the custom trigger and command grammars as you do with the built-in ones.

Flash Update

The EasyVR module includes a boot loader that allows to update the firmware and to download new sound tables or custom grammars to the on-board memory.

The boot mode is activated by keeping the XM signal to a high logical level at power on or reset. This can be easily done with a jumper (or switch) taking the signal to a suitable pull-up resistor.

To download a firmware update, a sound table or a custom grammar to the EasyVR, power on the module with  the  jumper  closed.  For  normal  operation,  just  leave  the  jumper  open. Do  not  change  the  jumper position while the module  is already powered on. It is safe to change XM  level while the module is reset (RST low).

Interfacing with PIC Microcontroller

It  is quite easy  to use  the EasyVR with Arduino by using this  library  from Github.  It uses  software  serial pins  to communicate with the module. The connections should be as follows

Sample Code

 

Shop With Us

Click here to buy Easy VR 3.0 Speech Recognition Module

Leave a Reply