Introduction: Voice Controlled Switch With Arduino

This is for the first time am uploading my project in Inscrutable. So if you guys find any silly mistakes please ignore it.
So, about my project, this is about the voice operated lights inspired from IRON-MAN movie. So JARVIS by Michel c, the software is used here to recognize the voice commands and opens the particular file. The interaction between the computer and arduino is done through the COM port in command prompt in Windows.

Step 1: Starting Up...

Here is the list of items you need:
1. Arduino Board
2. Wires
3. 5v relay
4. PCB
5. 2 pin screw Terminal (2)
6. All soldering Components

Step 2:

1.Place all the Components as shown in the images above.

2. Now place the cable in the screw terminals.

-> One pair (red and black) at the other end is connected to the source or battery. In my case i have connected to a 6v 4.7ah Battery.

->And the other pair (Green and white) is connected to the lights.

->You can add the AC/DC power supply according to the configuration of the lights. I have connected 10 1w LEDs.

3. I have also connected Female header Terminals so that it would be easy to plug the jumper cables from the arduino.

Step 3: Circuitry...

The relay acts as if condition in electronic circuits. when ever 5v is applied across the coil, the tongue connected to p1 else connected to p2.

Connect all the points as shown in the diagram above.

Step 4: Arduino Program

int incomingByte = 0; // for incoming serial data

void setup()

{

Serial.begin(9600); // opens serial port, sets data rate to 9600 bps

pinMode(12,OUTPUT);

}

void loop()

{

// send data only when you receive data:

if (Serial.available() > 0)

{ // read the incoming byte:

incomingByte = Serial.read();

// say what you got:

Serial.print("I received: ");

Serial.println(incomingByte, DEC);

}

if (incomingByte==100)

digitalWrite(12,HIGH);

else if (incomingByte==97)

digitalWrite(12,LOW);

}

Step 5: How It Works

Step 6: The C# Codes...

// c#	program to switch on the lights

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using System.IO;

namespace ConsoleApplication1
{
class Program
	{
	static void Main(string[] args)
		{
		SerialPort sp= new SerialPort();
		sp.PortName = "com4"  // write your com port connected to arduino
		sp.BaudRate=9600;
		sp.Open();
		sp.Write("d");
		sp.Close();
		}
	}
}

This one to switch off the lights.

// c# program to switch off the lights

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using System.IO;

