Project tutorial
Arduino Tutorial: JARVIS v1 | How to make a Home Automation

Arduino Tutorial: JARVIS v1 | How to make a Home Automation © GPL3+

This project demonstrates the integration to build an intelligent system to control home appliances for elderly

  • 13,451 views
  • 14 comments
  • 95 respects

Components and supplies

Ard nano
Arduino Nano R3
×1
Relay Module (Generic)
×4
Bluetooth Low Energy (BLE) Module (Generic)
×1
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×10

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

Why Did We Build This?

Being an Iron man fan, I was really inspired by JARVIS, a voice-controlled personal assistant and I strongly wanted to build a home automation system. Though there are a lot of existing systems available, I decided to build my own home automation system using Arduino.

How It Works:

This project aims to control electrical and electronic devices such as Light, fan, TV, etc. This is done using Arduino and the relay circuit which is installed at each room of the house. The Data will be published to Arduino via Bluetooth module and further implementations can be made.

The primary task would be acquiring the data and publishing it to the Arduino using a mobile. And later with the data, a control can be made to switch on/off the devices.

Hardware Build

The circuitry is very simple. The overall cost for this product would be less than $20.

Step 1: Parts and Material

The Components needed for this project are:

  • Arduino
  • Relay Breakout board
  • Bluetooth Module - HC-05
  • Jumper Cables

Step 2: Connections

The Following connections are made using the Jumper cables. For this demo, I've used four relays which means four devices can be controlled using the APP.

*Arduino -> BT MODULE*

  • TX -> RX
  • RX -> TX
  • VCC -> 3.3v
  • GND -> GND

*Arduino -> Relay Board*

  • IN1 -> D2
  • IN2 -> D3
  • IN3 -> D4
  • IN4 -> D5
  • VCC -> VCC
  • GND -> GND

Step 3: The Code

You can find the sample code below.

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);}
//-----------------------------------------------------------------------//
voice="";}} //Reset the variable after initiating

Step 4: Application

For now we will use the ready-made application. In the following days I will publish the application once after the certificates are processed.

BT Voice Control for Arduino created by SimpleLabsIN: https://apkpure.com/bt-voice-control-for-arduino/robotspace.simplelabs.amr_voice/download?from=details

Working video of this Project:

At present, the functionality is limited to switching the devices on or off, but it can process natural language at basic level that allows the user to integrate natural language processing to the other projects.


Many thanks to Hackster.io for allowing me and all the users of this great platform to participate.

Thank you for carrying out these activities that encourage young people and teenagers to create and invent.

Give a thumbs up if it really helped you and do follow my channel for interesting projects. :)

Share this video if you like.

Happy to have you subscribed: https://www.youtube.com/c/rahulkhanna24june?sub_confirmation=1

Thanks for reading!

Code

Sample Code Arduino
//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);}
//-----------------------------------------------------------------------// 
voice="";}} //Reset the variable after initiating

Schematics

Connection
Download qqrucl4pyt

Comments

Similar projects you might like

Bluetooth Based Home Automation

Project tutorial by Team Brink.IO

  • 9,657 views
  • 13 comments
  • 38 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,826 views
  • 17 comments
  • 75 respects

Home automation V1 (Arduino, Raspberry Pi, ESP8266)

Project showcase by Tadeas Dvoracek

  • 9,919 views
  • 2 comments
  • 16 respects

GSM based Home Automation

Project tutorial by Team Brink.IO

  • 18,639 views
  • 45 comments
  • 38 respects

Email Home Automation

Project tutorial by Chirila Radu

  • 3,994 views
  • 0 comments
  • 14 respects

Home Automation Using Zone Beacon via Android App

Project tutorial by Team SomeRandomTeam

  • 1,413 views
  • 2 comments
  • 13 respects
Add projectSign up / Login