Introduction: Jarvis: an Arduino Based Home Automation System
I was inspired by Jarvis from the Iron Man and strongly wanted a home automation system. The existing systems were not cheap so I decided to build my own home automation system using an Arduino. At present its functionality is limited to switching the devices on or off but it can process natural language at a very basic level that allows you to use this technique to incorporate natural language processing capabilities into other Arduino projects.
CAUTION: I DID NOTtest this project with real world appliances and if you are planning to do so, do it at your own risk. I strongly advice a professional electrician's help in doing so.
Step 1: Things You Will Need
The project is fairly simple in terms of the things required.
- Arduino
- Bluetooth Module (Preferably HC-05)
- LEDs (For prototyping) x 4
- BC-547 transistors x 4
- 10k and 150 ohms resistors x 4 each
- Relay Board (Optional, only if you are serious about installing Jarvis in your home)
- Power supply (I used a powerbank and a 9V battery)
- Wires and Breadboard
- An Android phone or tablet with an Internet connection
Step 2: Preparing the Hardware
The main problem that I faced while developing this project was processing the input using the Arduino to understand what the user has said. The user, by default, can carry out 2 functions: to switch on or switch off a device. The code by default supports 4 devices but it can be extended. The program basically finds the keywords "on" or "off" and the names of the devices in the sentence and executes that function. You can control up to 2 devices simultaneously( a combination of "on" and "off" or each device). I used this method because it allows you to say anything as long as the sentence contains the keywords. For example you could simply say "Switch on all the lights" or even "OK buddy, do me a favor turn on all the lights" and both these sentences will have the same effect, i.e they will switch on the lights. I used the Arduino function string.indexOf("value") to locate the keywords in the sentence. I have included the circuit diagram for connecting the LEDs. It is not recommended to connect all 4 LEDs directly to the Arduino as its output is not powerful enough to drive all 4 at once. Do check the datasheet of the transistor to know the pin configurations as sometimes they differ from one manufacturer to another. The pins on the Arduino are as follows:
Led 1 (Corresponding to light) = 13
Led 2 (Corresponding to fan) = 12
Led 3 (Corresponding to TV) = 8
Led 4 (Corresponding to charger) = 4
Here light, fan, television, charger are the keywords required to trigger those pins.
EDIT: The circuit has been changed a little as per suggestion.
The code was written in hurry so I did not comment or make the code easier to understand. I will make the code more efficient and neat as soon as I get some time. Any volunteers would be great!
Attachments
Step 3: The Android Side
Integrating speech recognition into this project was one of my main motives from the beginning and what better way then using the powerful speech to text engine on Android? I used MIT app inventor to build the app. The app is fairly simple. What it does is it takes the speech input, converts it into a string and sends it to the Arduino via Bluetooth.
Attachments
Step 4: Improving Jarvis
Though the initial setup works good but one has to open the app to give commands and this can be a little boring if you end up using Jarvis pretty often. I modified the initial Jarvis app to start listening as soon as it is opened. Then I used Tasker and Commandr to create a custom voice command to open Jarvis. You can assign the call button on a Bluetooth headset or earphone to open Google now. Now as soon as you say your custom command the app will open and start listening!
Attachments
Step 5: How to Use Jarvis?
Jarvis is pretty simple to use. It has a pretty basic natural language processing capabilities that at least allows you to modify the sentence a little and thus eliminating the need to remember the perfect command. Jarvis allows you to control upto 2 devices simultaneously with separate on and off control or upto 4 devices with just a single control (i.e either on or off). The default keywords are fan, charger, television (or just TV), light (or lights).
Example Commands:
1.Turn on the fan please.
2. Switch on the charger and turn off the lights.
3. Can you please turn on the tv? I am feeling bored.
4. Turn off everything
The commands can be used in any combination. The only thing to remember is the presence of an on and/or off keyword and the name of the device/s.

Runner Up in the
Internet of Things Contest 2016

Participated in the
Sensors Contest 2016

Participated in the
Robotics Contest 2016

Participated in the
Home Hacks Challenge
38 Comments
25 days ago
pliz is it possible to get a more eraborate diagram
Question 4 years ago
Hi, i have a question for you. Can i change the language of Jarvis? For example from English to Italian? And if i can, wich parts of the program i have to change?
6 years ago
love this project i also work on this project ,your project help me me great, thnks u so much
6 years ago
Hey love this projekt
could you post a commented version of the Arduino Code? i havn't worked with some of the commands yet and i'm trying to understand everything so i can possibly expand the program further.
Also do you think you could send text back to the phone so via text to speech Jarvis could tell you what is happening?
Reply 6 years ago
I have added some comments to the code. Feel free to make changes and mail me if you want to know something.
6 years ago
good job
6 years ago
How to connect it to our house
6 years ago
Where is the code of this project? Please provide code.....i want to try my own
Reply 6 years ago
The Arduino code is attached under Step 2 and the Android app is available under Step 3.
7 years ago
iam very impressed by this project
iam in a half way of constructing this project
may i know please why the pins 0,1,5V,gnd,gnd are used
7 years ago
can you provide me the pin connection of the aurduinno module with the bluetooth module and the connections of the leds with the aurduino
7 years ago
Hey man great design. I have really wanted to make something like this to use in my make shift robotics lab. If you could answer a couple of my questions that would be great.
1. What are all the things it is capable of? For instance can I hook it up to my phone and any other house hold appliances?
2. How do I actually hook it up to something?
3. Also what is the total cost of this project, including the cost of hooking it up to any of my appliances?
Reply 7 years ago
This is capable of switching on and off most of the devices. You can attach the devices to a relay module and use this project to control them. The total cost with Arduino and the relay board will be around $29 but could be cheaper if you go for a clone. The relay board will be around $5. You can check out some instructable on using a relay board.
7 years ago
Hey man great design. I have really wanted to make something like this to use in my make shift robotics lab. If you could answer a couple of my questions that would be great.
1. What are all the things it is capable of? For instance can I hook it up to my phone and any other house hold appliances?
2. How do I actually hook it up to something?
3. Also what is the total cost of this project, including the cost of hooking it up to any of my appliances?
7 years ago
Hey man great design. I have really wanted to make something like this to use in my make shift robotics lab. If you could answer a couple of my questions that would be great.
1. What are all the things it is capable of? For instance can I hook it up to my phone and any other house hold appliances?
2. How do I actually hook it up to something?
3. Also what is the total cost of this project, including the cost of hooking it up to any of my appliances?
7 years ago
I wanted to make this project for controlling home appliances. I have a 2 channel relay for this purpose and I want to connect a fan and bulb to it. Can you please tell me how can I connect both of devices to the relay??
Thanx
Reply 7 years ago
Glad to know! It will be difficult for me to explain it in the comment section. You can check this instructable it is great!
https://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu
Reply 7 years ago
thank u for the project. I made it and it works successfully!!
I just wanted to know how can we make the circuit work by just clapping?
Reply 7 years ago
Glad to know it works! There are many clap switch circuits available online. You might also find some kits but I don't understand how you might integrate that with this project.
7 years ago
Could you please provide a more clear wiring diagram or a schematic diagram? I am trying to follow the instructable and and confused where the wires are going