Home Automation System
Home Automation System
Home Automation System
Project Report on
Home Automation System
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
#include <SoftwareSerial.h>
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(){
red_light=1;
back_sound=0;
obstacle=0;
Serial.print("stop");}
void r_rright(){
red_light=0;
back_sound=0;
obstacle=0;}
void r_rleft(){
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);
r_forward();}
r_left();}
else if ((readcommand == "*back#")||(readcommand == "B")){
r_back();}
r_right();}
r_stop();}
r_rright();}
r_rleft();}
if(front_light==1){
front_light=0;}
else if(front_light==0){
front_light=1;}
front_light=0;
{
if(horn==1){
horn=0;}
else if(horn==0){
horn=1;}
horn=0;
if(extra==1){
extra=0;}
else if(extra==0){
extra=1;}
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);