29
Arduino: Speech control with the EasyVR Shield
Introduction
Recently I’ve found an quite interesting Arduino shield on: http://www.veear.eu/Products/EasyVRShield.aspx. Using this shield you can control your Arduino using speech commands.

The shield consists of these components:
- EasyVR Arduino Shield (includes EasyVR module)
- Microphone
On the website you can also find following free software downloads (see link above):
- User manual
- EasyVR Commander
- Arduino Libraries
Following shops sell the EasyVR shield: http://www.veear.eu/WheretoBuy.aspx
It costs around 40€ or 50$.
Demo
In this demo I control a LED with my voice and the EasyVR shield.
For this demo I also use an Arduino, that has been kindly provided by Farnell.com.
Overview Arduino: http://de.farnell.com/arduino
Arduino schematic: http://arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf
Link to product page: http://de.farnell.com/arduino/a000046/board-arduino-uno/dp/1848687?ICID=i-9ec8-00001000
Step 1: Software Installation
Install the “EasyVR Commander” software [Link].
Before you run the software, make sure you run the program with administrator privileges.
But don’t start the software at the moment.
Step 2: Prepare hardware
Put the shield and the Arduino together and connect the mic to the shield (J11).
Put Jumper J12 at position “PC”.
Connect the Arduino to the PC via USB.
Step 3: Train the EasyVR Shield
Now run “EasyVR Commander” and connect to the serial port of the Arduino USB connection.
Click in the group list on Index 0 – Trigger. Add a new command, name it e.g. “ARDUINO”. Then click on “Train Command”. And speak the word “Arduino” in the mic. And a second time, when the software tells you so.

Click in the group list on Index 1 – Group. Add a new command, name it e.g. “LED_ON”. Then click on “Train Command”. And speak the words “LED on” in the mic. And a second time, when the software tells you so.
And add a second command “LED_OFF” and train this command as well.

