You are on page 1of 16

A

Project Report on
Home Automation System

Baldev Ram Mirdha Institue of Technology

Presented By: Shubash Mahla


Sanjay Paptwan
INTRODUCTION

This project Voice Controlled Robotic Vehicle helps to control robot through
voice commands received via android application. The integration of control
unit with Bluetooth device is done to capture and read the voice commands. The
robotic vehicle then operates as per the command received via android
application. For this 8051 microcontroller is integrated in the system which
makes it possible to operate the vehicle via android application.

The controlling device may be any android based Smartphone/tab etc having an
android OS. The android controlling system provides a good interactive GUI
that makes it easy for the user to control the vehicle. The transmitter uses an
android application required for transmitting the data.

The receiver end reads these commands and interprets them into controlling the
robotic vehicle.

The android device sends commands to move the vehicle in forward, backward,
right and left directions.

After receiving the commands, the microcontroller then operates the motors I
order to move the vehicle in four directions. The communication between
android device and receiver is sent as serial communication data. The
microcontroller program is designed to move the motor through a motor driver
IC as per the commands sent by android device.
DESCRIPTION
Robots are indispensable in many manufacturing industries. The reason is that
the cost per hour to operate a robot is a fraction of the cost of the human labor
needed to perform the same function. More than this, once programmed, robots
repeatedly perform functions with a high accuracy that surpasses that of the
most experienced human operator. Human operators are, however, far more
versatile. Humans can switch job tasks easily. Robots are built and programmed
to be job specific. You wouldn’t be able to program a welding robot to start
counting parts in a bin. Today’s most advanced industrial robots will soon
become “dinosaurs.” Robots are in the infancy stage of their evolution. As
robots evolve, they will become more versatile, emulating the human capacity
and ability to switch job tasks easily. While the personal computer has made an
indelible mark on society, the personal robot hasn’t made an appearance.
Obviously there’s more to a personal robot than a personal computer. Robots
require a combination of elements to be effective: sophistication of intelligence,
movement, mobility, navigation, and purpose.

Without risking human life or limb, robots can replace humans in some
hazardous duty service. Robots can work in all types of polluted environments,
chemical as well as nuclear. They can work in environments so hazardous that
an unprotected human would quickly die.
Hardware Specifications
 Arduino UNO
 AT MEGA 384P-PU
 Ultrasonic modules HC-SR04
 Microcontroller
 Motor Driver L293D
 DC Battery 12 Volt
 DC motors 150 rpm
 Robot Body
 Crystal
 Bluetooth Module HC05
 Buzzer
 LEDs

Software Specification
 Arduino IDE
 Proteus
THE TASK

The purpose of this project is to build a robotic car which could be


controlled using voice commands. Generally these kinds of systems
are known as Speech Controlled Automation Systems (SCAS). Our
system will be a prototype of the same. We are not aiming to build a
robot which can recognize a lot of words. Our basic idea is to develop
some sort of menu driven control for our robot, where the menu is
going to be voice driven. What we are aiming at is to control the robot
using following voice commands.
The robot can do these basic tasks:-
1. Move forward
2. Move back
3. Turn right
4. Turn left
5. Load
6. Release
7. Stop (stops doing the current job)
DIAGRAM
CODE

#include <SoftwareSerial.h>

SoftwareSerial BT(0, 1); //TX, RX respetively

int Echo1=6;

int Trig1=7;

int Echo2=9;

int Trig2=8;

int distance1=0,distance2=0;

String readcommand;

int red_light=0;

int front_light=0;

int horn=0;

int extra=0;

int back_sound=0;

int obstacle=0;

