20
BLUETOOTH DEVICE CONTROL THROUGH ANDROID APPLICATION DR B R AMBEDKAR NATIONAL INSTITUTE OF TECHNOLOGY JALANDHAR, DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING. PROJECT GUIDE Submitted by: Dr. R K Sunkaria G. Praveen G3/13104073.

BLUETOOTH DEVICE CONTROL THROUGH ANDROID APPLICATION

Embed Size (px)

Citation preview

Page 1: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

BLUETOOTH DEVICE CONTROL THROUGH ANDROID APPLICATION

DR B R AMBEDKAR NATIONAL INSTITUTE OF TECHNOLOGY JALANDHAR,

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING.

PROJECT GUIDE Submitted by:

Dr. R K Sunkaria G. Praveen

G3/13104073.

Page 2: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

CONTENTS

Abstract

Project Goals

Circuit Diagram

Components

Block Diagram

Operation

Advantages

Applications

Designed Circuit

Limitations

References

Conclusion

Page 3: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

Project Abstract

Now a days everyone is using smartphone and even children find ease in operating it. Smartphones are used a minimum of seven times a day, then why can’t we use a smart phone to control our daily objects. Our smartphone consists of so wireless communication modules like Bluetooth,Wifi and some sensors like proximity sensor,accelerometer sensor,IRetc….To use any hardware of the smartphone we have to use an application which runs on that operating system. So,in this project I am using an android application to control home appliances through Bluetooth.

Page 4: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

PROJECT GOALS

Effective use of wireless communication in operating Electrical Devices

To bridge the gap between smart phones and electrical devices

Bluetooth works up to a range of 15 meters, so user can use anywhere at home.

Create a reliable modern switches.

Page 5: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

CIRCUIT DIAGRAM

Page 6: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

COMPONENTS USED:

Componentsname

values

Transformer 12V, 1 Amp

Zener diodes ----

Capacitancec1,c2

1000uF,10uF

7805 ----

led’s ----

Resistances 10Kohms,100ohms

LCD display 16x2

Potentiometer 10K ohms range

Push Button ----

Componentsname

values

Crystal Oscillator 11.0592 Hz

Relays 12V

Bluetooth Module

----

ULN2003 IC ----

Bulb 10W

8051 microcontroller

----

Smartphone ----

Page 7: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

Block Diagram

Page 8: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

OPERATION

Page 9: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

Microcontroller AT89S52

The AT89S52 is a low-power, high performance CMOS 8bit microcontroller with 8k bytes of in-system programmable flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The Atmel AT89S52 is a powerful microcontroller which provides a highlyflexible and cost-effective solution to many embedded control applications.

The AT89S52 Provides the following standard features: 8K bytes of flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. The AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The powerdownmode saves the RAM contents but freezes the oscillator, disabling all other chip function until the next interrupt or hardware reset.

Page 10: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

Bluetooth HC-05

Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz[4]) from fixed and mobile devices, and building personal area networks (PANs). Invented by telecom vendor Ericsson in 1994,[5] it was originally conceived as a wireless alternative to RS-232 data cables. It can connect several devices, overcoming problems of synchronization.

Hc-05 can be connected as server-client model, data transmission is based on master-slave technique.Master-Slave can exchange their roles after connection is made.In this project hc-05 is in server mode and smartphone is connected as client.

Page 11: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

ADVANTAGES & APPLICATIONS

Wireless communication with PC input and output devices, the most common being the mouse, keyboard and printer.

More useful for old people and handicapped persons.

Using this project for controlling devices is completely handsfree.

For low bandwidth applications where higher USBbandwidth is not required and cable-free connection desired.

Establishing small range personal networks.

Page 12: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

Code#include<reg52.h>

#define lcdport P2

sbit rs=P3^4;

sbit en=P3^6;

sbit rw=P3^5;

sbit o1=P1^0;

sbit o2=P1^1;

sbit o3=P1^2;

sbit o4=P1^3;

void delay(int a)

{

int i,j;

for(i=0;i<a;i++)

for(j=0;j<1000;j++);

}

void lcdcmd(char a)

{

rs=0;

en=1;

lcdport=a;

delay(10);

en=0;

}

void lcddata(char a)

{

rs=1;

en=1;

lcdport=a;

delay(10);

en=0;

}

void initialise()

{

lcdcmd(0x38);

lcdcmd(0x06);

lcdcmd(0x0c);

lcdcmd(0x84);

}

void printstring(unsigned char *s)

{

while(*s!='\0')

{

lcddata(*s);

s++;

}

}

Page 13: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

void init()

{

TMOD=0x20;

TH1=0xfd;

SCON=0x50;

TR1=1;

}

void main()

{

char ch;

char ch1[]="BlueTooth";

char ch2[]="Device Control";

char ch3[]="TV:";

char ch4[]=" FAN:";

char ch5[]="A/C:";

char ch6[]=" LHT:";

char ch7[]="on ";

char ch8[]="off";

rw=0;

o1=o2=o3=o4=0;

init();

initialise();

printstring(ch1);

lcdcmd(0xc1);

printstring(ch2);

delay(100);

lcdcmd(0x80);

printstring(ch3);

lcdcmd(0x86);

printstring(ch4);

lcdcmd(0xc0);

printstring(ch5);

lcdcmd(0xc7);

printstring(ch6);

lcdcmd(0x83);

printstring(ch8);

lcdcmd(0x8d);

printstring(ch8);

lcdcmd(0xc4);

printstring(ch8);

lcdcmd(0xcd);

printstring(ch8);

while(1)

{

ch=SBUF;

RI=0;

if(ch=='a')

{

o1=0;

lcdcmd(0x83);

printstring(ch8);

}

Page 14: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

lse if(ch=='f')

{

o1=1;

lcdcmd(0x83);

printstring(ch7);

}

else if(ch=='h')

{

o2=0;

lcdcmd(0x8d);

printstring(ch8);

}

else if(ch=='g')

{

o2=1;

lcdcmd(0x8d);

printstring(ch7);

}

else if(ch=='j')

{

o3=0;

lcdcmd(0xc4);

printstring(ch8);

}

else if(ch=='i')

{

o3=1;

lcdcmd(0xc4);

printstring(ch7);

}

else if(ch=='l')

{

o4=0;

lcdcmd(0xcd);

printstring(ch8);

}

else if(ch=='k')

{

o4=1;

lcdcmd(0xcd);

printstring(ch7);

}

else

{

}

}

}

Page 15: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

CIRCUITS DESIGNED

Page 16: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

PCB DESIGNING FOR CIRCUIT

Page 17: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

LIMITATIONS :

Embedded system designed should be ON everytime which leads to power consumption.

Bluetooth is restricted to only 15 mts,for long distance communications it is not desirable.In such cases wifi is preferable.

Quite Expensive, the Embedded system designed it costs uptoRs.1000/-

Smartphone is necessary,without a smartphone user cannot operate the devices.

Page 18: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

References :

8051 Microcontroller – Programming (Mohammad Ali Mazidi)

http://www.google.co.in/

Page 19: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION

CONCLUSION

By accomplishing this project, we now appreciate the technology.

Through this project, we have now seen an exact application of theory such as serial communication, server-client data transmission,developing android application and a/c interfacing.

Page 20: BLUETOOTH   DEVICE CONTROL  THROUGH         ANDROID APPLICATION