Home Automation Using Cortana




Introduction: Home Automation Using Cortana

About: I am a high school student who is interested in making new and improved tech items. Stay tuned to this channel for more inscrutables that will be coming by following me.

Hello! This is the instructable of the project that I came up with on new ideas on home automation.Here, I am using Cortana s the user interface b/w the user and the Arduino enabling many opportunities like voice recognition and low budget home automation And sorry if you are not unable to understand any aspect of this project because I am totally new to this and this is my first instructable. Jumping onto the steps.

I have also another project based on Cortana at my hackaday.io page you can view this at the link given below.


My blog spot


Step 1: Setting Up Hardware - Arduino and Relay Circuit

In this, the Arduino is controlling some relay switches which in turn controls the appliances and the Arduino is controlled by certain programs that we will discuss later on.

For this, you will need some prebuilt boards including the Arduino(i am using an Arduino Uno). You will also need relay breakout boards that are compatible with Arduino(link to some of those is given below)

  1. Http://www.rhydolabz.com/miscellaneous-miscellaneous-c-205_82/2channel-5v-relay-module-p-2304.html
  2. Https://www.sparkfun.com/products/13815
  3. Https://elementzonline.com/four-channel-4ch-uln2003-based-12v-relay-board-109?Search=relay

The one I am using is a 4 channel 12 relay module. The connection diagram is given Above in the pictures

Step 2: Software Part 1: Arduino

You can download the Arduino code attached to this.

You will need the Arduino IDE to compile the code. The link is given below.


Now after uploading the sketch to the Arduino, connect the Arduino to the PC via the data cable(try to use the USB port that is less used and ought to be only for the Arduino.)Now find the com port the Arduino is connected into by going to the device manager and note it down.

Step 3: Software Part 2: Windows

Now for the computer program

The code is in c# and you will need an appropriate compiler for that(I am using visual studio 2010)

Simply paste the code and make the appropriate changes as indicated and then debug it. In the code change, the com port number to the one your Arduino is connected into and also change the character that needs to be sent accordingly.

For example, the light to connected to relay 1 and hence to turn it on we have to send the character 'F' and also change the name of the program accordingly like "Lights ON". Here I will need 9 programs 2 (on/off) each relay and one to turn all off.


Step 4: Setting Up Cortana

Now after creating all the programs we want to create the shortcuts of these program in the below directory of your windows operating system (windows 10 of course ...Cortana sorry but here the screenshots are from a windows 7 PC but the directory will be the same for windows 10 also, instead of windows 7 click windows 10 ).

  1. Go to local disk c and click organize and from the menu opened select folder options(you can also open this from control panel also).
  2. Then in the view tab, mark view hidden files
  3. Now follow the directory shown in the image and create your shortcut for your .exe program here.
  4. That's it you are done

Step 5: Testing

Open Cortana and ask her to open the name of the program (eg: open Lights on) and she will start the program and the character will be sent to the Arduino via the com port we already set and the Arduino will control the relays according to the command received.

Step 6: Video

And for the last part, there is a video demonstration of this project(sorry for the poor video quality)

Arduino Contest 2016

Participated in the
Arduino Contest 2016

Be the First to Share


    • Backyard Contest

      Backyard Contest
    • Fabric Challenge

      Fabric Challenge
    • Remote Control Contest

      Remote Control Contest



    5 years ago

    This would be really useful! I always trip over the bed in the dark ^.^;

    Surajit Majumdar
    Surajit Majumdar

    5 years ago

    nice built :) thanks for sharing it.


    5 years ago

    Hiii nice project
    but laptop should be kept ON to control and to send commands to it

    Navaneeth Krishnan
    Navaneeth Krishnan

    Reply 5 years ago

    You can use a raspberry pi instead...... or even your smartphones ..(but you will have to change the computer program part......)