Note: LED_AN is LED_ON and LED_AUS is LED_OFF.
Now your EasyVR is configured. We finally generate some code for the microcontroller inside of the Arduino. In EasyVR Commander click on File->Generate code.
Disconnect your Arduino from USB and change jumper J12 to SW.
Step 4: Some Arduino code
Install the EasyVR Arduino libraries (see first link) to the Arduino IDE library folder.
I slightly altered the previously generated code to control a LED. The LED is connected to pin 11:
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#include "SoftwareSerial.h"
SoftwareSerial port(12,13);
#else // Arduino 0022 - use modified NewSoftSerial
#include "WProgram.h"
#include "NewSoftSerial.h"
NewSoftSerial port(12,13);
#endif
#include "EasyVR.h"
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_LED_AN = 0,
G1_LED_AUS = 1,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
port.begin(9600);
if (!easyvr.detect())
{
Serial.println("EasyVR not detected!");
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println("EasyVR detected!");
easyvr.setTimeout(5);
easyvr.setLanguage(3);
group = EasyVR::TRIGGER; //<-- start group (customize)
pinMode(11, OUTPUT);
digitalWrite(11, LOW); // set the LED off
}
void action();
void loop()
{
easyvr.setPinOutput(EasyVR::IO1, HIGH); // LED on (listening)
Serial.print("Say a command in Group ");
Serial.println(group);
easyvr.recognizeCommand(group);
do
{
// can do some processing while waiting for a spoken command
}
while (!easyvr.hasFinished());
easyvr.setPinOutput(EasyVR::IO1, LOW); // LED off
idx = easyvr.getWord();
if (idx >= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; <-- jump to another group X
return;
}
idx = easyvr.getCommand();
if (idx >= 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print("Command: ");
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(" = ");
Serial.println(name);
}
else
Serial.println();
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println("Timed out, try again...");
int16_t err = easyvr.getError();
if (err >= 0)
{
Serial.print("Error ");
Serial.println(err, HEX);
}
group = GROUP_0;
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_ARDUINO:
// write your action code here
group = GROUP_1; //<-- or jump to another group X for composite commands
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_AN:
// write your action code here
group = GROUP_0; //<-- or jump to another group X for composite commands
digitalWrite(11, HIGH); // set the LED on
break;
case G1_LED_AUS:
// write your action code here
group = GROUP_0; //<-- or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
Compile and upload this code. Your Arduino should now do something like this:
can u help with my program is simular to your i have a trigger activate sound sensor, to commands activate and decativate switch but i cant upload my program on arduino can u see where i have gone wrong . when i try your program it doesnt like NewSoftSerial port because it does have a type
#include
NewSoftSerial port(12,13);
#include
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ACTIVATE_SND_SENSOR = 0,
};
enum Group1
{
G1_ACTIVATE = 0,
G1_DEACTIVATE_SWITCH = 1,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
port.begin(9600);
if (!easyvr.detect())
{
Serial.println(“EasyVR not detected!”);
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println(“EasyVR detected!”);
easyvr.setTimeout(5);
easyvr.setLanguage(0);
group = EasyVR::TRIGGER; //= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; = 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print(“Command: “);
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(” = “);
Serial.println(name);
}
else
Serial.println();
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println(“Timed out, try again…”);
int16_t err = easyvr.getError();
if (err >= 0)
{
Serial.print(“Error “);
Serial.println(err, HEX);
}
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_ACTIVATE_SND_SENSOR:
// write your action code here
// group = GROUP_X; <– or jump to another group X for composite commands
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_ACTIVATE:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH); // set the LED on
break;
case G1_DEACTIVATE_SWITCH:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
hello..
i am new to this easyvr and need help for connecting arduino uno with easyvr..
i am not using shield..
@uzma:
that’s eays, have a look at this pdf, on page 11:
http://download.tigal.com/veear/EasyVR_User_Manual_3.3.pdf
@arton: if you have the easyvr shield, you should try a different jumper setting on jumper J12
see page 17: http://download.tigal.com/veear/EasyVR_User_Manual_3.3.pdf
[...] Wrote in to tell us about this article about using the Arduino EasyVR shield to add voice control to your project. Worth a look if it your application calls for [...]
[...] Wrote in to tell us about this article about using the Arduino EasyVR shield to add voice control to your project. Worth a look if it your application calls for [...]
say me “easyvr not detected” help me please
@gogy: did you checked the manual? what configuration do you have – easy vr-shield + arduino or direct connection between the easy vr board and the arduino?
the second
hello, how do I configurer this in terminal? excuse my english is bad
Do you used the arduino software or another program to upload the sample program to the microcontroller?
I live in Brazil, I don’t speak very well English and I am using translator ” Globalink ” and I am with difficulties of doing the recording of the sound table in my easyvr shield, and in spite of following the instructions of the video in the site http://www.youtube.com/watch?v=SThR-jyoplk..
I used the program of sound ” compress Sensory quickSynthesis 5 “, as taught in the video, jumper position ” UP “, and downloads for the program Easy VR shield, however i am not getting to do the transfer of the sound for the easyvr shield, when I change the jumper for position ” PC ” the sound table it doesn’t show up in the program Easyvr Comander left side in the end indicating that was not recorded.
Thank you for the attention and for the help
Hi
I have bought the EasyVR and Arduino shield
do not have any program experience
like your program to control LED with voice command
could give the program code i can use to do this with my EasyVR
I copied your program but did hot work with voice
everything worked up generating code in the commander
Thank you so much
im getting a error Easy.h has not been declared. im lost
#if defined(ARDUINO) && ARDUINO >= 100
#include “Arduino.h”
#include “SoftwareSerial.h”
SoftwareSerial port(12,13);
#else // Arduino 0022 – use modified NewSoftSerial
#include “WProgram.h”
#include “NewSoftSerial.h”
NewSoftSerial port(12,13);
#endif
#include “EasyVR.h”
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_LED_ON = 0,
G1_LED_OFF = 1,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
port.begin(9600);
if (!easyvr.detect())
{
Serial.println(“EasyVR not detected!”);
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println(“EasyVR detected!”);
easyvr.setTimeout(5);
easyvr.setLanguage(0);
group = EasyVR::TRIGGER; //= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; = 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print(“Command: “);
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(” = “);
Serial.println(name);
}
else
Serial.println();
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println(“Timed out, try again…”);
int16_t err = easyvr.getError();
if (err >= 0)
{
Serial.print(“Error “);
Serial.println(err, HEX);
}
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_ARDUINO:
// write your action code here
// group = GROUP_X; <– or jump to another group X for composite commands
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_ON:
// write your action code here
// group = GROUP_X; <– or jump to another group X for composite commands
break;
case G1_LED_OFF:
// write your action code here
// group = GROUP_X; <– or jump to another group X for composite commands
break;
}
break;
}
}
hello, I do copy your code but I failed to compile it. the error ‘ ‘cli’ is not declare in this scope ‘ appear. I’ve tried to find out the problem but I still cant get it. will you help me on this problem?
thank you.
@yusuf: you may find this website useful: http://www.arduino.cc/playground/Main/AVR
It explains the cli() and sei() function.
I am trying to upload your code to my arduino but it says ‘NewSoftSerial’ does not name a type’
any ideas on how to fix this?
Hi!!! I’m in trouble with first test on arduino… on commander it’s all ok, but when i try to test with example sketch, on the serial monitor says “EasyVR not detected!” what can be wrong? Sorry… if someone can help me, can reply me by mail? nytro1981@gmail.com thanks!!!!!
Hi, I´m brazilian. My english isnt good, sry for that! So I´m had trouble using this code, so i tried to repair what is gone wrong… and I got it!
<– I don´t know what it means but by the way it works.
here is the code:
#if defined(ARDUINO)&&ARDUINO>= 100
#include “Arduino.h”
#include “SoftwareSerial.h”
SoftwareSerial port(12,13);
#else // Arduino 0022 – use modified NewSoftSerial
#include “WProgram.h”
#include “NewSoftSerial.h”
NewSoftSerial port(12,13);
#endif
#include “EasyVR.h”
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_LED_AN = 0,
G1_LED_AUS = 1,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
port.begin(9600);
if (!easyvr.detect())
{
Serial.println(“EasyVR not detected!”);
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println(“EasyVR detected!”);
easyvr.setTimeout(5);
easyvr.setLanguage(3);
group = EasyVR::TRIGGER; //<– start group (customize)
pinMode(11, OUTPUT);
digitalWrite(11, LOW); // set the LED off
}
void action();
void loop()
{
easyvr.setPinOutput(EasyVR::IO1, HIGH); // LED on (listening)
Serial.print(“Say a command in Group”);
Serial.println(group);
easyvr.recognizeCommand(group);
do
{
// can do some processing while waiting for a spoken command
}
while (!easyvr.hasFinished());
easyvr.setPinOutput(EasyVR::IO1, LOW); // LED off
idx = easyvr.getWord();
if (idx>= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; <– jump to another group X
return;
}
idx = easyvr.getCommand();
if (idx>= 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print(“Command:”);
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(“=”);
Serial.println(name);
}
else
Serial.println();
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println(“Timed out, try again…”);
int16_t err = easyvr.getError();
if (idx>= 0)
{
Serial.print(“Error”);
Serial.println(err, HEX);
}
group = GROUP_0;
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_ARDUINO:
// write your action code here
group = GROUP_1; //<– or jump to another group X for composite commands
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_AN:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH); // set the LED on
break;
case G1_LED_AUS:
// write your action code here
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
Hi again! I tested my own code by copying from this site but I discovered a problem. The problem is using control+c control+v to arduino IDE doesnt work. this site have a problem about simbols. (“) is the problem. so if you replace all (“) of my code again, you will see the word on the IDE will turn to blue color than black.
oh thankyou, I manage to try this code when im move the library correctly. thank you.
Can someone help me how to interface easyvr with arduino uno module because i am error of bridge connection
Hello, can someone help me! I will make abraille learning board with 2 braille cells each cell consists of 6 dots the user must press on the buttons(raised dots) to make aletter or number and combine them to make words…. The output must be voice only.How can I use arduino to make the voice output.
i want to ask what is the software that i should use for coding, im new with arduino!!!
Hi,
Can someone help me to compile the code with a Teensy board instead of an Arduino???
Thank you so much.
(“) is the problem. so if you replace all (“) of my code again, you will see the word on the IDE will turn to blue color than black.
i do this and the color become blue but in compiler there is a problem ” conflicting declaration ‘softwareserial port’ how cani resolve it ?
finally, i upload the program but the led is on all the time and doesn’t response to voice ,what’s the problem ? and after uploading i change the mode of j12 or keep it in sw mode
Hi,
so this is funny, when I say led_off arduino turns the led ON! and when I say ON it turns the led OFF! hmmmm this is so funny. here my code:
(the led is on from the beginning!)
hope you can find the little devil
#if defined(ARDUINO) && ARDUINO >= 100
#include “Arduino.h”
#include “SoftwareSerial.h”
SoftwareSerial port(12,13);
#else // Arduino 0022 – use modified NewSoftSerial
#include “WProgram.h”
#include “NewSoftSerial.h”
NewSoftSerial port(12,13);
#endif
#include “EasyVR.h”
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_DAVID = 0,
};
enum Group1
{
G1_LED_AN = 0,
G1_LED_AUS = 1,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
port.begin(9600);
if (!easyvr.detect())
{
Serial.println(“EasyVR not detected!”);
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println(“EasyVR detected!”);
easyvr.setTimeout(10);
easyvr.setLanguage(3);
group = EasyVR::TRIGGER; //= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; = 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print(“Command: “);
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(” = “);
Serial.println(name);
}
else
Serial.println();
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println(“Timed out, try again…”);
int16_t err = easyvr.getError();
if (err >= 0)
{
Serial.print(“Error “);
Serial.println(err, HEX);
}
}
}
void action()
{
switch (group)
{
case GROUP_0:
switch (idx)
{
case G0_DAVID:
// write your action code here
group = GROUP_1;
break;
}
break;
case GROUP_1:
switch (idx)
{
case G1_LED_AN:
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, HIGH);
break;
case G1_LED_AUS:
group = GROUP_0; //<– or jump to another group X for composite commands
digitalWrite(11, LOW); // set the LED off
break;
}
break;
}
}
@Albert: How did you connect the LED? K to GND and A to the digital output?