Speech Recognition using EasyVR Shield and Arduino Uno

Hi! this article is aimed to guide reader on how to perform speech recognition using EasyVR Shield and Arduino Uno. The guidance is organized into two sections. There are components that are used and their functions, and how to integrate all of the components.

Components and Function

Main components of this embeded system are EasyVR Shield and Arduino Uno.

EasyVr Shield is speech recognition module for Arduino Board. As explained by SparkFun, the shield is versatile, robust and cost effective speech and voice recognition capabilities to virtually any application. Cool! Technically, the shield has 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. It supports up to 32 user-defined Speaker Dependent (SD) triggers or commands (any language) as well as Voice Passwords. It is also easy-to-use and simple Graphical User Interface to program Voice Commands. In simple way, it adds capability of hearing and responding to Arduino Uno.

13316-06a

Arduino Uno is brain of the embedded system. It is where we put the code that recognizes the speech and how to response it. It is also where the shield is attached. Through the Arduino Uno, we can record command and load the recorded command to EasyVR Shield.

Arduino-uno-perspective-transparent

In Indonesia, these components are relatively easy to obtain. Some e-commerce sites provide seller of EasyVR Shield and Arduino Uno. EasyVR Shield costs around Rp. 1.145.000 while Arduino Uno costs around Rp. 375.000.

Integration

One of brief videos that teaches how to configure and use EasyVr Shield and Arduino Uno as speech recognition system can be seen over here. However, some of the steps are not well explained. Therefore, this article is aimed to make it more comprehensive. Lets start.

1. Attach EasyVR Shield to Arduino Uno.

Attached Shield

2. Connect USB port from the Arduino Uno to USB port in PC.

3. Set the Mode Jumper in EasyVR Shield to PC.

4. Open EasyVR Commander application. EasyVR Commander is software to suport the speech recognition. It can record speech and command to the EasyVR Shield. The software also can generate coding based on the recorded speech and command.

Capture1

5. Click Connect Button in the EasyVR Commander software. Make sure to select correct COM port that connects to the EasyVR Shield.

6. The connection process will reload existing command that already exists in EasyVR Shield. By default, the shield already has some word sets. Up to 17 group of command can be loaded to the shield. The last group (index number 16) is specifically to record password that can be used as authentication purpose.

7. To add new command, click Add Command button in one of the groups. Then, give name to the command.

8. After that, click Train Command button to record speech for the command. There are two phases to train the command. Click Phase 1 button in the pop up window and say the speech. Then, another pop up window will show up. Click Phase 2 button and repeat the speech. Make sure the two recorded command in Phase 1 and Phase 2 is similar, especially for the intonation.

9. The EasyVR commander will compare the two recorded commands. If the two commands are very different, the processes need to be repeated.

Easy VR Commander recorded command

10. After all of the commands are recorded and trained. Click Generate Code button to create line of Arduino Uno coding based on the recorded commands.

11. Save the generated coding and open it using Arduino IDE. Line of coding from the EasyVR Commander is shown and ready to be modified.

Capture 2

 

12. Find lines that define index for the recorded command (enum Group 1). These lines represents specific index for command that has been recorded previously.

13. For a simple logic test, we will turn on LED based on the recorded command. Go through the coding and find switch case logic (void action).

Capture 3

14. Inside the switch case logic, add simple digitalWrite code to turn on yellow LED that has been connected to one of IO pin in the Arduino Uno.

15. Set the Mode Jumper in EasyVR Shield to SW and click Upload button in Arduino IDE.

16. Speak the command when small Green LED in EasyVR Shield is turned on. If the command is confirmed, the yellow LED will be turned on.

Capture 4

17. The switch case logic in the generated coding can be modified further. For example, it can be replaced by coding to control buzzer or LCD display. Futhermore, it also can modified using PWM logic to control servo motor.

18. The generated coding also can be modified to make the EasyVR Shield sounds Beep for each of recognized command. It can be done by including code of:

