Bluetooth Based Home Automation

download Bluetooth Based Home Automation

of 15

description

DSSF

Transcript of Bluetooth Based Home Automation

Bluetooth Based Home Automation

Bluetooth Based Home Automation

Bluetooth based Home AutomationAbluetoothchipisdesignedto replacecablesbytakingthe information normally carried by the cable and transmitting it at a special frequency to a receiver bluetooth chip, whichwill then givethe information received tothe computer, phone whatever. This Bluetooth wireless technology is set to revolutionize the way people perceive digital devices in homes and office environment. This technology is especially useful in home environment, where hardly any infrastructure exist to interconnect intelligent appliances.

Bluetooth based home automation system provides a great advantage to switch on/off the devices from anywhere within the bluetooth range. So there is no need to go to the switch and start/stop the appliance. Only connect it with the bluetooth of your cell phone and sending the letters. If you press A then 1st appliance will turn ON then press B to OFF it. Similarly for the 2nd appliance press C to ON & press D to OFF and so on.

The cell phone having the Android application platform is only used for building the connection. First of all download software TERMINAL which has capability to connect to the bluetooth module. Some persons who are unable to walk to switch board, also who are old persons need this type of project because they can switch on/off the load with cell phone without moving away from their place.

Block Diagram:

Fig1 shows the flow of design in the form of blocks. The Bluetooth signal from cell phone having Android application platform is received by the bluetooth module. The android application software TERMINAL has a keypad which shows the alphabets. These alphabets are used as input to operate the appliances. Bluetooth module transmits these signals which can be received by kick start board. The kick start board has microcontroller and 7805IC for +5V power supply assembled on it. Adaptor is used for providing +12V supply to kick start board & relay driver module. Relays are then connected to the appliances as switching device.

According to the microcontroller programming the output goes to the input of relay driver module and LCD. The red indication of LED at relay driver section show on/off of a particular relay as four relays are connected to this section. The microcontroller also interfaced with LCD which displays the output of microcontroller that which relay is on/off.

Circuit Description of Kick Start Board:Fig2 shows the circuit of kick start board. The 1st circuit is +5V power supply section. This circuit will provide a regulated voltage to microcontroller. The circuit comprises of mainly 7805 voltage regulator IC (IC4). +12V supply given as input to 7805IC through dc jack. The capacitor C10 must have high voltage rating to safely handle the input voltage feed to circuit. +5V output of 7805IC results the red LED to glow which refers as a Power ON Indication.MAX232 IC (IC3) is used as logic convertor to make the serial communication signal; received through db9 connector; compatible with microcontroller. Its pin no 13 & 14 is connected to the pin 3 & 2 of db9 connector respectively to receive the signal. Similarly its pin no 11 & 12 are connected to 11 & 12 of microcontroller to transmit the converted signal. It requires 4 capacitors i.e. C4, C6, C7 & C8 of 10uf.

The heart of the kick start board is microcontroller P89V51RD2. it is a 40 pin 8051-based microcontroller with 64K+8K kB Flash and 1024 bytes of data RAM32 I/O lines, 3 Timers/Counters, 9 Interrupts/4 priority levels, SPI, Dual Data Pointers, WDT, 5-channel PCA. 4 jumpers of 10 pins JP1 to JP4 are used to connect the ports of microcontroller and remaining two pins of jumpers are assigned as +5V and gnd. Resistor array is used at port 0. The reset circuit connected at pin9 and crystal oscillator at pin18 & 19. +12V supply is given to the Push-to-on switch JP7 to start the board.

Circuit description of Relay driver module:Fig5 shows the circuit of relay driver module. It is build around the PNP transistors which works in the saturation mode. The input pins 4 through 1 are connected to the bases of the transistor T1 through T4, respectively.

Input pin4 of JP1 goes high to drive transistor T1 into saturation and drives the relay1 and LED1 connected to it. Similarly pin3 through pin1 goes high to drive transistor T2 through T4 into saturation respectively and drive the connected relay and LED. Depending on the logic, the relay gets through transistors; the relay circuit becomes short or open to ON or OFF the connected load respectively.

Diode D1 to D4 and resistor R10 to R13 maintains the LED from burning. in $ ofthrough 1 the bases of the transistor T1 through T4, respectively. Diode D5 to D8 blocks the back EMF from transistor if occurs and Resistors R2 to R5 limits the current to maintain the transistor from any damage. The supply of +12V for the circuit is provided by the kick start board.

Circuit description:Fig8 shows the circuit diagram of Bluetooth controlled home automation system comprising Bluetooth module, Kick start board, LCD and Relays. Here only 1 appliance is connected to relay to show the connections. More than one appliance can be connected to it.

