Bluetooth Controlled Home Automation System Using 8051 Microcontroller
Bluetooth Controlled Home Automation System Using 8051 Microcontroller
Bluetooth Controlled Home Automation System Using 8051 Microcontroller
7 Comments (/microcontroller-projects/bluetooth-controlled-home-
automation-using-8051/#comments)
BuyGroceryOnline
GetUpto15%Off&Extra10%CashBack.UseCouponFR15.OrderNow!
Imagine that you can control the electronic appliances of your home from anywhere inside the
house, just using your Smart phone.In this project, wewill use wireless Bluetooth technology to
control the Home Electronic Appliances through a Android Phone. Bluetooth has a range of 1015 meters, so that you can switch ON and OFF any electronic appliance within the range. We have
also developed a Toy car controlled by Android Phone (http://circuitdigest.com/microcontrollerprojects/bluetooth-controlled-robot-car-using-arduino), using Bluetooth module and Arduino.
Here we have used 8051 microcontroller with a Bluetooth module, for wirelessly receive the data,
sent from the Android Phone. So that microcontroller can Turn ON and OFF the home appliances
accordingly. [Check here more 8051 microcontroller based projects (http://circuitdigest.com/8051microcontroller-projects)]
Main Components
8051 microcontroller
Bluetooth Module HC05
Relay
ULN2003
Bulb
Holder
Wire
IC 7805
Android phone
Bluetooth controller app Android app
10uf capacitor
1000uf capacitor
10K resistor
1k resistor
Power Supply
Bluetooth Module:
HC-05 Bluetooth module consists two things one is Bluetooth serial interface module and a
Bluetooth adaptor. Bluetooth serial module is used for converting serial port to Bluetooth.
Bluetooth module has two modes one is master mode and second one is slave mode. User can set
either mode by using some AT commands. Even user can set modules setting by using AT
command. Here is some commands uses are given:
WindowsVistaDrivers
windowsvista.driverupdate.net
DriverUpdateforWindowsVistaMicrosoftCertifiedPartner!
StartDownload
panStamplowpowerradio
ColgateToothbrush
AegonLifeTermPlan
ClubMahindraHolidays
VirtualNumberforOffice
Recover/RepairDataFiles
SensorLibrary
HomeAutomation
First of all user need to enter AT mode with 38400 bps baud rate by pressing EN button at
Bluetooth module or by giving HIGH level at EN pin. Note: all commands should ends with \r\n
(0x0d and 0x0a) or ENTER KEY from keyboard.
Working Explanation:
In this project we have used 8051 microcontroller for controlling the whole process of this project.
And a Bluetooth module is used for controlling the home appliances wirelessly. Home appliances
will turned ON and OFF when user will touch button in the Bluetooth mobile app in Android mobile
phone. To run this project, first we need to download Bluetooth app form Google play store. We
can use any Bluetooth app that can send data using Bluetooth. Here are some apps name that can
be used:
1. Bluetooth Spp pro
2. Bluetooth controller
After installing the App, you need to open it and then search Bluetooth device and select HC-05
Bluetooth device. And then configure keys.
Here in this project we have used Bluetooth controller app.
1. Download and install Bluetooth Controller.
2. Turned ON mobile Bluetooth.
3. Now open Bluetooth controller app
4. Press scan
5. Select desired Bluetooth device (Bluetooth Module HC-05).
6. Now set keys by pressing set buttons on screen
To set keys we need to press set button and set key according to picture given below:
Now, when we touch any button in Bluetooth controller app then Android phone sends a value to
Bluetooth module, after receiving this value, Bluetooth module sends the received value to the
microcontroller and then microcontroller reads it and compare it with predefined value. If any
match is occurred then microcontroller performs relative operation. Same operation will performed
each time when button pressed.
Now, when user touch Fan On button in Bluetooth controller app then microcontroller receives 1
via Bluetooth module and then controller Switch On the Fan by using relay driver and relay. And
when user touch Fan Off button in Bluetooth controller app then microcontroller receives 2 via
Bluetooth module and then controller Switch Off the Fan by using relay driver and relay.
Likewise 3,4,5,6 numbers are sent by Android Phone, when Light On, Light Off, TV On, TV Off button
has been touched respectively:
Button
Data
Operation
Fan On
Fan Turned On
Fan Off
Light On
Light Turned On
Light Off
TV On
TV Turned On
TV Off
TV Turned Off
65
Shares
19
(/fullimage?i=circuitdiagram_mic/Bluetooth-Controlled-Home-Automation-Circuit-diagram.gif)
Adsby Google BluetoothArduinoGPSArduinoOneArduinoRF
Program Explanation:
In this program, first of all we have included header file and defines input, output pins and
variables.
#include<reg51.h>
sbitFan=P2^0;
sbitLight=P2^1;
sbitTV=P2^2;
charstr;
charCharin=0;
Here we have some functions that we have used in our program. In this we have configured
9600bps baud rate at 11.0592MHz Crystal Frequency.
voidSerialwrite(charbyte)
{
SBUF=byte;
while(!TI);
TI=0;
}
voidSerialprintln(char*p)
{
while(*p)
{
Serialwrite(*p);
p++;
}
Serialwrite(0x0d);
}
voidSerialbegin()
{
TMOD=0x20;
SCON=0x50;
TH1=0xfd;
TR1=1;
}
After this, in main program we have initialized UART and monitored the SBUF register for receiving
the data. Then data is matched and compared with predefined values and relative operation has
been performed.
voidmain()
{
P2=0x00;
Serialbegin();
Serialprintln("SystemReady...");
delay(50);
while(1)
{
while(!RI);
Charin=SBUF;
str=Charin;
RI=0;
if(str=='1')
{
Fan=1;
Serialprintln("FanON");
delay(50);
}
elseif(str=='2')
{
Fan=0;
Serialprintln("FanOFF");
delay(50);
}
So thats how we can create a whole system for the house and can connect all the AC appliances
to the 8051 microcontroller using Relays. And this bluetooth controlled home automation
systemcan be operated from a Smart phone.
Adsby Google ArduinoGPSArduinoOneArduinoRFArduinoCan
Code:
#include<reg51.h>
sbit Fan=P2^0;
sbit Light=P2^1;
sbit TV=P2^2;
char str;
char Charin=0;
void delay(int time)
{
unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
}
void Serialwrite(char byte)
{
SBUF=byte;
while(!TI);
TI=0;
}
void Serialprintln(char *p)
{
while(*p)
{
Serialwrite(*p);
p++;
}
Serialwrite(0x0d);
}
void Serialbegin()
{
TMOD=0x20;
SCON=0x50;
TH1=0xfd;
TR1=1;
}
void main()
{
P2=0x00;
Serialbegin();
Serialprintln("System Ready...");
delay(50);
while(1)
{
while(!RI);
Charin=SBUF;
str=Charin;
RI=0;
if(str=='1')
{
Fan=1;
Serialprintln(" Fan ON");
delay(50);
}
else if(str=='2')
{
Fan=0;
Serialprintln(" Fan OFF");
delay(50);
}
else if(str=='3')
{
Light=1;
Video:
Bluetooth Controlled Home Automation Using 8051
Levelswitch
Robust,simplesolutions
forreliableleveldetection.
Comments (7)
Pearl
reply (/comment/reply/246/1081)
Please I can't really interpret the circuit diagram and what software did you use for
the simulation (was it proteus)
Feb 05, 2016
saddam khan
reply (/comment/reply/246/1115)
Shah Hussain
reply (/comment/reply/246/1208)
ronnie
reply (/comment/reply/246/1305)
reply (/comment/reply/246/1325)
Abhishek
Use Keil IDE.
reply (/comment/reply/246/1321)
ronnie
sir i'm using egbt-045ms as my bluetooth module. what will be the adjustment?
Feb 24, 2016
reply (/comment/reply/246/1347)
ronnie
Can i usethe same android app. even i'm using egbt-045ms as my bluetooth
module?
Feb 25, 2016
Leave a comment
Your name *
E-mail *
The content of this field is kept private and will not be shown publicly.
Subject
Comment *
Save
Preview
RELATED CONTENT
LATEST POSTS
(/microcontroller-projects/arduino-gps-clock)
(/microcontroller-projects/reading-gps-data-using-computer-and-arduino)
(/microcontroller-projects/vehicle-tracking-system-using-arduino-gps-and-gsm)
Adsby Google
BluetoothDownload
InstallBluetooth
BluetoothDriver
(/electronic-circuits/simple-led-music-light)
(/microcontroller-projects/arduino-snake-game-using-8x8-led-matrix)
Add Project
(/node/add/community-projects)
USER LOGIN
E-mail or username *
Password *
Log in
(/microcontroller-projects/vehicle-
(/electronic-circuits/vu-meter-
(/electronic-circuits/simple-aud
tracking-system-using-arduino-
using-lm3914)
amplifier-circuit)
gps-and-gsm)
Popular Topics: Robotics Projects (/robotics-projects) | Arduino Uno Projects (/arduino-uno-projects) | Electronics
Projects (/electronics-projects) |555 Timer Circuits (/555-timer-circuits) | ATmega32 Projects (/atmega32-projects) |
ATmega8 Projects (/atmega8-projects) | Audio Circuits (/audio-circuits) | 4017 Circuits (/4017-circuits)