#define SND_BEEP 0
easyvr.playSound(SND_BEEP, EasyVR::VOL_FULL);

19. EasyVR Shield also can speak some word such as Hello, Access Denied, and Access Granted based on recorded sound in the sound table.

Easy VR Commander built-in voice

20. In addition, QuickSynthesis application can be used to add more recorded sound that can be said by the EasyVR Shield. Detail on how to use this application will be provided in other article about speech recognition.

21. Feel free to ask any question regarding this speech recognition article.

 

*This article is byproduct of research in title “Pemanfaatkan Kontrol Suara pada Manajemen Kunci berbasis Arduino dan EasyVR Shield” funded by Politeknik Caltex Riau

17 comments to “Speech Recognition using EasyVR Shield and Arduino Uno”
  1. Pingback: [EMB] Speech control using EasyVR Shield and Arduino Uno - YAS

  2. I am confused on how to write the code for step 19 of your article. I have saved 8 sounds in my SoundTable. How do I write the code so the appropriate sound is played in response to my command?

  3. How do I write the code for step 19? You mention that I can have the EasyVR speak some words such as Access Denied. I have created 8 sounds in my SoundTable. How do I get them to work with my code
    Thanks

    • Hi Brian,

      Can you tell me which Group you saved your 8 sounds? For example, I have created 18 sounds in GROUP_1. To play appropriate sound in response to my command, I use nested switch case for GROUP_1 and for my command label (01_RUANGAN_108) as shown in step 13. If you want to use predefined word such as Access Denied, you need to define:
      #define SND_ACCESSCONTROLSOUNDS_1 1
      and you can design a swtich case in your code to play
      easyvr.playSound(SND_ACCESSCONTROLSOUNDS_1, EasyVR::VOL_FULL);

      I am very happy to help your confusion.

  4. Sir asalam o alaikum
    I want to ask that I have to make decisions on voice command if the speaker say no then motor stop and if speaker say nothing or yes then it should start motor
    Can you explain where in the code I have to made amendment
    Sorry for my bad English

    • Salam,

      You can modify void action() function and find lines that define index for the recorded command (enum Group 1). These lines represent specific index for command that has been recorded previously. For example, if case 01_motorStart is recorded with voice command start, you can add logic to turn on the motor inside the case. Conversely, if case 02_motorStop is recorded with voice command stop, you can add logic to turn off the motor inside the case.

      Do you have sample of your coding?

      Regards,

  5. When I put the digitalWrite(11,HIGH) command inside the switch case under void action(), the code does not work. when i speak “lights on”, the led on the 11 th pin does not glow. But when i put digitalWrite(11,HIGH) inside void loop(), the code works. Please help!!!!

    • Salam,

      OK, you need to check your recorded command in EasyVR Commander. For example, if I put the command in Index 1, Group as shown in 9th step, then I will put my code in void action(),case GROUP_1, case G1_RUANGAN_108 as shown in 13th step.

      I suggest you to use more than 1 command to check validate quality of your recorded command too.

      Regards,

  6. Would you please tell me how I can add a push button (have only ON state) when it is pressed the recording voice will be activate

  7. maaf sebelumnya.
    saya ingin tanya sesuatu, kebetulan sedang mengerjakan skripsi saya tentang pemanfaatan pengenalan suara dan juga menggunakan modul easy vr.
    yang saya mau tanyakan, untuk modul easy vr itu sendiri bagaimana pengolahan sinyal nya ya, saya kurang paham tentang itu.
    jika berkenan tolong dijawab. soalnya saya butuh untuk referensi skripsi saya.
    terimakasih.

  8. Can you create and train SD commands without using easyVR Commander? I simply want to use my mic and speaker to be able to train SD commands. Ultimately I’m building a remote control that is voice activated, but I want to train the remote commands to each of my roomates voices apart from any pc

    • I never do training without easyVR Commander, so I don’t know how. But, you have such a nice idea. Let me know if you found the way.

Leave a Reply

Your email address will not be published. Required fields are marked *