Bluetooth module is used to connect the device with cell phone bluetooth, so whenever ground & +5V supply is given to this module; it starts and detect the available bluetooth device within 12 seconds maximum. The red LED blinks when it starts detecting the device. This bluetooth module receives the signal from the cell phone and then transmits them to microcontroller for further processing. The communication between bluetooth module and microcontroller is done through db9 connector cable. Bluetooth module and kick start board has db9 connector which acts as transmitter & receiver respectively.The P89V51RD2 microcontroller also act as the heart of the system as it receives the signal, programmed it and then gives the output to Relay driver module to operate the relays for controlling the ON/OFF action of appliances. The kick start board output at port P2.0, P2.1, P2.2, P2.3 is connected to the input pins IN4, IN3, IN2, IN1 of relay driver module as Port2 of microcontroller is bidirectional port. Here it is used as output port for microcontroller.

Adaptor provides the +12v supply to kick start board for 7805IC assembled on it and also to Relay driver module to drive relays. Input on Relay driver module also drives relay through transistor. The red LED indication on Relay driven board tells us that the operation of ON/OFF is done on the appliance which is connected to this relay. Now how to connect the appliance? Relay is used as switching device in the path of appliance to AC Mains. Rather than connecting an appliance directly to ac main power, connect its one terminal to relay and other one to supply. Similarly one end of relay to power supply. Thus relay is connected between the main supply and appliance. Switching action of relay is responsible for the required operation and appliance ON/OFF according to the instruction given by the cell phone bluetooth operator.

Also an LCD is interfaced with microcontroller to display the output of microcontroller. For interfacing, port0 is used to give output to data pins of LCD i.e. pin7-14. Pin5 is grounded for write operation. Connect pin4 & pin6 to microcontroller port P3.4 & P3.6 respectively. +5V supply is given by the kick start board.

Construction:The Actual-size, single-side PCB for the kick start board and relay driver module is shown in fig3 & fig6 respectively. Its component layout in fig4 & fig7 respectively. The wired connections for Bluetooth based Home Automation are shown in the fig7. Assemble the PCBs with various components along with the IC bases. Arrange all modules. Connect them as shown in fig7. Start bluetooth module and bluetooth of Cell phone. Connect it and test it by pressing the alphabets. The operation displays on the LCD and the appliance works according to the pressed alphabets.

Software:The software is written in Embedded C language. Compile it to obtain hex code. Burn the generated hex code into the microcontroller. The software is well commented and easy to understand.

PARTS LIST:Bluetooth Module 16x2 alphanumeric LCDKick start BoardSemiconductor:IC1- P89V51RD2 microcontroller IC4- 7805, 5V regulatorIC3- MAX232ND1- 1N4007 rectifier DiodeCapacitors:C1, C2- 33pf ceramicC3, C4, C6, C7, C8- 10uf, 25V electrolyticC10- 100uf, 25V electrolyticResistors:R1- 10-kilo-ohmR10- 220-ohmMiscellaneous:Q1- KDS110592 Crystal oscillatorX9- db9 ConnectorJ1- DC JackRN2- 8-pin Resistor ArrayJP1, JP3, JP5, JP6- pin headsJP7- Push-to-on SwitchH1, H2, H3, H4- Mount-pad3mm LEDVertical jumper40-pin IC Base14-pin IC Base3-pin IC BaseTactile SwitchRelay driver Module:Semiconductor:D1, D2, D3, D4, D5, D6, D7, D8- 1N4007 DiodeT1, T2, T3, T4- BC547 transistorsResistors:R10, R11, R12, R13, R41, D3, D4, , single-side PCB for Relay driver moduleFig: Component layout for Relay driver module- 1-kilo-ohm R2, R3, R4, R5- 10-kilo-ohmMiscellaneous:X3, X4, X5, X6`- 3 pin terminal blockRelay1, Relay2, Relay3, Relay4- 12V, Q3F-1Z relayH3, H4- mount-pad4 SMD resistorsLED 3mm REDsPin heads

RelaysRelay 1Relay 2Relay 3Home appliancesRelay 4Adaptor(12V Supply)Bluetooth moduleKick start board (Assembled microcontroller & other components)Relay Driver moduleLCDCell phone Bluetooth

Tx

Rx

Tx

Rx12V supply

Fig1: Block diagram

Fig2: Circuit diagram of Kick start board

Fig3: Actual-size, single-side PCB for Kick start board

Fig4: Component layout for Kick start board

Fig5: Circuit diagram of Relay driver module

Fig6: Actual-size, single-side PCB for Relay driver module Fig7: Component layout for Relay driver module

Fig8: Circuit diagram of Bluetooth based Home Automation

//Final Bluetooth Based Home Automation code#include//Header file for 8051 registor#include//Header file for LCD

//Data and Command port Selection

//LCD#define LCDdata P0//Declaring LCDdatasbit LCDrs = P3^4;//The Register select Pinsbit LCDen = P3^6;//The Enable Pin

// Motorsbit LM1P=P2^0; //left motor +vesbit LM1N=P2^1;//left motor -vesbit RM1P=P2^2; //Right motor +vesbit RM1N=P2^3; //Right motor ve

/*

Prototype: void MSdelay(unsigned int);Return Type: voidArguments: unsigned intDescription: Generates time delay in milliseconds

*/void delay(unsigned int rtime){unsigned int r,s;for(r=0;r