Voice Control the Arduino With Windows 7's Speech Recognition





Introduction: Voice Control the Arduino With Windows 7's Speech Recognition

First, I'm sorry for any spelling or grammer mistakes that you may find here, as English isn't my native language.

I made this instructable because I haven't seen one that focuses on this subject, so I wanted to share this method. This method is very easy and can be used in both simple and complicated projects.

By the way, this is my first instructable, so wish me good luck!

This is an example I made - My Arduino Uno (with Ethernet shield) and two LEDs.

Watch in Full HD!

Step 1: The Need for Ingredients

What we will need for this instructable:

  • PC microphone
  • A PC running windows 7 (maybe 8 will also work).
  • An Arduino.
  • Microsoft Visual C# studio (I'm using 2010 edition).

Also, install now "Windows Speech Recognition Macros" from here.

Step 2: Between Them (C# Code)

So how does it work?

The speech recognition detects our trigger and then it opens a c# script that sends data to the arduino by serial communication.

Lets make our script:

1. Open Microsoft Visual C# Studio.

2. Go to File, then "New Project".

3. Choose "Console Application" and press OK.

4. Remove the default code and paste our code.

Our code:


*Notice that you may need to change that port in the code (COM5) to the port your Arduino is connected to. Check your port in the Arduino software under Tools>Serial Port.

*Change the "1" to whatever you need.

5. Save the project and press "start debugging" (green triangle).

6. Go to project's folder, ConsoleApplication1, bin, debug, and copy "ConsoleApplication1.exe" to somewhere you will be able to find it later. This is your little program/script.

Repeat those steps for every data you want to send.

Step 3: Arduino's Side

Now that we know what our C# code sends to the Arduino, we can make a code that will do something with those serial messages.

This is a simple code. For this code you will need one exe that sends "1", and one that sends "0".

Connect a LED to pin 3.


Upload the code to the Arduino and test it with our C# programs from the last step (by debugging or our exe's from the previous step).

It should work. If it doesn't - you can send a message with the problem.

Step 4: The Real Fun! (Voice Commands)

If everything is working as it should work, you can start with the voice commands. (If not, you can send a message with the problem).

1. Connect your microphone to the PC.

2. Install Windows speech recognition macros (if you haven't done it before).

(2.5. recommended: do "Set up microphone" from Control Panel > Speech Recognition)

3. Start "Speech Recognition" (Control Panel>Speech Recognition>Start Speech Recognition).

4. Start "Windows speech recognition macros".

5. Press right mouse on "Windows speech recognition macros" icon and then "New speech macro".

6. Choose "Run a program".

7. Enter a phrase that will turn on the led. Browse for the right EXE from STEP 2.

8. Click NEXT and Create.

*For some reason I can't digitally sign, don't know why.

Step 5: All You Need Is Check...

Now all you need is to try the voice commands you made. If, for some reason, you didn't succeed, you can send a message.

This is just the base, upgrade as much as you can!

I made an example video with 2 LEDs, watch in Full HD!

Good Luck!



  • Epilog Challenge 9

    Epilog Challenge 9
  • Gluten Free Challenge

    Gluten Free Challenge
  • First Time Author Contest 2018

    First Time Author Contest 2018

We have a be nice policy.
Please be positive and constructive.




i've been looking for so many years just to make this project, well can you suggest me what sould i do now? i got speech recoginiton and been playing with this program for about a year ago, but i need to make it more and more real with arduino, can you show me about this? thanks

Its perfect, with little more complex work on this project, with your voice , you will be able to expand functionality of the arduino. But for now would you show how to wire the board and module to PC. What arduino module are you using.

I Used Arduino UNO. I don't think there are any schematics, you just connect your arduino to your PC and a led for example to the pin you set up in the code.

arduino mega uno 2560 or arduino uno r3 ? thx

arduino mega is not arduino uno

choose the mega if you need alot of pins

Nice project ... but i'm having trouble with some part ... c# coding n arduino works well but the speech recognition is where i'm getting trouble.. the computer recognizes the command but doesnt execute the program... i.e. it just prints console application1 but doesnt execute

weird. did you start Speech Recognition and then Speech Recognition Macros?


yes... the exe file gets loaded and is displayed in the speech recognition display.. but it doesnt get executed


the error in the background seems like the port in your code isn't the port the arduino is connected to. In the code change where it says "COM5" to your port

:( sad but it works wel without the speech recg. part..

which means i'm having some error with the macros maybe