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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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.

Home Automation

Participated in the
Home Automation

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    9 Discussions


    3 years ago

    Hi Rajat,

    I'm trying to get your tutorial to work but for some reason when I run my script and then run my Arduino code, it doesn't pass the correct value to val. I don't know where it gets -1, but that's what it prints in the serial monitor. Any ideas? Thank you so much!

    Screen Shot 2016-05-21 at 3.13.47 PM.pngScreen Shot 2016-05-21 at 3.13.42 PM.pngScreen Shot 2016-05-21 at 3.13.04 PM.pngScreen Shot 2016-05-21 at 3.12.50 PM.pngScreen Shot 2016-05-21 at 3.12.29 PM.png
    1 reply

    Reply 3 years ago

    I should add that I've tried both .tty and .cu as the port in my Automator script. I'm very new to Arduino and Automator by the way!


    3 years ago

    So what change do you make to the C++ code to turn the LED light off?

    1 reply

    Reply 3 years ago

    Actually I understand the on/off using the commands. I'm struggling working individual lights without uploading a different program


    4 years ago on Introduction

    Nice! Do you also know how to use the -r function? I would like to send and receive data from my arduino and display it in a mac app.

    2 replies

    Reply 4 years ago on Introduction

    Go to arduino-serial link in third step, there you will get detailed Guideline.


    Reply 4 years ago on Introduction

    ./arduino-serial -b 9600 -p /dev/cu.usbserial -r

    This will get serial data from arduino to your terminal.