Design For Accessibility: Getting it right from the start
Project final filewith front
1. Shri G.S. Institute of Technology
& Science
2015-2016
DEPARTMENT OF ELECTRONICS &
INSTRUMENTATION ENGINEERING
EI-4741/91: PROJECT PHASE-I/II
PROJECT REPORT
ON
BLUETOOTH BASED HOME
AUTOMATION SYSTEM
GUIDED BY: SUBMITTED BY:
Prof. R. C. Gurjar PANKAJ PATIDAR (0201EC121041)
Elex. & Instru. Engg. Dept SUNIL MAHOR (0801EI133D10)
SGSITS UTKARSH SHUKLA (0801EI121057)
Indore VISHNU SHARMA (0801EI133D12)
2. Shri G.S. Institute of Technology
& Science
2015-2016
DEPARTMENT OF ELECTRONICS &
INSTRUMENTATION ENGINEERING
RECOMMENDATION
This is to certify that the project entitled “BLUETOOTH BASED
HOME AUTOMATION SYSTEM” is a beneficiary work carried out
by:
PANKAJ PATIDAR (0201EC121041)
SUNIL MAHOR (0801EI133D10)
UTKARSH SHUKLA (0801EI121057)
VISHNU SHARMA (0801EI133D12)
Studying in Bachelorof Engineering , Final year of Department of
Electronics & Instrumentation Engineering in the session DEC 2015
– MAY 2016 ofthis institute and have completed a practical course
based on the syllabus and given a satisfactory account of it in this report.
Prof. R. C. Gurjar
Elex. & Instru. Engg. Dept
SGSITS
Indore
3. Shri G.S. Institute of Technology
& Science
2015-2016
DEPARTMENT OF ELECTRONICS &
INSTRUMENTATION ENGINEERING
CERTIFICATE
This is to certify that the project entitled “BLUETOOTH BASEDHOME
AUTOMATION SYSTEM” is a beneficiary work carried out by:
PANKAJ PATIDAR (0201EC121041)
SUNIL MAHOR (0801EI133D10)
UTKARSH SHUKLA (0801EI121057)
VISHNU SHARMA (0801EI133D12)
Studying in BachelorofEngineering , Final year of Department of
Electronics & Instrumentation Engineering in the session DEC 2015 –
MAY 2016 of this institute and have completed a practical course based on
the syllabus and given a satisfactory account of it in this report.
Internal Examiner External Examiner
Date: Date:
4. Shri G.S. Institute of Technology
& Science
2015-2016
DEPARTMENT OF ELECTRONICS &
INSTRUMENTATION ENGINEERING
CERTIFICATE
This is to certify that the project entitled “BLUETOOTH BASEDHOME
AUTOMATION SYSTEM” is a beneficiary work carried out by:
PANKAJ PATIDAR (0201EC121041)
SUNIL MAHOR (0801EI133D10)
UTKARSH SHUKLA (0801EI121057)
VISHNU SHARMA (0801EI133D12)
Studying in BachelorofEngineering , Final year of Department of
Electronics & Instrumentation Engineering in the session DEC 2015 –
MAY 2016 of this institute and have completed a practical course based on
the syllabus and given a satisfactory account of it in this report.
Dr. D. K. Mishra Prof. R. K. Saxena Prof. R. C. Gurjar
(Head of Department) (Director) (Project Guide)
Elex. & Instru. Engg. SGSITS, Indore Elex. & Instru. Engg.
5. ACKNOWLEDGEMENT
We are very grateful to our project guide of Electronics &
Instrumentation Engineering, SGSITS Indore, Prof. R. C. Gurjar, who
laid the time bound program for the successfulcompletion of this project.
He initiated our thoughts and extended timely suggestions and for his
technical supportand valuable suggestions for which we are deeply
indebted to him. We are grateful to him for his comments and insights in
the preparation of this project report without which this report would not
have been completed.
We thank sincerely and profusely to all staff members of our Department
of our Institute for their valuable help and guidance.
We also express our gratitude to the Institute Management to all those
who have indirectly help us in the successfulcompletion of this project.
Last but not the last, we are deeply indebted to our parents for what we
are today, because this project report would not have been a reality
without their love and support.
Yours Sincerely,
PANKAJ PATIDAR (0201EC121041)
SUNIL MAHOR (0801EI133D10)
UTKARSH SHUKLA (0801EI121057)
VISHNU SHARMA (0801EI133D12
6. P a g e | 1
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Table of Content
1. Overview of Project
1.1 Introduction
1.2 Block diagram
1.3 ProjectModules
2. Hardware Description
2.1 Microcontroller
2.1.1 ATMEGA 8
2.1.2 Block Diagram
2.1.3 Features
2.1.4 Pin diagram
2.1.5 Pin description
2.2 BLUETOOTH MODULE (HC-05): Overview
2.2.1 Specifications
2.2.2 Pin out configuration
2.2.3 TypicalApplication Circuit
2.2.4 Pairing
2.2.5 Hc-05 Bluetooth module working voltage
2.2.6 Serialcommunication
2.3 Driver IC
2.3.1 ULN2003 Darlington TransistorArrays
2.3.2 Simplified Schematics
2.3.3 FunctionalBlock Diagram
2.3.4 Pin diagram
2.3.5 InductiveLoad Drive
2.3.6 ResistiveLoad Drive
2.4 Switches
2.4.1 Relay
7. P a g e | 2
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2.5 Connector
2.6 Aurdino burner
2.7 LED
2.7.1 Overview
2.7.2 Pin diagram
3. Software Introduction
3.1 EAGLE
4. Program
4.1 PROGRAMCODE
5. Circuit diagram & Component List
5.1 Component list
5.2 Circuit daigram
6. Problem descriptions
7. Advantages & Disadvantages
7.1 Advantages
7.2 Disadvantages
8. Future scope
9. Conclusion
References
8. P a g e | 3
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
1. OVERVIEW OF PROJECT
1.1 INTRODUCTION:
Automation involves introducing a degree of computerized or automatic control
to certain electrical and electronic systems in a building. These include lighting,
temperature control, etc. The past decade has seen significant advancement in
the field of consumer electronics. Various intelligent appliances such as cellular
phone, air conditioners, home security devices, home theaters, etc., are set to
realize the concept of a smart home. They have given rise to a Personal Area
Network in home environment, where all these appliances can be interconnected
and monitored using a single controller.
This project demonstrates an automation system which contains a remote mobile
hostcontroller and several client modules (eg.Office, home appliances). The client
modules communicate with the host controller through a wireless device such as
a Bluetooth enabled mobile phone, in this case, an android based Smart phone.
Although automation today is not a new thing but most advanced home
automation systems in existence today require a big and expensive change of
infrastructure. We have proposed an automation system that can control
appliances like TVs, Fan, Tube lights from an android mobile using Bluetooth. In
this a low cost secure cell phone based, flexible automation system is introduced.
Devices are connected to the microcontroller based switching circuit.
The communication between the cell phone and the microcontroller board is
wireless. Additional devices can be connected into the system with little
9. P a g e | 4
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
modifications. The phone will be Android OS based phone. The switching circuit
will be having microcontroller coding to control the electronics devices like fans
and lights etc. 8-bit microcontroller board based on the ATMEGA 8 and the HC-05
Bluetooth module is used. It supports wireless serial communication over
Bluetooth. This board has 28 digital input and output ports.
The atmega 8 can be programmed using the microcontroller’s high-level
interactive embedded C language. The Bluetooth antenna in our module picks up
the packets sent from the cell phone. Subsequently, these packets containing the
device status as commands are pipelined through atmega8 microcontroller and
the designed analogue circuitry according to the definition of each output.
Different home or office appliances are connected to the digital output ports of
the circuit via relays to provide sufficiently high currents and voltage
compatibility. For test purposes, 25W, 240V lamps will be used.
We send commands from an application which is developed in phone to turn
ON/OFF a device. A feedback circuit has been designed and implemented to
indicate the devices actual status after it receives the command (ON/OFF) from
the cell phone. Once the command has been sent to turn ON a device, the
feedback circuit senses the current and gives an output signal by turning ON a
respective led on the switching circuitry indicating that the device is ON.
Otherwise, the device is malfunctioning indicating that the command was not
executed successfully. We can also operate the appliances of Home or Office in
Bluetooth range area.
10. P a g e | 5
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
1.2 Block diagram:-
Figure 1: Block diagram of Bluetooth based home automation
In this block diagram communication is in both direction between android mobile
and Bluetooth module. This communication is done one by one only one at a
time. This communication is called half duplex.
Feedback is done by getting 220v.feedback circuitry is so deigned that
microcontroller can easily sense.
1.3 Project Modules :-
The project can be better described by dividing it into two categories, namely,
1. Hardware
2. Software
2. Hardware Description
11. P a g e | 6
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2.1 Microcontroller:-Micro controller is just like a small computer but the basic
difference comes in size and memory. These have CPU, RAM, ROM, I/O and
timers are all on a single chip. It means you don’t need any extra device to make it
functional like with a micro-processor. Generally this microcontroller is used
where a specific task is needed to do. So fixed amount of on-chip ROM, RAM, and
number
2.1.1.ATMEGA 8:- The Atmel AVR ATmega8 is a low-power CMOS 8-bit
microcontroller based on the AVR RISC architecture. By executing powerful
instructions in a single clock cycle, the ATmega8 achieves throughputs
approaching 1MIPS per MHz, allowing the system designer to optimize power
consumption versus processing speed.
The Atmel®AVR® core combines a rich instruction set with 32 general purpose
working registers. All the 32 registers are directly connected to the Arithmetic
Logic Unit (ALU), allowing two independent registers to be accessed in one single
instruction executed in one clock cycle. The resulting architecture is more code
efficient while achieving throughputs up to ten times faster than conventional
CISC microcontrollers.
2.1.2. Block Diagram:-
12. P a g e | 7
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Figure 2: Block diagram micro controller of atmega8
13. P a g e | 8
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2.1.3. Features
I. High-performance, Low-power Atmel®AVR® 8-bit Microcontroller
II. Advanced RISC Architecture
III. 130 Powerful Instructions – Most Single-clock Cycle Execution
IV. 32 × 8 General Purpose Working Registers
V. Fully Static Operation
VI. Up to 16MIPS Throughput at 16MHz
VII. On-chip 2-cycle Multiplier
VIII. High Endurance Non-volatile Memory segments
IX. 8Kbytes of In-System Self-programmable Flash program memory
X. 512Bytes EEPROM
XI. 1Kbyte Internal SRAM
XII. Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
XIII. Data retention: 20 years at 85°C/100 years at 25°C(1)
XIV. Optional Boot Code Section with Independent Lock Bits
XV. In-System Programming by On-chip Boot Program
XVI. True Read-While-Write Operation
– Programming Lock for Software Security
2.1.4 Pin diagram:-
14. P a g e | 9
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig. 3: Pin Diagram of ATMEGA 8
2.1.5. Pin description:-
i. VCC Digital supply voltage.
ii. GND Ground.
15. P a g e | 10
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
iii. Port B (PB7..PB0)
XTAL1/XTAL2/TOSC1/
TOSC2
PortB is an 8-bitbi-directional I/O portwith internal pull-up resistors (selected for
each bit). The Port B output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port B pins that are externally
pulled low will sourcecurrentif the pull-up resistors are activated. The Port B pins
are tri-stated when a reset condition becomes active, even if the clock is not
running. Depending on the clock selection fuse settings, PB6 can be used as input
to the inverting Oscillator amplifier and input to the internal clock operating
circuit. Depending on the clock selection fuse settings, PB7 can be used as output
from the inverting Oscillator amplifier.
If the Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is used
as TOSC2..1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is
set.
iv. Port C (PC5..PC0)
Port C is an 7-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The Port C output buffers have symmetrical drive characteristics
with both high sink and sourcecapability. As inputs, Port C pins that are externally
pulled low will sourcecurrentif the pull-up resistors are activated. The Port C pins
are tri-stated when a reset condition becomes active, even if the clock is not
running.
16. P a g e | 11
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
v. PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the
electrical characteristics of PC6 differ from those of the other pins of Port C.
If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level
on this pin for longer than the minimum pulse length will generate a Reset, even if
the clock is not running. The minimum pulse length is given in Table 15 on page
38. Shorter pulses are not guaranteed to generate a Reset. The various special
features of Port C are elaborated on page 61.
vi. Port D (PD7..PD0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The Port D output buffers have symmetrical drive characteristics
with both high sink and source capability. As inputs, Port D pins that are
externally pulled low will source current if the pull-up resistors are activated. The
Port D pins are tri-stated when a reset condition becomes active, even if the clock
is not running. Port D also serves the functions of various special features of the
ATmega8
vii. RESET
Reset input. A low level on this pin for longer than the minimum pulse length will
generate a reset, even if the clock is not running. The minimum pulse length is
given in Table 15. Shorter pulses are not guaranteed to generate a reset.
viii. AVCC
AVCC is the supply voltage pin for the A/D Converter, Port C (3..0), and ADC
(7..6). It should be externally connected to VCC, even if the ADC is not used. If the
17. P a g e | 12
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
ADC is used, it should be connected to VCC through a low-pass filter. Note that
Port C (5..4) use digital supply voltage, VCC.
ix. AREF
AREF is the analog reference pin for the A/D Converter.
ADC7..6 (TQFP andQFN/MLF Package
Only)
In the TQFP and QFN/MLF package, ADC7..6 serve as analog inputs to the A/D
converter. These pins are powered from the analog supply and serve as 10-bit
ADC channels.
2.2 BLUETOOTH MODULE (HC-05):
Overview: Communication device:-over project is based on wireless
communication between micro controller and mobile phone. But alone micro
controller is not able to communicate directly to the android mobile phone.
Bluetooth Serial module’s operation doesn’t need drive, and can communicate
with the other Bluetooth device that has the serial. But communication between
two Bluetooth modules requires at
Least two conditions:
(1) The communication must be between master and slave.
(2) The password must be correct.
HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup. Serial port Bluetooth
18. P a g e | 13
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR
Blue core 04‐External single chip Bluetooth system with CMOS technology and
with AFH (Adaptive Frequency Hopping Feature). It has the Foot print as small as
12.7mmx27mm.
HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup. Serial port Bluetooth
module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband Bluetooth
Wireless networks for short range communications have a wide spread usage of
Bluetooth radio transmissions between 2400–2480 MHz Modern mobile devices
embed small, low-powered and cheap integrated chips functioning as short-range
radio transceivers for Bluetooth radio communications. Device pairing,
authentication, encryption and authorization techniques have given recognition
to Bluetooth technology due to its vital security mechanisms.
Different types of Bluetooth applications can be developed using Android
platform architecture using the Bluetooth profiles. The device manufacturers
provide the services using the support of these profiles in their devices to
maintain compatibility for the Bluetooth technology
19. P a g e | 14
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig. 4.HC-05 Bluetooth
2.2.1. Specifications
Hardware features
Typical -80dBm sensitivity.
Up to +4dBm RF transmits power.
Low Power 1.8V Operation, 3.3 to 5 V I/O.
PIO control.
UART interface with programmable baud rate.
With integrated antenna.
With edge connector.
Software features
Slave default Baud rate: 9600, Data bits:8, Stop bit:1,Parity:No parity.
PIO9 and PIO8 can beconnected to red and blue led separately. When master
and slaveare paired, red and blue led blinks 1time/2s in interval, while
disconnected only blue led blinks 2times/s.
Auto connects to the last device on power as default.
Permit pairing device to connect as default.
Auto pairing PINCODE:”1234” as default.
Auto reconnect in 30 min when disconnected as a result of beyond the
20. P a g e | 15
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
range of connection.
2.2.2. Pin out configuration
Figure 5: Pin-out of HC-05
2.2.3. Typical Application Circuit:
2.2.4. Pairing:
After connect the Bluetooth module, scan for new devices from the Android
phone and you will find the module with the device name “HC-05”, after that,
click to connect, if some message appears asking about “Pairing code” just put
“1234” as default code.
21. P a g e | 16
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
BLUE LED = ACTIVE (Blinking 500ms period inactive connection, change 1seg with
active connection)
How to get to the standard communication mode
1. Leave free KEY, don’t connect it to VDD neither GND.
2. Supply power to the module. Then the module will enter to communication
mode. Itcan be used for pairing.
2.2.5. HC-05 BLUETOOTH MODULE WORKING VOLTAGE:-
The Bluetooth module HC-05 is used to receive & transmit data between
Bluetooth device and MCU. It requires power supply from 3.3V to 5V.
2.2.6. SERIAL COMMUNICATION:-
To transfer to a device located many meters away, the serial method is used. The
data is sent one bit at a time. Here not 8bit data is send 2 extra bit are send along
with it .this two bit are called start bit and stop bit. These two bit are used so
synchronization can be done between transmitter and receiver.
2.3 Driver IC:
2.3.1 ULN2003 Darlington Transistor Arrays:-
The ULN2003 device is a high-voltage, high- current Darlington transistor array.
The device consists of eight NPN Darlington pairs that feature high-voltage
outputs with common-cathode clamp diodes for switching inductive loads. The
collector-current rating of each Darlington pair is 500 mA. The Darlington pairs
may be connected in parallel for higher current capability.
22. P a g e | 17
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2.3.2 Simplified Schematics
Fig. 6.Simplified Schematics of ULN2003
2.3.3. Functional Block Diagram:
Fig. 7.Functional block diagram of ULN2003
23. P a g e | 18
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Each channel of ULN2003 consists of Darlington connected NPN transistors. This
connection creates the effect of a single transistor with a very high current gain.
This can be as high as 10,000 A/A atcertain currents. Thevery high gain allows for
high output current drive with a very low input current, essentially equating to
operation with low GPIO voltages. The GPIO voltage is converted to base current
via the 2.7 kΩ resistor connected between the input and base of the pre-driver
Darlington NPN. The 7.2 kΩ & 3.0 kΩ resistors connected between the base and
emitter of each respective NPN act as pull-downs and suppress the amount of
leakage that may occur from the input. The diodes connected between the output
and COMpin is used to suppress thekick-back voltage from an inductive load that
is excited when the NPN drivers are turned off (stop sinking) and the stored
energy in the coils causes a reverse current to flow into the coil supply via the
kick-back diode. In normal operation the diodes on base and collector pins to
emitter will be reversed biased. If these diode are forward biased, internal
parasitic NPN transistors will draw (a nearly equal) current from other (nearby)
device pins.
24. P a g e | 19
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2.3.4 Pin diagram:-
Fig. 8.pin diagramof ULN 2003
ULN2003 Darlington Transistor Arrays pin no 10 can be used for inductive or non-
inductive load. These high output current driver pin can sink 500mA.If
requirement of more current then two pin can also be connected parallel. Parallel
connection must be done both input and output. Input and output current will
multiply according to number of input and output connected parallel.
2.3.5 Inductive LoadDrive
When the COM pin is tied to the coil supply voltage, ULN2003 is able to drive
25. P a g e | 20
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
inductive loads and suppress theKick-back voltage via the internal freewheeling
diodes.
2.3.6 Resistive Load Drive
When driving a resistive load, a pull-up resistor is needed in order for ULN2003 to
sink current and for there to be a logic high level. The COM pin can be left floating
for these applications
2.4 Switches:-
Switches are used for connecting or disconnecting electrical circuit. Many types of
switches are there. Some are operate mechanically or electrically. Some types are
SPST, SPDT, DPST and DPDT in case of switch. SPST stands for single pole single
through, SPDTstands for single pole double through, DPST stands for double pole
single through and DPDT stands for double pole double through, In relays points
are defines by NO, NC. NO stand for normally on and NC stands for normally off.
2.4.1 Relay:-
Relays are electromagnetic switch. Which can be turn on and off by Appling
electrical current. Working voltage is printed on the relay. In this project we are
using 6volt relay. Many relay use an electromagnet to mechanically operate a
switch.
Fig.9. Relays
26. P a g e | 21
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
The term Relay generally refers to a device that provides an electrical connection
between two or morepoints in responseto the application of a control signal. The
most common and widely used type of electrical relay is the electromechanical
relay or EMR.
The most fundamental control of any equipment is the ability to turn it “ON” and
“OFF”. The easiest way to do this is using switches to interrupt the electrical
supply. Although switches can be used to control something, they have their
disadvantages. The biggest one is that they have to be manually (physically)
turned “ON” or “OFF”. Also, they are relatively large, slow and only switch small
electrical currents. Electrical Relays however, are basically electrically operated
switches that come in many shapes, sizes and power ratings suitable for all types
of applications. Relays can also have single or multiple contacts within a single
package with the larger power relays used for mains voltage or high current
switching applications being called “Contactors”.
In this tutorial about electrical relays we are just concerned with the fundamental
operating principles of “light duty” electromechanical relays we can use in motor
control or robotic circuits. Such relays are used in general electrical and electronic
control or switching circuits either mounted directly onto PCB boards or
connected free standing and in which the load currents are normally fractions of
an ampere up to 20+ amperes. The relay circuit are common
in Electronics applications.
As their name implies, electromechanical relays are electro-magnetic devices that
convert a magnetic flux generated by the application of a low voltage electrical
control signal either AC or DC across the relay terminals, into a pulling mechanical
force which operates the electrical contacts within the relay. The most common
27. P a g e | 22
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
form of electromechanical relay consist of an energizing coil called the “primary
circuit” wound around a permeable iron core.
This iron core has both a fixed portion called the yoke, and a moveable spring
loaded part called the armature, that completes the magnetic field circuit by
closing the air gap between the fixed electrical coil and the moveable armature.
The armature is hinged or pivoted allowing it to freely move within the generated
magnetic field closing the electrical contacts that are attached to it. Connected
between the yoke and armature is normally a spring (or springs) for the return
stroke to “reset” the contacts back to their initial rest position when the relay coil
is in the “de-energized” condition, i.e. turned “OFF”.
Electromechanical Relay Construction
Fig.11 Electromagnetic relay
In our simple relay above, we have two sets of electrically conductive contacts.
Relays may be “Normally Open”, or “Normally Closed”. One pair of contacts are
classed as Normally Open, (NO) or make contacts and another set which are
classed as Normally Closed, (NC) or break contacts. In the normally open position,
28. P a g e | 23
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
the contacts are closed only when the field current is “ON” and the switch
contacts are pulled towards the inductive coil.
In the normally closed position, the contacts are permanently closed when the
field currentis “OFF” as the switch contacts return to their normal position. These
terms Normally Open, Normally Closedor Make and Break Contacts refer to the
state of the electrical contacts when the relay coil is “de-energized”, i.e, no supply
voltage connected to the relay coil. Contact elements may be of single or double
make or break designs. An example of this arrangement is given below.
The relays contacts are electrically conductive pieces of metal which touch
together completing a circuit and allow the circuit current to flow, just like a
switch. When the contacts are open the resistance between the contacts is very
high in the Mega-Ohms, producing an open circuit condition and no circuit
current flows.
When the contacts are closed the contact resistance should be zero, a short
circuit, but this is not always the case. All relay contacts have a certain amount of
“contact resistance” when they are closed and this is called the “On-Resistance”,
similar to FET’s. With a new relay and contacts this ON-resistance will be very
small, generally less than 0.2Ω’s because the tips are new and clean, but over
time the tip resistance will increase.
For example. If the contacts are passing a load current of say 10A, then the
voltage drop across the contacts using Ohms Law is 0.2 x 10 = 2 volts, which if the
supply voltage is say 12 volts then the load voltage will be only 10 volts (12 – 2).
As the contact tips begin to wear, and if they are not properly protected from
high inductive or capacitive loads, they will start to show signs of arcing damage
29. P a g e | 24
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
as the circuit current still wants to flow as the contacts begin to open when the
relay coil is de-energized.
This arcing or sparking across the contacts will cause the contact resistance of the
tips to increase further as the contact tips become damaged. If allowed to
continue the contact tips may become so burnt and damaged to the point were
they are physically closed but do not pass any or very little current.
If this arcing damage becomes to severe the contacts will eventually “weld”
together producing a short circuit condition and possible damage to the circuit
they are controlling. If now the contact resistance has increased due to arcing to
say 1Ω’s the volt drop across thecontacts for the sameload currentincreases to 1
x 10 = 10 volts dc. This high voltage drop across the contacts may be unacceptable
for the load circuit especially if operating at 12 or even 24 volts, then the faulty
relay will have to be replaced.
To reduce the effects of contact arcing and high “On-resistances”, modern contact
tips are made of, or coated with, a variety of silver based alloys to extend their life
span as given in the following table.
2.5 Connector:-
Connectors are used for joining two wires temporally by using connector big
circuit can be divided and after completion they can rejoin. Now a day’s every
time inverter circuited can be removed out without using de soldering.
2.6 Aurdino burner:-
Arduino is common term for a software company, project, and user community,
that designs and manufactures computer open-source hardware, open-source
30. P a g e | 25
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
software, and microcontroller-based kits for building digital devices and
interactive objects that can sense and control physical devices.[1]
Fig.12 AurdinoBurner Board
Arduino is common term for a software company, project, and user community,
that designs and manufactures computer open-source hardware, open-source
software, and microcontroller-based kits for building digital devices and
interactive objects that can sense and control physical devices.[1]
The project is based on microcontroller board designs, produced by several
vendors, using various microcontrollers. These systems provide sets of digital and
analog I/O pins that can interface to various expansion boards (termed shields)
and other circuits. The boards feature serial communication interfaces, including
Universal Serial Bus (USB) on some models, for loading programs from personal
31. P a g e | 26
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
computers. For programming the microcontrollers, the Arduino project provides
an integrated development environment(IDE) based on a programming language
named Processing, which also supports the languages C and C++.
The first Arduino was introduced in 2005, aiming to provide a low cost, easy way
for novices and professionals to create devices that interact with their
environment using sensors and actuators. Common examples of such devices
intended for beginner hobbyists include simple robots, thermostats, and motion
detectors.
Arduino boards are available commercially in preassembled form, or as do-it-
yourself kits. The hardware design specifications are openly available, allowing
the Arduino boards to be produced by anyone. Adafruit Industries estimated in
mid-2011 that over 300,000 official Arduinos had been commercially
produced,[2] and in 2013 that 700,000 official boards were in users' hands.
The project is based on microcontroller board designs, produced by several
vendors, using various microcontrollers. These systems provide sets of digital and
analog I/O pins that can interface to various expansion boards (termed shields)
and other circuits. The boards feature serial communication interfaces, including
Universal Serial Bus (USB) on some models, for loading programs from personal
computers. For programming the microcontrollers, the Arduino project provides
an integrated development environment(IDE) based on a programming language
named Processing, which also supports the languages C and C++.
The first Arduino was introduced in 2005, aiming to provide a low cost, easy way
for novices and professionals to create devices that interact with their
environment using sensors and actuators. Common examples of such devices
32. P a g e | 27
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
intended for beginner hobbyists include simple robots, thermostats, and motion
detectors.
Arduino boards are available commercially in preassembled form, or as do-it-
yourself kits. The hardware design specifications are openly available, allowing
the Arduino boards to be produced by anyone. Adafruit Industries estimated in
mid-2011 that over 300,000 official Arduinos had been commercially
produced,[2] and in 2013 that 700,000 official boards were in users' hands.
2.7 LCD:-
2.7.1 Overview
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 16x2 LCD display is very basic module and is very
commonly used in various devices and circuits. These modules are preferred
over seven segments and other multi segment LEDs. The reasons being: LCDs are
economical; easily programmable; have no limitation of displaying special &
even custom characters (unlike in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines.
In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two
registers, namely, Command and Data.
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data
register stores the data to be displayed on the LCD. The data is the ASCII value of
the character to be displayed on the LCD. Click to learn more about internal
structure of a LCD.
33. P a g e | 28
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2.7.2 Pin Diagram:
Fig.13 PinDiagramof LCD
2.7.3 PIN Description:-
Pin No Function Name
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
4 Selects command register when low; and data register when high Register Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7
8-bit data pins
DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
34. P a g e | 29
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
3. Software
INTRODUCTION: Electronic design automation (EDA or ECAD) is a category
of software tools for designing electronic systems such as printed circuit boards
and integrated circuits. The tools work together in a design flow that chip
designers use to design and analyze entire semiconductor chips. The various
software’s used are:
3.1 EAGLE:-
EAGLE stands for, Easily Applicable Graphical Layout Editor in English
and, Einfach anzuwendender grafischer Layout-Editor inGerman. It is designed
and developed by CadSoft Computer GmbH and is a flexible, expandable and
scriptable, electronic design automation (EDA) application with schematic capture
editor, printed circuit board (PCB) layout editor, auto-router and computer-aided
manufacturing (CAM) and bill of materials (BOM) tools. Premier Farnell bought
EAGLE in 2008.[1]
35. P a g e | 30
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig.14 Imageof Eagle Software
36. P a g e | 31
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
4. Program
4.1 PROGRAM CODES:
#include <LiquidCrystal.h>
const int Relay1 = 9;
const int Relay2 = 10;
const int Relay3 = 11;
const int Relay4 = 12;// the number of the pushbutton pin
const int ledPin = 13;
LiquidCrystal lcd(7,6,5,4,3,2);
void setup() {
// initialize both serial ports:
Serial.begin(9600);
lcd.begin(16,2);
lcd.print("Bluetooth Based ");
lcd.setCursor(0,1);
lcd.print("Home Automation");
pinMode(ledPin, OUTPUT);
pinMode(Relay1, OUTPUT);
37. P a g e | 32
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
digitalWrite(Relay1,0);
digitalWrite(Relay2,0);
digitalWrite(Relay3,0);
digitalWrite(Relay4,0);
delay(3000);
lcd.clear();
}
void loop() {
lcd.setCursor(0,0);
lcd.print("*Press Any Key* ");
if (Serial.available()>0) {
delay(10);
lcd.setCursor(0,1);
char x = Serial.read();
Serial.println(x);
while(Serial.available()>0)
38. P a g e | 33
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
{
// x = Serial.read();
Serial.read();
}
if(x=='a')
{
digitalWrite(Relay1,1);
Serial.println("one on");
lcd.print("Device One On ");
}
else if(x=='b')
{
digitalWrite(Relay1,0);
Serial.println("one off");
lcd.print("Device One OFF ");
}
else if(x=='c')
{
digitalWrite(Relay2,1);
39. P a g e | 34
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Serial.println("two on");
lcd.print("Device Two On ");
}
else if(x=='d')
{
digitalWrite(Relay2,0);
Serial.println("two off");
lcd.print("Device Two Off ");
}
else if(x=='e')
{
digitalWrite(Relay3,1);
Serial.println("three on");
lcd.print("Device Three On");
}
else if(x=='f')
{
digitalWrite(Relay3,0);
Serial.println("three off");
40. P a g e | 35
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
lcd.print("Device Three Off ");
}
else if(x=='g')
{
digitalWrite(Relay4,1);
Serial.println("four on");
lcd.print("Device Four On ");
}
else if(x=='h')
{
digitalWrite(Relay4,0);
Serial.println("four off");
lcd.print("Device Four Off ");
}
else if(x=='i')
{
digitalWrite(Relay1,1);
delay(8);
Serial.println("all on");
41. P a g e | 36
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
lcd.print("All Device On ");
digitalWrite(Relay2,1);
delay(10);
digitalWrite(Relay3,1);
delay(10);
digitalWrite(Relay4,1);
delay(10);
}
else if(x=='j')
{
digitalWrite(Relay1,0);
digitalWrite(Relay2,0);
digitalWrite(Relay3,0);
digitalWrite(Relay4,0);
lcd.print("All Device Off ");
Serial.println("all off");
}
else
{
42. P a g e | 37
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Serial.println("invalid key");
lcd.print("Invalid Key ");
}
}
}
5. Circuit diagram & Component List
5.1. Component list:-
S.No Component Name Nos. Required
1 HC-05 Bluetooth module 1
2 ATMEGA8 micro controller IC 1
3 ULN2003 IC 1
4 12V relay 4
5 Crystal oscillator 16MHz 1
6 820Ω Resistor 4
7 7.5k resistor 6
8 22pf ceramic capacitor 2
9 1000µf electrolyte capacitor 2
10 7805 IC 1
11 16*2 LCD Display 1
12 220v to 12v step down transformer 1
13 rectifier 1
14 LED 6
15 Switch 1
43. P a g e | 38
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
5.2 Circuit Diagram:
Fig.15 Circuit diagram of main board
44. P a g e | 39
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig.16 Circuit diagram of Relay board
Fig.17 Component Layout of Main Board
45. P a g e | 40
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig.18 PCB Layout of main board
Fig.19 Component Layout of Relay Board
46. P a g e | 41
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig.20 PCB Layout of relay board
6. Problem description
The various problems & FAQ’s associated with the project are:
6.1. No manual control to switch on and off or in system when
failed:-
In that case we can use a two way switch so if automation system fails than
control given to manual. As the manual control provided unskilled user can
perform his routine control. As shown below.
In fig a two way connection with relay is shown. The control act as a XOR
operation mines that output is one when both input are same. So output is
available when positions of both switches are same.
47. P a g e | 42
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
Fig. 21.Wiring connection to switch
6.2. No confirmation of change of output:-
To overcome this problem programming can be do so that controller can
compare its previous state. So if state of switch not changes than
controller send an error comes or no change.
6.3. No debugging option:-
This can be a very good feature of project i.e. you can check that where
problem comes at hardware or in software. So controller gave all
information about communication.
6.4. Complex user interface:-
User interface must be simple so no need to teach the other every time.
But in similar project interface is complex.
48. P a g e | 43
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
6.5. Different key to on and off:-
In survey it is seen that there are two different key to turn n and off
appliances. But if in programming toggle of bit is done then more
automation can be done in this project.
6.6. Restart power at every new pairing of device:-
In HV-05 Bluetooth module if a device is parried then this configuration is
save. So at every new device pairing needs restart of circuit power. This
problem can be removed if we use a feature of HC-05 Bluetooth i.e. “key”
this a pin in Bluetooth that can remove all paired detail when this pin
high pulses. So connection of this pin with micro controller can rest the
pairing.
6.7. Large change in house wiring:-
In similar project the automation done by mobile only so all connection
needs to change in wiring and removal of button connection is needed
.So to avoid this circuit is so design as sown in problem 1 solution.
6.8. Security of hacking control:-
The Bluetooth connection kept open so other con connect and take
control. so the master user must connect to Bluetooth and removal of
pair info must by master controller by software control.
49. P a g e | 44
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
7. Advantages & Disadvantages
7.1 Advantages
1. Wireless control:-
By using this project wireless control can be within the hands of user.
2. Monitoring:-
This circuit allow monitoring of all appliance within range of communication
with Bluetooth.
3. Status checking :-
When user doesn’t know appliances is on off then user can only check the
status only.
4. Confirmation of changing switch state:-
When switch is press ten two status will be shown on mobile phone i.e. old
status and new status
5. Manual control:-
Manual control is given so an unskilled user can be change the current
status.
7.2. Disadvantages:-
1. Bluetooth range:-
It is good to use Bluetooth for automation but automation is kept within a
range 0f 10-30 metres. So control can be achieved from outside range.
50. P a g e | 45
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
2. Connection:-
Application must be connected after disconnection from Bluetooth.
3. configuration of application software:-
If new user want to connect then first download application software and
then code must be enter and more configuration must be done.
8. FUTURE SCOPE
This project can be further developed by integrating it with the internet to
monitor your home while sitting in a remote area. By doing this, one can keep an
eye on his or her home through an internet connected to the user’s mobile phone
or PC or laptop. This will not only improve the security of your home in this
modern day world but will also assist in conservation of energy like if you left any
home appliance switched on by mistake, then you can check the status of the
appliance on the graphical interface made on your mobile and can switch it off
using the internet connectivity.
51. P a g e | 46
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
9. CONCLUSION
In conclusion, this low cost system is designed to improve the standard living in
home. The remote control function by smart phone provides help and assistance
especially to disabled and elderly. In order to provide safety protection to the
user, a low voltage activating switches is replaced current electrical switches.
Moreover, implementation of wireless Bluetooth connection in control board
allows the system install in more simple way. The control board is directly
installed beside the electrical switches whereby the switching connection is
controlled by relay.
Furthermore, flexible types of connections are designed as backup connections to
the system. The connected GUIs are synchronized to the control board. They
indicate the real-time switches status. The system is designed in user-friendly
interface. The easy to use interface on Window and Android GUI provides simple
control by the elderly and disabled people.
For future work, the Window GUI will be implemented with speech recognition
voice control. The android GUI will be implemented as a remote Bluetooth
microphone to the Window GUI. All the voice signal inputs to the smart phone
will be transmitted to the Window GUI for signal processing. Also, the push
buttons implemented in low voltage activating switches will be replaced by
52. P a g e | 47
Bluetooth Based Home Automation System
Department of Electronics and Instrumentation, Shri G.S. Institute of Technology and Science, Indore
capacitive sensing switches. All the future work is expected without spend extra
cost, even one cent from the current system.
REFERENCES
1. Arduino burner for ATMEL Chips
https://paramountmechatronics.wordpress.com.
2. Serial Bluetooth Module, Tiny OS Electronics,
http://www.tinyosshop.com
3. ATmega8 bit Microcontroller, ATMEL Corporations,
http://www.atmel.com
4. The official Bluetooth website fromBluetooth SIG:
http://www.bluetooth.com
5. The 8051 microcontroller and embedded systems by Muhammad Ali
Mazidi and Janice Gillispie Mazidi.