int distance1_test(){

digitalWrite (Trig1,LOW);

delayMicroseconds(2);

digitalWrite (Trig1,HIGH);

delayMicroseconds(20);

digitalWrite (Trig1,LOW);

float Fdistance=pulseIn(Echo1,HIGH);

delay(10);
Fdistance=Fdistance/29/2;

return (int)Fdistance;

int distance2_test(){

digitalWrite (Trig2,LOW);

delayMicroseconds(2);

digitalWrite (Trig2,HIGH);

delayMicroseconds(20);

digitalWrite (Trig2,LOW);

float Fdistance=pulseIn(Echo2,HIGH);

delay(10);

Fdistance=Fdistance/29/2;

return (int)Fdistance;

void r_forward(){

digitalWrite(2,HIGH);

digitalWrite(3,LOW);

digitalWrite(4,HIGH);

digitalWrite(5,LOW);

red_light=0;

back_sound=0;

obstacle=1;

Serial.print("forward");}
void r_back(){

digitalWrite (2,LOW);

digitalWrite (3,HIGH);

digitalWrite (4,LOW);

digitalWrite (5,HIGH);

red_light=0;

back_sound=1;

obstacle=0;

Serial.print("back");}

void r_right(){

digitalWrite(2,LOW);

digitalWrite(3,HIGH);

digitalWrite(4,HIGH);

digitalWrite(5,LOW);

red_light=0;

back_sound=0;

obstacle=0;

Serial.print("right");

void r_left(){

digitalWrite (2,HIGH);

digitalWrite (3,LOW);

digitalWrite (4,LOW);
digitalWrite (5,HIGH);

red_light=0;

back_sound=0;

obstacle=0;

Serial.print("left");

void r_stop(){

digitalWrite (2, LOW);

digitalWrite (3, LOW);

digitalWrite (4, LOW);

digitalWrite (5, LOW);

red_light=1;

back_sound=0;

obstacle=0;

Serial.print("stop");}

void r_rright(){

digitalWrite (2, LOW);

digitalWrite (3, LOW);

digitalWrite (4, HIGH);

digitalWrite (5, LOW);

red_light=0;

back_sound=0;

obstacle=0;}
void r_rleft(){

digitalWrite (2, HIGH);

digitalWrite (3, LOW);

digitalWrite (4, LOW);

digitalWrite (5, LOW);

red_light=0;

back_sound=0;

obstacle=0;}

void setup()

BT.begin(38400);

Serial.begin(38400);

pinMode(Echo1, INPUT);

pinMode(Trig1, OUTPUT);

pinMode(Echo2, INPUT);

pinMode(Trig2, OUTPUT);

pinMode(2, OUTPUT);

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

void loop() {

distance1= distance1_test();

distance2= distance2_test();

digitalWrite(11,red_light);

digitalWrite(10,front_light);

digitalWrite(13,horn);

//digitalWrite(12,extra);

while (BT.available())

char c = BT.read();

readcommand += c;

if (readcommand.length() > 0)

Serial.println(readcommand);

if((readcommand == "*forward#")||(readcommand == "F")){

r_forward();}

else if((readcommand == "*left#")||(readcommand == "L")){

r_left();}
else if ((readcommand == "*back#")||(readcommand == "B")){

r_back();}

else if (( readcommand == "*right#")||(readcommand == "R")){

r_right();}

else if ((readcommand == "*stop#")||(readcommand == "S")){

r_stop();}

else if ((readcommand == "*rotate right#")||(readcommand == "I")){

r_rright();}

else if ((readcommand == "*rotate left#")||(readcommand == "G")){

r_rleft();}

else if ((readcommand == "*front light#")||(readcommand == "W"))

if(front_light==1){

front_light=0;}

else if(front_light==0){

front_light=1;}

else if (readcommand == "w")

front_light=0;

else if ((readcommand == "*horn#")||(readcommand == "V"))

{
if(horn==1){

horn=0;}

else if(horn==0){

horn=1;}

else if (readcommand == "v")

horn=0;

else if ((readcommand == "*extra#")||(readcommand == "X"))

if(extra==1){

extra=0;}

else if(extra==0){

extra=1;}

else if (readcommand == "x")

extra=0;

readcommand="";}//command if end

if(obstacle==1){
if(distance1<25){

//r_stop();

if(distance2<25){

r_left();

obstacle=1;

else if(distance2>=25){

r_right();

obstacle=1;

else if(distance1>=25){

r_forward();}}

if(extra==1){

digitalWrite(12,HIGH);

delay(200);

digitalWrite(12,LOW);

// delay(100);

if(back_sound==1){

digitalWrite(13,HIGH);

delay(200);

digitalWrite(13,LOW);
//delay(100);

} //Reset the variable

You might also like