EasyVR 3 User Manual Release 1.0.11 www.veear.
www.veear.eu Table of Contents EasyVR 3 Module ............................................................................................................................................. 5 Product Description ........................................................................................................................................ 5 EasyVR 3 Features ....................................................................................................................................
www.veear.eu Use custom sound playback .................................................................................................................... 38 Read sound table ..................................................................................................................................... 38 Built-in Command Sets ................................................................................................................................ 39 Error codes .................................
www.veear.eu Document History Information Revision Date Description 1.0 2015/01/27 Initial draft 1.0.3 2015/02/09 New drawings and updated descriptions 1.0.4 2015/03/19 Added new pictures and minor updates 1.0.5 2015/03/25 Update pictures and quickstart sections 1.0.6 2015/03/30 Added programming and library chapters Added PC software description Updated pictures and layout 1.0.7 2015/03/31 Minor corrections 1.0.
www.veear.eu EasyVR 3 Module Product Description EasyVR 3 is a multi-purpose speech recognition module designed to easily add versatile, robust and cost effective speech recognition capabilities to almost any application. The EasyVR 3 module can be used with any host with an UART interface powered at 3.3V – 5V, such as PIC and Arduino boards.
www.veear.eu Technical specifications MIC R4 D2 GPIO IO1 IO2 IO3 IO4 IO5 IO6 SP+ SPVM MIC RET VDD XM DE TX RX RST MIKROBUS 3V3 GND AUDIO SPEAKER MISC MIKROBUS CABLES 5V GND PWR SEL QUICK USB D1 MISC ADAPTER MISC 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.
www.veear.eu Pin assignment Group Name J1 ● MIKROBUS J2 ● ● ● GPIO AUDIO J3 J4 J5 CABLES J6 ● ADAPTER User Manual (1.0.11) J7 Number Pin Type Description 1 - - (Not connected) 2 RST I Active low asynchronous reset (internal pull-up) 3-6 - - (Not connected) 7 3V3 I 3.3V DC power input 8 GND - Ground 1 XM I Boot select (internal pull-down) 2 DE O (Reserved) 3 TX O Serial Data Transmit 4 RX I Serial Data Receive 5-6 - - (Not connected) 7 5V I 5.
www.veear.eu Note: The General Purpose I/O lines (J3.1-6) are at nominal 3.0VDC level. Do not connect higher voltages directly to these pins! Settings and indicators Group ● Name Type Description PWR SEL 3-Way Jumper (SMD 0603) D1 LED Red light indicator, normally ON when the board is powered, briefly blinking on serial data received D2 LED Green light indicator, turns ON when the module is listening to its audio input R4 Resistor (SMD 0603) Select power input and voltage level between +3.
www.veear.eu Recommended Operating Conditions Symbol 5V 3V3 5V_P Ta Parameter DC Power Input (Host) = VSEL DC Power Input (Programming cable) Ambient Operating Temperature Range Min Typ Max Unit 3.15 5.0 5.5 V 3.15 3.3 5.5 V 4.0 5.0 5.5 V 0 25 70 °C Min Typ Max Unit Power Supply Requirements Symbol Parameter ISLEEP Sleep current (VSEL = 5.0V) 6 mA IOPER Operating current (VSEL = 5.
www.veear.eu These are applicable to pin RX_P. Symbol Parameter Min Typ Max Unit VOH Output High Voltage (IOH = -5 mA) 2.4 3.0 V VOL Output Low Voltage (IOL = 8 mA) 0.0 0.6 V These are applicable to pins IO1 – IO6. Symbol Parameter Min Typ Max Unit VIH Input High Voltage 2.4 3.0 3.3 V VIL Input Low Voltage -0.1 0.0 0.
www.veear.eu Microphone The microphone provided with the EasyVR 3 module is an omnidirectional electret condenser microphone (Horn EM9745P-382): Sensitivity -38dB (0dB=1V/Pa @1KHz) Load Impedance 2.2K Operating Voltage 3V Almost flat frequency response in the range 100Hz – 20kHz The microphone circuit is optimized for use at ARMS_LENGTH (default, about 60cm) or FAR_MIC distance settings. If you use a microphone with different specifications the recognition accuracy may be adversely affected.
www.veear.eu Examples 1) The optimal gain resistance for the bundled microphone at ARMS_LENGTH distance is: – Use the closest standard 5% resistor to Rs. In this example, it would be 1.1 kΩ. The EasyVR uses a 1.2 kΩ resistor to allow use of “FAR” settings without replacing the internal resistor. Sometimes you might also need to compensate some gain loss for a voltage lower than the microphone ratings (using a larger resistor value sets a higher input gain).
www.veear.eu noises produced by handling or jarring the device from being “picked up” by the microphone. Such extraneous noises can reduce recognition accuracy. GOOD BAD absorbent material fastened directly 4. Distance - If the microphone is moved from 15 cm to 30 cm from the speaker’s mouth, the signal power decreases by a factor of four. The difference between a loud and a soft voice can also be more than a factor of four.
www.veear.eu General Purpose I/O Since the EasyVR communication interface takes two pins of the host controller, a few spare I/O pins are provided, which can be controlled with the communication protocol, to get those pins back for basic tasks, such as lighting an LED or reading a switch. The six I/O pins IO1–IO6 are connected directly to the embedded microcontroller on the EasyVR module, so they are referenced to the internal 3.0V regulated power supply VDD.
www.veear.eu IOn IOn optional filter Isolated IN IOn 5V IN SWITCH optocoupler I/O pin connected to a switch (or switching sensor) I/O pin connected 5V source (such as MCU output pin) I/O pin with isolated input (for safety circuits) All these circuits assume the EasyVR pin has been configured with an internal pull-up (passive components value can be adjusted to account for weak or strong pull-up).
www.veear.eu Quick start for using the module EasyVR 3 as a Development Board The QuickUSB serial adapter cable can be used to program voice commands and sound outputs into an EasyVR 3 module and quickly test it from your PC. Just connect the microphone and an 8Ω speaker to the module, plug-in the adapter cable and you are ready to go. The EasyVR 3 boot mode is managed automatically through the serial handshake lines, so you don’t need to set any jumper. How to get started 1. 2. 3. 4.
www.veear.eu Serial Adapter Interface Connector J7 is a 6-pin socket specifically designed for the QuickUSB serial adapter cable, but another adapter may also be used provided that it uses the same connector type, pin assignment and electrical specifications. Pin Name Type Notes 1 RX_P I Adapter should have TTL/LVTTL compatible inputs (VIH = 2.0V) 2 RTS_P O Adapter outputs can have 3.
www.veear.eu EasyVR Shield 3 for Arduino Product description The EasyVR Shield 3 is an adapter board for the EasyVR 3 module, designed to simplify its use among the Arduino community. The Shield is compatible with any Arduino board using UNOR3 Shield headers, running at either 3.3V or 5V levels, by using the IOREF pin to select the EasyVR operating voltage. It is also backward compatible with earlier Arduino boards that don’t have the IOREF pin, which are using 5V I/O levels by default.
www.veear.eu Technical specifications Board overview MODE JUMPER ARDUINO ANALOG IOREF RESET 3V3 5V GND GND VIN A0 A1 A2 A3 A4 A5 3.5mm JACK LINE OUT MIC SDA SCL AREF GND 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ARDUINO DIGITAL IO1 IO2 IO3 IO4 IO5 IO6 ARDUINO DIGITAL ARDUINO POWER EASYVR GPIO LED SW HW PC UP LEO PROG SPEAKER EASYVR AUDIO TX – D13 D9 – TX RX – D12 D8 – RX SW SERIAL PINS SW SERIAL PINS (Top View) (Detail – Bottom View) User Manual (1.0.
www.veear.eu Pin assignment Group Pin Description ● ARDUINO HEADERS - Arduino UNO-R3 Shield interface, pass-through connectors (Pins 0-1 are in use when J12 is set to UP, PC, HW or LEO) (Pins 12-13 or 8-9 are in use when J12 is set to SW) ● ● EASYVR AUDIO - Audio cables connectors of the EasyVR 3 module (microphone and speaker) LINE OUT - 3.
www.veear.eu Software Serial Pins settings On the bottom side of the board there are two SMD resistors that you can move to select the two pins of Arduino that the EasyVR will be connected to when in Software Serial mode (Mode Jumper on SW).
www.veear.eu Quick start guide for using the Shield Follow these few steps to start using your EasyVR Shield 3 and Arduino: 1. Insert the EasyVR Shield on top of your Arduino board 2. If you want audio output, either wire an 8Ω speaker into the SPEAKER connector (J5) on the EasyVR module or connect headphones or amplified speakers to the LINE OUT 3.5mm audio jack on the Shield 3. Connect the supplied microphone to the MIC connector (J6) on the EasyVR module 4 4.
www.veear.eu With Arduino 2009 – Uno – Mega Test the Shield with Arduino 1. 2. 3. 4. Set the Mode jumper (J7) in the SW position Open the example sketch TestEasyVR from your IDE menu “File” > “Examples” > “EasyVR” Upload the sketch and open the “Serial Monitor” window See comments on top of the sketch for usage details Test the Shield with the EasyVR Commander 1. Make sure the Mode jumper (J7) is in the PC position 2.
www.veear.eu EasyVR Programming Communication Protocol Introduction 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: EasyVR Host MCU 3.3V – 5V GND TX RX VCC GND ERX ETX 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.
www.veear.eu Arguments Mapping Command or status messages sent over the serial link may have one or more numerical arguments in the range -1 to 31, which are encoded using mostly characters in the range of uppercase letters.
www.veear.eu Command Details This section describes the format of all the command strings accepted by the module. Please note that numeric arguments of command requests are mapped to upper-case letters (see above section). CMD_BREAK Abort recognition, training or playback in progress if any or do nothing 'b' (62h) Known issues: In firmware ID 0, any other character received during recognition will prevent this command from stopping recognition that will continue until timeout or other recognition results.
www.veear.
www.veear.
www.veear.
www.veear.eu CMD_SEND_SN 'h' (68h) Send a SonicNet TM token [1] Length of token (4 or 8 in bits) Two positive values that form an 8-bit token index (index = [2] * 32 + [3], 0-15 for 4-bit tokens or [2-3] 0-255 for 8-bits tokens) Two positive values that form a 10-bit delay for token output since the next sound playback [4-5] (delay = [4] * 32 + [5], 0 = send immediately, 1-1023 = delay in units of 27.
www.veear.eu Status Details Replies to commands follow this format. Please note that numeric arguments of status replies are mapped to upper-case letters (see the related section).
www.veear.
www.veear.
www.veear.eu Communication Examples These are some examples of actual command and status characters exchanged with the EasyVR module by host programs and the expected program flow with pseudo-code sequences. The pseudo-instruction SEND transmits the specified character to the module, while RECEIVE waits for a reply character (a timeout is not explicitly handled for simple commands, but should be always implemented if possible).
www.veear.
www.veear.
www.veear.eu Read used command groups # request mask of groups in use SEND 'm' IF NOT RECEIVE = 'k' THEN ERROR # read mask to 32 bits variable # in 8 chunks of 4 bits each SEND ' ' mask = (RECEIVE – 'A') SEND ' ' mask = mask + (RECEIVE – 'A') * 24 SEND ' ' mask = mask + (RECEIVE – 'A') * 28 ...
www.veear.
www.veear.eu Built-in Command Sets In the tables below a list of all built-in commands for each supported language, along with group index (trigger or word set), command index and language identifier to use with the communication protocol.
www.veear.eu Error codes Below the list of the most useful error codes that may be returned by training or recognizing commands.
www.veear.eu Protocol header file This file “protocol.h” can be used with applications written in the C language. You can download a recent copy from the VeeaR website.
www.veear.eu EasyVR Arduino Library The EasyVR library implements the serial communication protocol to manage the EasyVR module and the EasyVR Shield from Arduino boards and controllers and it enables easy access to all the EasyVR features. Installation To install the EasyVR library on your Arduino IDE use the menu Sketch > Import Library ... > Add Library and open the released zip archive.
www.veear.
www.veear.
www.veear.
www.veear.
www.veear.
www.veear.eu Member Function Documentation bool detect () Detects an EasyVR module, waking it from sleep mode and checking it responds correctly. Return values: true if a compatible module has been found bool stop () Interrupts pending recognition or playback operations. Return values: true if the request is satisfied and the module is back to ready int8_t getID () Gets the module identification number (firmware version).
www.veear.eu bool setKnob (int8_t knob) Sets the confidence threshold to use for recognition of built-in words. Parameters: knob (0-4) is one of values in Knob Return values: true if the operation is successful bool setLevel (int8_t level) Sets the strictness level to use for recognition of custom commands. Parameters: level (1-5) is one of values in Level Return values: true if the operation is successful bool setDelay (uint16_t millis) Sets the delay before any reply of the module.
www.veear.eu Parameters: group index (0-16) is the target group, or one of the values in #Groups (0-31) is the index of the command within the selected group Return values: true if the operation is successful bool removeCommand (int8_t group, int8_t index) Removes a custom command from a group.
www.veear.eu Parameters: group (0-16) is the target group, or one of the values in #Groups Return values: integer is the count of commands (negative in case of errors) bool dumpCommand (int8_t group, int8_t index, char * name, uint8_t & training) Retrieves the name and training data of a custom command.
www.veear.eu void trainCommand (int8_t group, int8_t index) Starts training of a custom command. Results are available after hasFinished() returns true. Parameters: group index (0-16) is the target group, or one of the values in #Groups (0-31) is the index of the command within the selected group Note: The module is busy until training completes and it cannot accept other commands. You can interrupt training with stop(). void recognizeCommand (int8_t group) Starts recognition of a custom command.
www.veear.eu int16_t getToken () Gets the index of the received SonicNet token if any. Return values: integer is the index of the received SonicNet token (0-255 for 8-bit tokens or 015 for 4-bit tokens) if detection was successful, (-1) if no token has been received or an error occurred int16_t getError () Gets the last error code if any. Return values: (0-255) is the error code, (-1) if no error occurred bool isTimeout () Retrieves the timeout indicator.
www.veear.eu int8_t getPinInput (int8_t pin, int8_t config) Configures an I/O pin as an input with optional pull-up and return its value Parameters: pin pin (1-3) is one of values in PinNumber (2-4) is one of the input values in PinConfig Return values: integer is the logical value of the pin void detectToken (int8_t bits, int8_t rejection, uint16_t timeout) Starts listening for a SonicNet token. Manually check for completion with hasFinished().
www.veear.eu token delay is the index of the SonicNet token to play (0-255 for 8-bit tokens or 0-15 for 4-bit tokens) (1-28090) is the time in milliseconds at which to send the token, since the beginning of the next sound playback Return values: true if the operation is successful Note: The scheduled token remains valid for one operation only, so you have to call playSound() or playSoundAsync() immediately after this function.
www.veear.eu Parameters: tone duration is the index of the tone (0-9 for digits, 10 for '*' key, 11 for '#' key and 12-15 for extra keys 'A' to 'D', -1 for the dial tone) (1-32) is the tone duration in 40 milliseconds units, or in seconds for the dial tone Return values: true if the operation is successful bool resetAll (bool wait = true) Empties internal memory for custom commands and groups.
www.veear.eu 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 microcontroller host board with the provided “bridge” program (available for ROBONOVA controller board, Arduino 2009/UNO, Parallax Basic Stamp). You can define groups of commands or passwords and generate a basic code template to handle them.
www.veear.eu 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.
www.veear.eu The software will also alert if a command is too similar to an existing one by specifying the index of the conflicting command in the "Conflict" column. For example, in the following Figure 4 the command "TEST_CMD_ONE" sounds too similar to "TEST_CMD_ZERO" (i.e. they have been trained with a similar pronunciation). Note: TEST_CMD_ZERO and TEST_CMD_ONE are just examples of labels, you should use label names that reflects the real command that you are going to train.
www.veear.eu Recognition Settings The module comes programmed with some default settings that can affect voice recognition. These parameters can be altered in those case where the default values do not offer the best performance.
www.veear.eu Phone Tones Generation (DTMF) The EasyVR module is also capable of generating DTMF sounds. This feature can be tested by using the “Dial Tones” command in the “Tools” menu. Figure 6 – Interface for generating phone tones The tone duration can be specified in increments of 40 ms (milliseconds). The dial tone has a fixed duration of 3 seconds (its duration can be modified when programming the EasyVR).
www.veear.eu (specified with a granularity of around 27.5 ms). Another parameter for token detection is the rejection level that specifies the receiver sensitivity: higher rejection means lower sensitivity that is a lower detection rate, and vice-versa. When the timeout parameter is set to 0, the module will listen continuously and you can use the “Play” button to send a token from your PC soundcard and the “Stop” button to stop listening.
www.veear.eu Figure 9 - Export of 4-bit tokens Using Custom Data 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 TM special QuickSynthesis tool. Please refer to this application’s own manual for details about the creation of a sound table.
www.veear.eu 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). Figure 10 - External tool for creating a Soundtable Note: Only one Soundtable can be downloaded to the EasyVR module, so make sure you include all the sounds you want to use in a single project.
www.veear.eu Figure 11 - External tool for custom vocabularies Several projects can also be combined together if they are using the same acoustic model (language data) using the Acoustic Model Combiner included with the tool. This is useful if you have many command vocabularies, in order to save space in the EasyVR memory. 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.
www.veear.eu Figure 12 – Interface to build and download custom data 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 to 115200, for 6 better compatibility with slower serial adapters .
www.veear.eu Updating Firmware The EasyVR firmware can be updated in a similar way to custom data by using the command “Update Firmware...” from the “Help” menu. Note that you must first disconnect from the module and do the steps required to start it in “boot-mode” (see the section Flash Update). The specified file will be verified as an official firmware release and basic version information will be displayed. If the firmware passes the verification step, then the “Download” button will be enabled.
www.veear.eu QuickUSB Adapter Cable Product Description The QuickUSB is an USB-to-UART adapter cable, easy to use and supported on all the major operating systems. It plugs into a standard USB port and brings all the UART signals to a convenient 6-pin 2mm pitch female connector (Hirose DF11 Series). QuickUSB Features USB 2.0 Full Speed interface Full UART (RX/TX and RTS/CTS) at 3.3V Data transfer rates from 300 bps to 3 Mbps Extended operating temperature range: -40°C to 85°C Cable Length: 1.
www.veear.eu Operating Conditions Symbol VCC Ta Parameter Min Typ Max Unit DC Power Output (VBUS) * 4.5 5.0 5.5 V Ambient Operating Temperature Range -40 25 85 °C Typ Max Unit (*) Output current might be limited by USB Host and internal adapter settings Electrical Characteristics These are applicable to pins RXD, CTS. Symbol Parameter Min VIH Input High Voltage 1.5 3.3 V VIL Input Low Voltage 0.0 1.0 V These are applicable to pin TXD, RTS.
www.veear.eu How to get support Please feel free to contact us with any questions, queries or suggestions. If your question is about technical support or troubleshooting for one of our products, we kindly ask you to first check our FAQ for a possible solution: http://www.veear.eu/faq If you cannot find an existing solution on the FAQ, please contact us using the contact form on our website at http://www.veear.eu/support. The more detail you provide, the better support we can give.