namespace ConsoleApplication1 { class Program { static void Main(string[] args) { SerialPort sp= new SerialPort(); sp.PortName = "com4" // write your com port connected to arduino sp.BaudRate=9600; sp.Open(); sp.Write("a"); sp.Close(); } } }

Type both the projects separately

Type => Build => take the .exe file

you can get the .exe file from

Documents/Visual Studio/Projects/<project name>/<project name>/bin/Debug/<project name>.exe

for both the off and on, bring two exe files and place them somewhere u are comfortable.

Step 7: Time to Power Up...

=> Connect the red and black wire to the +ve and -ve terminal of the supply respectively.

In my case i am using 10 1W Leds. Hence I have connected a 6v 4.7Ah battery to power them. If you want to connect to the AC supply then you can go for it.

WARING..!!! Dont connect the LEDs directly in the AC, Use a ac appliance instead.

=> Connect the white(gnd) and Green (+ve) to the two terminals of the appliance or LEDs.

I have also connected a DPDT switch to the battery in order to turn the leds on directly. whthout arduino. You can skip that.

Step 8: Putting Them All Together

Step 9: Configuring JARVIS.

you can download the JARVIS:

Download Jarvis Software from here

After finishing the installation, open the program, select the language you are comfortable with.

then click on the +button at the right bottom to add custom commands...

then add commands,

add response, and their respective file location.

Finally say "Update commands" to save and active those commands.

try to say those commands and see the results

Step 10: Possible Errors

If the jarvis program dose not recognizes your voice then you should train your system.

In order to do that goto

control pannel > Speech Reorganization

Complete the training process then try it.

If the problem still persist then feel free to contact me or comment below.

catch me at www.facebook.com/bisudw

mail me: mails2bisu@gmail.com

Step 11: Any Device Can Be VOICE CONTROLLED

With a little bit of modification in the codes, and by adding some more relay switches to the arduino board can be controlled from the voice.

Here is my modification. I added one more switch with 230v 50hz AC supply to control the fan.

Then updated the commands at JARVIS console... den all set to go.

instead of the Fan plugin any device you want and get started.

Comments

author
Victor805 (author)2014-03-18

Cool project, but the way you have connected the coil of the relay to the Arduino could end damaging the chip.

I know it because I've been involved in a very similar project and I found several discussion topics about this.

http://makezine.com/2009/02/02/connecting-a-relay-to-arduino/

author
bisudw (author)Victor8052014-03-18

Thanks Victor8o5... I was wondering why i wasnt able to connect more than 2 relays, I got the mistake, connecting directly draws a lot of current. You solved my problem. Thanks a lot.

author
pierreabdon (author)bisudw2014-09-25

Hello :) I just want to ask, how did you solved the problem with relays connecting on arduino? I'm afraid that if I try to connect the relays directly to arduino may harm the chips, right? Can you elaborate it please? have a good day :)

author
bisudw (author)pierreabdon2014-10-08

no they are not going to harm the chi if you want you can connect them directly.

author
RahulT80 (author)bisudw2016-12-20

Back emf reverses the polarity, so it may damage the board... due to change in polarity.. better to put diode ;)

author
krishnasgwd (author)pierreabdon2015-01-16

it would be better if u connect a diode across relay so that it prevents back emf generated when relay deenergises to enter arduino>.

author
bisudw (author)krishnasgwd2015-05-02

Yeah it would b better... since m not a electronic endgineer.. i havnt thought about back emf... but hey.. dats a nice idea... safety comes first... go ahead..

author
bisudw (author)pierreabdon2015-05-02

No directly connecting the relay wont harm ur board... the problem is.. since the relays are 5v abd the board too works on 5v (usb connection) so there will be lack of power when u will connect 3 or 4...
Sorry 4 late reply...

author
lokanath mishra (author)2017-02-05

can i use main current for controlling lights in my room.as i am having arduino uno r3.is it possible.if possible then how

author
lokanath mishra (author)2017-02-05

is there any anathor way to control tube lights with voice recognisation

author
Faiz Fitri (author)2017-01-21

Hello,

Can i get your email please. I have something to ask you.

Thanks

author
bisudw (author)Faiz Fitri2017-01-22

Mails2bisu@gmail.com

author
rohitelex786 (author)2016-12-14

The link given for JARVIS is not working. Can I get any other working link?

author
NazmusS1 (author)2016-09-04

Hey I need to know how you run the light on code and using which software

author
Thadeo Arlo (author)2016-07-14

hey, i'm new to c#, can you upload the compiled exe please :)

author
mummy1243 (author)2015-11-16

how can i download the file that you are posted

author
bisudw (author)mummy12432015-11-16

which file you are talking about??

author
SrivishnuT (author)bisudw2016-06-03

the jarvis file, it was taken down, can you email me the file at srivishnupiratla@gmail.com

author
ItaloD6 (author)2016-05-30

Pelo Amor de Deus, alguem fez isso em portugues brasil pra me traduzir????

author
classic madhu (author)2016-05-13

hello, jarvis software is not available in the site you have mentioned above can you suggest me some alternatives

author
Aswinm1 (author)2016-03-30

could the software be downloaded in tabs and mobile phone pls I like this project very much and I am very eager to make this

author
Aswinm1 (author)2016-03-29

can this software Jarvis be installed on tablet and mobile phones please I like this project very much and eager to make this project

author
jao kind (author)2016-03-20

this project is so cool. i will do this for my thesis
how can i download the PDF file ? and what's the content of that ?


author
bisudw (author)jao kind2016-03-21

are you a premium user??

author
jao kind (author)bisudw2016-03-25

nope. i need to become premium user? to download this PDF ?

author
jao kind (author)2016-03-20

this project is so cool. i will do this for my thesis
how can i download the PDF file ? and what's the content of that ?


author
jao kind (author)2016-03-20

this project is so cool. i will do this for my thesis
how can i download the PDF file ? and what's the content of that ?


author
jao kind (author)2016-03-20

this project is so cool. i will do this for my thesis
how can i download the PDF file ? and what's the content of that ?


author
jao kind (author)2016-03-20

this project is so cool. i will do this for my thesis
how can i download the PDF file ? and what's the content of that ?


author
jao kind (author)2016-03-20

this project is so cool. i will do this for my thesis
how can i download the PDF file ? and what's the content of that ?


author
DJH8 (author)2016-03-19

Is there a macintosh version of this?

author
tim76 (author)2016-03-04

Had a bit off a struggle cause I'm new to programming, but it works great now! thx!

next struggle will be how to get everything up and running wireless.... :-)

