Jarvis: an Arduino Based Home Automation System

21,720

320

37

Posted

Introduction: Jarvis: an Arduino Based Home Automation System

Internet of Things Contest 2016

Runner Up in the
Internet of Things Contest 2016

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.

  1. Arduino
  2. Bluetooth Module (Preferably HC-05)
  3. LEDs (For prototyping) x 4
  4. BC-547 transistors x 4
  5. 10k and 150 ohms resistors x 4 each
  6. Relay Board (Optional, only if you are serious about installing Jarvis in your home)
  7. Power supply (I used a powerbank and a 9V battery)
  8. Wires and Breadboard
  9. 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!

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.

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!

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.

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Microcontroller Contest

      Microcontroller Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    36 Comments

    love this project i also work on this project ,your project help me me great, thnks u so much

    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?

    I have added some comments to the code. Feel free to make changes and mail me if you want to know something.

    Where is the code of this project? Please provide code.....i want to try my own

    The Arduino code is attached under Step 2 and the Android app is available under Step 3.

    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

    can you provide me the pin connection of the aurduinno module with the bluetooth module and the connections of the leds with the aurduino

    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?