Introduction: Voice Control Using Mac OS X and Arduino

In this Inscrutable we are going to add voice control to Arduino using MAC OS X inbuilt feature of accessibilty and Voice recognition.

Here is the link of working System.

Led's are on table, Sorry for so reduced visibility of LED's.

Step 1: Installing Arduino-Serial Utility

Download Arduino Serial Utility and Extract it in your home folder.

Use command in terminal:

make arduino-serial

List the Serial Ports available using command:

ls /dev/tty.*

Copy the port on which Arduino is connected

Step 2: Connections on Arduino

Connect a Green led on Arduino on 11 pin.

and Burn following code to Arduino

int Green = 11;

void setup()

{

pinMode(Green,OUTPUT); // declare the LED's pin as output

Serial.begin(9600); // connect to the serial port

}

void loop () {
val = Serial.read(); // read the serial port

if(val == '2')

{ digitalWrite(Green,HIGH);

}

if(val == '5')

{ digitalWrite(Green,LOW);

}

}

Step 3: Create a Application Using Automator

Go to automator

Select to create a new application

Select Run a shell Script on left hand side.

and write these commands to the shell script.

While Writing these command do replace serial port names by yours which are copied in the first step.

The first command is to communicate using USB port.

and the second command is to communicate via Bluetooth Port.

Save it to applications folder.

For more detail on the commands refer this arduino-serial link.

Step 4: Create a Command in Accessibility.

Go to dictation comands and create a new command as shown.

If Dictation is not available then you will have to download offline recognition. by checking the box of use enhanced dictation in Dictation and Speech Preferences.

Add Your command in What is say box.

and choose application to run on that command.

Step 5: Connect Arduino Via USB or Bluetooth.

For bluetooth just connect Rx of bluetooth pin to Tx pin on Arduino and Tx of Bluetooth to Rx of Arduino.

And VCC of bluetooth to 5V of Arduino and GNG To Any GND on Arduino.

Now pair your bluetooth in settings.

I pairing fails then you will have to check password of your bluetooth in advanced settings.

For USB just plugin Your Arduino.

Step 6: Running Voice Recognition.

For Accessibility short cut.

By default we need to press fn key twice.

A listening mic will appear as shown now say your command.

And bingo if every thing is right than it will Turn the Green led On.