Voice and Button Automation for Disabled

by adithya1543 in Circuits > Arduino

524 Views, 4 Favorites, 0 Comments

Voice and Button Automation for Disabled

Untitled.png
Home Automation using arduino

INTRO:

The biggest problem in disabled persons is their inability to access things easily as others. But, our modern technologies and our super brain has made them possible to achieve great heights. This project is a Arduino-based project used to give home automation through voice and buttons which is available in my own android application made with MIT app inventor ."Talk less work more", So let's begin:)

Supplies

The supplies required for this project are:

Arduino UNO / Arduino NANO

Bluetooth module HC-05 / HC-06

Relay module ( not used in video )

Bluetooth app (given)

Arduino IDE

Few minutes

jumper wires

wire extension box ( not used in video )

Any appliance (fan , light ,phone)

Give the Connection​ As Given

thXQXF4XMP.jpg

BLUETOOTH MODULE - ARDUINO

VCC >> 5V

GND >>GND

TX >> RX

RX >> TX

LED - ARDUINO

LED 1 - ARDUINO

SMALL LEG (CATHODE) >> GND

LONG LEG (ANODE) >> 3

LED 2 - ARDUINO
SMALL LEG (CATHODE) >> GND

LONG LEG (ANODE) >> 3

LED 3 - ARDUINO
SMALL LEG (CATHODE) >> GND

LONG LEG (ANODE) >> 3

LED 4 - ARDUINO
SMALL LEG (CATHODE) >> GND

LONG LEG (ANODE) >> 3

APP FOR ARDUINO

th1N1J3R24.jpg

BLUETOOTH APP FOR ARDUINO

BLUETOOTH APP FOR ARDUINO IS VERY IMPORTANT.

I HAVE USED MIT APP INVENTOR TO CREATE ONE

THE APP IS GIVEN:

https://drive.google.com/open?id=1B_BuBoj6zpGicyffwOf7ZPOfiJ98bq18

CODE

thEI61XGK0.jpg

THE MOST IMPORTANT THING - CODE IS TO BY GIVEN IN ARDUINO IDE

CODE:

IF THE CODE GIVEN HERE DOESNT WORK, USE THIS GOOGLE DRIVE CODE:

https://drive.google.com/open?id=1WXx7sfJNFIaewOpjbv31hVg6VkUIcrBC

      /////////////////////////////    
     //  A project by adithya** //
    //for instructables contest//
   // home automation project //
  //speech,text,button access//
 /////////////////////////////
   //////////////////////////////////////////////////////////
  ///*pin settings only for arduino uno and arduino nano ///
 ///**modification in code is not to be done            ///
//////////////////////////////////////////////////////////
#include <SoftwareSerial.h>
String voice ; //declaring voice
int tv = 3; //defining pin in arduino*for tv 
int light = 4; //defining pin in arduino for light
int phone = 5; //"charging phone
int fan = 6; //"fan 
int Received=0;
int tv_state = 0;
int light_state = 0 ;
int phone_state = 0;
int fan_state = 0;
void all() {
  digitalWrite(fan,HIGH);
  digitalWrite(tv,HIGH);
  digitalWrite(light,HIGH);
  digitalWrite(phone,HIGH);
}
void setup() {//defining the devices at the outputs//
  Serial.begin(9600);
pinMode(tv,OUTPUT);
pinMode(light,OUTPUT);
pinMode(phone,OUTPUT);
pinMode(fan,OUTPUT);
}
void loop() {
  // put your main code here, to run repeatedly:
     //declaring voice control
while(Serial.available()) {
  delay(10);
  char c=Serial.read();
  if(c== '#' )
  {break; }
  voice += c;
}
if (voice.length() >0) {
Serial.println(voice);  
//voice commands
if (voice == "TV" ) {
  digitalWrite(tv,HIGH);
}
else if (voice == "light" ) {
  digitalWrite(light,HIGH);
}
else if (voice == "charge" ) {
  digitalWrite(phone,HIGH);
}
else if (voice == "fan" ) {
  digitalWrite(fan,HIGH);
  }
else if (voice == "all" ) {
  all();
   }
//voice off commands
if (voice == "TV off" ) {
  digitalWrite(tv,LOW);
}
else if (voice == "light off" ) {
  digitalWrite(light,LOW);
}
else if (voice == "charge off" ) {
  digitalWrite(phone,LOW);
}
else if (voice == "fan off" ) {
  digitalWrite(fan,LOW);
  }
else if (voice == "all off" ) {
    digitalWrite(fan,LOW);
   digitalWrite(light,LOW);
  digitalWrite(tv,LOW);
 digitalWrite(phone,LOW);
   }
   voice="";
}
      ///////////////////////////////////////////////////////////////
     ///              END OF VOICE COMMAND PROGRAM               ///
    ///////////////////////////////////////////////////////////////

 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX//
 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX BUTTON COMMANDS XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX//   
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX// 


  if (Serial.available()>0){
    Received = Serial.read();
  }
  //xxxxxxx TV xxxxxxx//
if(tv_state == 0 && Received == '1')
{
  digitalWrite(tv,HIGH);
  tv_state=1;
  Received=0;
}
if(tv_state == 1 && Received == '1')
{
  digitalWrite(tv,LOW);
  tv_state=0;
  Received=0;
}
  //xxxxxxx LIGHT xxxxxx//
if(light_state == 0 && Received == '2')
{
  digitalWrite(light,HIGH);
  light_state=1;
  Received=0;
}
if(light_state == 1 && Received == '2')
{
  digitalWrite(light,LOW);
  light_state=0;
  Received=0;
}
  //xxxxxxx PHONE xxxxxx//
if(light_state == 0 && Received == '3')
{
  digitalWrite(phone,HIGH);
  phone_state=1;
  Received=0;
}
if(phone_state == 1 && Received == '3')
{
  digitalWrite(phone,LOW);
  phone_state=0;
  Received=0;
}
  //xxxxxx FAN xxxxxx//
  if(fan_state == 0 && Received == '4')
{
  digitalWrite(fan,HIGH);
  fan_state=1;
  Received=0;
}
if(fan_state == 1 && Received == '4')
{
  digitalWrite(fan,LOW);
  fan_state=0;
  Received=0;
}
}
//////////////////////////////////////////////////////////////end of button /////////////////////////////////////////////////////////////////////</p><p>/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////                                             END OF PROGRAM                                                                  ////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</p><strong></strong><u></u><sub></sub><sup></sup><del></del><br>

TESTING

thB1IPUJ6Q.jpg

TIME FOR TEST:

TESTING IS GIVEN IN THE LAST PART OF THE VIDEO

https://youtu.be/HxYhx9T9x6w

USE THE LED TO TEST AS IT IS SAFE

ENJOY THE PROJECT THANK YOU!

THANKS FOR INSTRUCTABLES