author
ooola (author)2016-02-10

shall i use ac power to this

author
gokkul (author)2015-12-20

and can we connect multiple devices for different rooms and make it work according to our convienience

author
gokkul (author)2015-12-20

i am a 10th grade student i am coming with a project named smart home and i need to introduce this idea into my project so i need some help to finish the model and i am in need of help in doing the speech recognition switch to switch on the lights of my home

author
ABHISHEKS44 (author)2015-12-07

I had one doubt w.r.t interaction i.e is jarvis capable of interacting vith arduino microcontroller/raspberry pi boards?



author
bisudw (author)ABHISHEKS442015-12-08

actually buddy jarvis itself dont talk to the devices directly, i have small small programs (which interact with arduino) and they are triggered by jarvis to any of our commands

author
WendelI (author)2015-05-11

hi! im trying to make this project but the output voltage of my arduino is not 5v but 3.3v so its not powering the 5v relay.. any advice.? any help would be appreciated. thanks

author
bisudw (author)WendelI2015-05-11

Use a extetnal power soutce and some transistor or triodes...

author
WendelI (author)bisudw2015-05-12

i have troubleshooted it and the problem i think is the relay. i used 6v 5 amp relay 8 pins DPDT as a substitute for the said relay in the materials list. do you think it's the problem? do i need to buy another 5v 3amps relay 5 pins?

author
bisudw (author)WendelI2015-05-12

yeah the 5pin relay.. :P

author
WendelI (author)bisudw2015-05-12

thanks.. :D im almost finish.. the only problem is how to make the file .exe i don't know how to use microsoft visual c#? in the video you say click clear solution but after i clicked it nothing happens..

author
bisudw (author)WendelI2015-05-12

after compilation u will get the exe file in documents/visual studio/"ur project name"/debug

author
diynoobie (author)2014-11-15

hi guys, i am trying to replicate this project but been having trouble with cmd promt my system is running on windows 7 any advice ?????

author
bisudw (author)diynoobie2015-05-02

Tell me about the problem u r having... nope it shouldnt be a problem with win7.. but aince u r having it please explain...sry 4 late reply

author
diynoobie (author)bisudw2015-05-06

i was able to figure it out eventually but all thanks to your great instructable so keep them coming!!

author
akshitubhangale (author)2015-05-03

how to convert the lights on and off files into .exe files?

author
bisudw (author)akshitubhangale2015-05-03

Its already converted... check your debugg folder..

author
UkorU (author)2015-02-24

There is a litle mistake in your C# Programme you need to put " ; " after sp.PortName = "com4" ! however it's very nice project and thank you fot sharing your work with us !

author
bisudw (author)UkorU2015-05-02

Thx 4 noticing... its not a big deal... while writing so much things... i cant write every thing correctly... ?