Arduino Tutorial: Jarvis V1 | How To Make A Home Automation

About the project

This project demonstrates the use of different technologies and their integration to build an intelligent system which will interact with a human and support in their day to day tasks.

Connectivity  Contest WinnerConnectivity contest winner

Project info

Difficulty: Moderate

Platforms: Arduino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

ARD-NANO30NP  AVR Arduino Nano 3.1 W/ATMEGA328 NO-PIN ARD-NANO30NP AVR Arduino Nano 3.1 W/ATMEGA328 NO-PIN x 1
relay board relay board x 1
MOTG-Bluetooth Bluetooth/802.15.1 Modules Bluetooth mod MOTG MOTG-Bluetooth Bluetooth/802.15.1 Modules Bluetooth mod MOTG x 1

Story

(Just A Rather Very Intelligent System)

This project demonstrates the use of different technologies and their integration to build an intelligent system which will interact with a human and support in their day to day tasks.

Step 1: Parts and Material

*Arduino -> Relay Board*

IN1 -> D2

IN2 -> D3

IN3 -> D4

IN4 -> D5

VCC -> VCC

You can find the sample code below.

//Coded By: Angelo Casimiro (4/27/14)
//Voice Activated Arduino (Bluetooth + Android) //Feel free to modify it but remember to give credit


String voice;


int led1 = 2, //Connect LED 1 To Pin #2


led2 = 3, //Connect LED 2 To Pin #3


led3 = 4, //Connect LED 3 To Pin #4


led4 = 5, //Connect LED 4 To Pin #5


led5 = 6; //Connect LED 5 To Pin #6


//--------------------------Call A Function-------------------------------//


void allon()


{ digitalWrite(led1, HIGH);


digitalWrite(led2, HIGH);


digitalWrite(led3, HIGH);


digitalWrite(led4, HIGH);


digitalWrite(led5, HIGH); }


void alloff()


{ digitalWrite(led1, LOW);


digitalWrite(led2, LOW);


digitalWrite(led3, LOW);


digitalWrite(led4, LOW);


digitalWrite(led5, LOW); }


//-----------------------------------------------------------------------//


void setup() {


Serial.begin(9600);


pinMode(led1, OUTPUT);


pinMode(led2, OUTPUT);


pinMode(led3, OUTPUT);


pinMode(led4, OUTPUT);


pinMode(led5, OUTPUT); }


//-----------------------------------------------------------------------//


void loop() {


while (Serial.available()){ //Check if there is an available byte to read


delay(10); //Delay added to make thing stable


char c = Serial.read(); //Conduct a serial read


if (c == '#') {break;} //Exit the loop when the # is detected after the word


voice += c; //Shorthand for voice = voice + c


} if (voice.length() > 0) {


Serial.println(voice);


//-----------------------------------------------------------------------// //----------Control Multiple Pins/ LEDs----------//


if(voice == "*all on") {allon();} //Turn Off All Pins (Call Function)


else if(voice == "*all off"){alloff();} //Turn On All Pins (Call Function) //----------Turn On One-By-One----------// else if(voice == "*TV on") {digitalWrite(led1, HIGH);}


else if(voice == "*fan on") {digitalWrite(led2, HIGH);}


else if(voice == "*computer on") {digitalWrite(led3, HIGH);}


else if(voice == "*bedroom lights on") {digitalWrite(led4, HIGH);}


else if(voice == "*bathroom lights on") {digitalWrite(led5, HIGH);} //----------Turn Off One-By-One----------//


else if(voice == "*TV off") {digitalWrite(led1, LOW);}


else if(voice == "*fan off") {digitalWrite(led2, LOW);}


else if(voice == "*computer off") {digitalWrite(led3, LOW);}


else if(voice == "*bedroom lights off") {digitalWrite(led4, LOW);}


else if(voice == "*bathroom lights off") {digitalWrite(led5, LOW);}


//-----------------------------------------------------------------------//

Schematics, diagrams and documents

Code

Credits

Photo of the lonely programmer

the lonely programmer

Passionate Techie ! Robotics | Electronics | Programming Hey Geek! If you are in search of electronics projects, Arduino based projects or any Micro-controller based projects, this channel is for you. In this channel, we build electronics projects using the impressive and low-cost boards that are available today. If you are a maker or if you want to learn how to make your own Arduino projects and other interesting Robots, do subscribe the channel to be a part of this community. We develop our own hardware and software projects and will try to build something new. Don’t worry if you don’t know how to program. I'll share the algorithm if you face any difficulties.

   

Leave your feedback...