Step 1

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.

https://www.arduino.cc/en/Main/Software

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.

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.

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

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.