DESIGN AND IMPLEMENTATION OF SMART HOME … · · 2018-03-15PIC16F877A features 256 bytes of...
Transcript of DESIGN AND IMPLEMENTATION OF SMART HOME … · · 2018-03-15PIC16F877A features 256 bytes of...
DESIGN AND IMPLEMENTATION OF SMART HOME CONTROL SYSTEMS USING POWER LINE COMMUNICATION
Sai Vishal1
,S.T. Aarthy2,Tungala Sai Puneeth
,Neelisetty Jagadeesh
4
1,2,3,4B.Tech, Electronics and Communication, University, Chennai, India
[email protected], [email protected], [email protected], [email protected]
SRM
Abstract: A smart home network uses a multitude
of sensors and and all of them have to be
connected to each other. Each set of sensors in a
particular room is considered as a node. In
traditional smart homes wireless sensor networks
(WSN) are used. WSNs have a number of
problems. Here we hope to over to overcome them
using PLC. The sensors in the PLC based smart
home network are connected using the electrical
wiring running through the house. These cables
have a phase and a neutral. The phase which is
used to transmit electricity is also used to transmit
the signals from the sensors. The sensors are
connected to a PIC microcontroller which is then
connected to a PLC modem. The PLC modem then
either modulates or demodulates the signal from or
to the PIC microcontroller in any of the nodes. The
readings of each node can be read from the PIC
microcontroller in the same node. In addition to
this all the readings from all the nodes can be read
on the PC. The modulation technique used in the
PLC modem is Orthogonal Frequency Division
Multiplexing (OFDM).
Keywords: power line communication, smart
homes, orthogonal frequency division multiplexing
1. Introduction
Every device in today's world is going smart,
starting from mobile phones to TV's and even
refrigerators and homes. Smart homes are still very
uncommon but this will change in the coming
years. A smart homes consists of multiple sensors
and devices operating together to make the user as
comfortable as possible.
Most of the existing and even proposed
architectures of smart homes use wireless sensor
networks (WSN)[1] .But wireless systems have
multiple problems like range, interference, packet
loss, scalability, etc., so they are not very efficient.
These problems can be overcome by using wired
solutions but, the reason we even use wireless
solutions is that wires are incredibly messy and
whatever you do to cover all the wires is time
consuming, difficult and we might even end up
drilling holes in our walls.
An efficient and elegant solution is either a
wireless system which does not succumb to the
problems given above or a non messy wired
system. In this work the latter is used. The
question now is how to arrange a non messy wired
system that also does not need an excessive
amount of time to arrange.
The answer is to use existing wiring in the house.
By using the existing wiring there is no mess
created compared to using new wiring. The cost is
also kept pretty low. But how do you transmit and
receive signals from and to the nodes, each of
which is placed in a different room.
There is a technology called power line
communication (PLC) or power line carrier
communication (PLCC)[1]. PLC allows us to send
information through the electrical wiring. This
technology has been in wide use since 1950 and
was mainly used by the grid stations to transmit
information at high speed.
The information from the node is sent to a PLC
modem. The modem then modulates the signal and
sends it through the phase of the electrical wiring.
PLC modems are connected to every node. So,
every PLC modem can send and receive
information from every other modem. A PC or
laptop is connected to any of the nodes and it
receives information from all the nodes.
The modem that we are using is KQ330, but other
modems can also be used. The KQ330 modem
uses Orthogonal Frequency Division Multiplexing
(OFDM) [2].
International Journal of Pure and Applied MathematicsVolume 115 No. 7 2017, 577-583ISSN: 1311-8080 (printed version); ISSN: 1314-3395 (on-line version)url: http://www.ijpam.euSpecial Issue ijpam.eu
577
2. Methodology
A smart home requires multiple components to
automate various things which would otherwise
require manual operation.
Given below is a block diagram of the prototype of
the proposed system:
Figure. 1. Block diagram
a) PLC Modem The device used to send and receive information
through the wiring is called the PLC modem. The
modem that we use is the KQ330[3]. It is one of the
components connected to the power supply.
Therefore, the input of the modem is 230V AC. The
modem modulates the information sent from and to
the PIC microcontroller. By using modulation
techniques, binary data stream is keyed on to a
carrier signal and then coupled on to the power lines
by the modem. At the receiver end another modem
detects the signal and extracts the corresponding bit
stream. Data is processed before transmission on
power lines. First data is modulated and filtered and
then by using couplers, it is sent over the power
lines.
A smart home requires multiple components to
automate various things which would otherwise
Given below is a block diagram of the prototype of
The device used to send and receive information
through the wiring is called the PLC modem. The
modem that we use is the KQ330[3]. It is one of the
components connected to the power supply.
Therefore, the input of the modem is 230V AC. The
ulates the information sent from and to
the PIC microcontroller. By using modulation
techniques, binary data stream is keyed on to a
carrier signal and then coupled on to the power lines
by the modem. At the receiver end another modem
d extracts the corresponding bit
stream. Data is processed before transmission on
power lines. First data is modulated and filtered and
then by using couplers, it is sent over the power
Figure. 2. KQ330 PLC modem module
The modulation technique used by the KQ330 is
Orthogonal Frequency Division Multiplexing
(OFDM) [2]. b) Why OFDM? The characteristics of the power line channel
continuously vary with time and load. So
conventional modulation tech
FSK or PSK cannot be employed
needs a technique that can deal with unpredictable
Attenuation and phase shifts.
Modulation techniques that can opt lower frequency
ranges of 35KHz to 95KHz can perform better as
compared to the whole available frequency band.
OFDM [2] is the modulation technique that is used
in home plug specification network appliances. In
OFDM, information is modulated on to a multiple
carrier, where each carrier occupies its own
frequency ranging from 4.3 to 20.9MHz. Incoming
bit stream is demultiplexed
parallel bit streams each with 1/N of original bit rate
which are modulated then on N orthogonal carriers.
By using multiple carriers at a time, the OFDM uses
the spectrum most efficiently. During the
transmission, each frequency is monito
any interferences, noise or data loss occurs, the
responsible frequency is ignored. However, this
OFDM does not perform well when a large
attenuation and jamming occurs in the
communication channel, yet it can perform effectively when compared to other modulation
techniques.
c) PIC Microcontroller
The microcontroller is quite literally the brains of
each node. In our prototype, PIC microcontroller,
specifically the PIC16F877A is used. The
PIC16F877A features 256 bytes of EEPROM data
memory, self-programming, an ICD, 2 Comparators,
8 channels of 10-bit Analog
converter, 2 capture/compare/PWM functions, the
synchronous serial port can be configured as either 3
wire Serial Peripheral Interface (SPI) or the 2
Inter-Integrated Circuit (I²C) bus and a Universal
Asynchronous Receiver Transmitter (USART). All of
these features make it ideal for more advanced level
A/D applications in
KQ330 PLC modem module
used by the KQ330 is
Orthogonal Frequency Division Multiplexing
The characteristics of the power line channel
continuously vary with time and load. So
conventional modulation tech-niques like ASK,
FSK or PSK cannot be employed with them. PLCC
needs a technique that can deal with unpredictable
Modulation techniques that can opt lower frequency
ranges of 35KHz to 95KHz can perform better as
compared to the whole available frequency band.
he modulation technique that is used
in home plug specification network appliances. In
OFDM, information is modulated on to a multiple
carrier, where each carrier occupies its own
frequency ranging from 4.3 to 20.9MHz. Incoming
bit stream is demultiplexed into N number of
parallel bit streams each with 1/N of original bit rate
which are modulated then on N orthogonal carriers.
By using multiple carriers at a time, the OFDM uses
the spectrum most efficiently. During the
transmission, each frequency is monitored and if
any interferences, noise or data loss occurs, the
responsible frequency is ignored. However, this
OFDM does not perform well when a large
attenuation and jamming occurs in the
communication channel, yet it can perform
to other modulation
The microcontroller is quite literally the brains of
each node. In our prototype, PIC microcontroller,
specifically the PIC16F877A is used. The
PIC16F877A features 256 bytes of EEPROM data
programming, an ICD, 2 Comparators,
bit Analog-to-Digital (A/D)
converter, 2 capture/compare/PWM functions, the
synchronous serial port can be configured as either 3-
wire Serial Peripheral Interface (SPI) or the 2-wire
Circuit (I²C) bus and a Universal
Transmitter (USART). All of
these features make it ideal for more advanced level
International Journal of Pure and Applied Mathematics Special Issue
578
automotive, industrial, appliances and consumer
applications.
Figure. 3.PIC16F877A
d) Temperature sensor The temperature sensor used is LM35. It is an IC
sensor that can be used to measure temperature (in oC) with an output voltage proportional to it.
Figure. 4. Temperature sensorLM35 The scale factor is .01V/
oC. It does not require any
external calibration or trimming and maintains an
accuracy of +/-0.4 oC at room temperature and +/
0.8 oC over a range of 0
oC to +100
important characteristic of the LM35DZ is that it
draws only 60 micro amps from its supply and
possesses a low self-heating capability. The output
voltage is converted to temperature by a simple
conversion factor. The sensitivity of the sensor is
10mV / oC. We use a conversion factor that is the
reciprocal, that is 100
oC/V. To output voltage to temperature we
use the following equation:
automotive, industrial, appliances and consumer
The temperature sensor used is LM35. It is an IC
sensor that can be used to measure temperature (in
C) with an output voltage proportional to it.
C. It does not require any
external calibration or trimming and maintains an
C at room temperature and +/-
C to +100 oC. Another
important characteristic of the LM35DZ is that it
from its supply and
heating capability. The output
voltage is converted to temperature by a simple
conversion factor. The sensitivity of the sensor is
C. We use a conversion factor that is the
utput voltage to temperature we
Temperature ( oC) = Vout * (100
So if Vout is 1V , then, Temperature = 100 The output voltage varies linearly with
temperature.
e) Humidity Sensor
Humidity Sensor is used to determine
humidity of the surrounding area. Humidity is the
amount of water vapor in the air. Humidity
indicates the probability of precipitation, dew or
fog. Higher humidity reduces the effectiveness of
sweating in cooling the body by reducing the rate
of evaporation of moisture from the skin.
Humidity is calculated in a heat index table or
humidex. The humidity sensor that is used here is
DHT11. It measures the realtive humidity which
is the current absolute humidity relative to the
maximum for that temperature
percentage.
Figure. 5. Humidity Sensor
f) Gas Sensor
A gas sensor is used to detect the presence of gas in
an area. It is used as a part of safety systems to
detect gas leaks. Here we use an MQ6
electrochemical gas sensor. It has high sensitivity to
LPG, iso-butane, propane and low sensitivity to
smoke and alcohol. It works by allowing gases to
diffuse through a porous membrane to an electrode
where it is either chemically oxidized or reduced.
The amount of current produced is determined by
how much of the gas is oxidized at
indicating the concentration of the gas. We use
electrochemical sensors because they are small and
they tended to be more stable and reliable over the
sensor's duration since the diffusion barrier is a
physical/mechanical barrier. Manufactures can also
customize electrochemical gas sensors by changing
the porous barrier to allow for the detection of a
certain gas concentration range.
C) = Vout * (100 oC/V)
So if Vout is 1V , then, Temperature = 100 oC
The output voltage varies linearly with
Humidity Sensor is used to determine the
humidity of the surrounding area. Humidity is the
amount of water vapor in the air. Humidity
indicates the probability of precipitation, dew or
fog. Higher humidity reduces the effectiveness of
sweating in cooling the body by reducing the rate
ration of moisture from the skin.
Humidity is calculated in a heat index table or
humidex. The humidity sensor that is used here is
DHT11. It measures the realtive humidity which
is the current absolute humidity relative to the
maximum for that temperature and is expressed in
. Humidity Sensor
A gas sensor is used to detect the presence of gas in
an area. It is used as a part of safety systems to
detect gas leaks. Here we use an MQ6
electrochemical gas sensor. It has high sensitivity to
butane, propane and low sensitivity to
lcohol. It works by allowing gases to
diffuse through a porous membrane to an electrode
where it is either chemically oxidized or reduced.
The amount of current produced is determined by
how much of the gas is oxidized at the electrode
ntration of the gas. We use
electrochemical sensors because they are small and
they tended to be more stable and reliable over the
sensor's duration since the diffusion barrier is a
physical/mechanical barrier. Manufactures can also
al gas sensors by changing
the porous barrier to allow for the detection of a
certain gas concentration range.
International Journal of Pure and Applied Mathematics Special Issue
579
Figure.6.Gas Sensor
g) LDR A Light Dependent Resistor (aka LDR,
photoconductor, or photocell) is a light controlled
variable resistor. It has a resistance that varies
according to the amount of light falling on its
surface. It exhibits photoconductivity which means
that its resistance decreases with increasing intensity
of incident light. Light dependent resistors are a
vital component in any electric circuit which is to be
turned on and off automatically according to the
level of ambient light. Figure.7.LDR h)LCD LCD (Liquid Crystal Display) a flat panel display
module. A 16x2 LCD display is very basic module
and is very commonly used in various devices and
circuits. LCD's are preferred over seven segments
and other multi segment LED's. The reasons being:
LCD's are economical; easily programmable; have
no limitation of displaying special & even custom
characters (unlike in seven segments), animations
and so on. A 16x2 LCD can display 2 lines, each consisting
of16 characters. 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 while the data
register stores the data to be displayed on the
LCD.
Light Dependent Resistor (aka LDR,
photoconductor, or photocell) is a light controlled
resistor. It has a resistance that varies
according to the amount of light falling on its
surface. It exhibits photoconductivity which means
that its resistance decreases with increasing intensity
of incident light. Light dependent resistors are a
mponent in any electric circuit which is to be
turned on and off automatically according to the
LCD (Liquid Crystal Display) a flat panel display
module. A 16x2 LCD display is very basic module
is very commonly used in various devices and
circuits. LCD's are preferred over seven segments
and other multi segment LED's. The reasons being:
LCD's are economical; easily programmable; have
no limitation of displaying special & even custom
unlike in seven segments), animations
A 16x2 LCD can display 2 lines, each consisting
of16 characters. In this LCD each character is
displayed in 5x7 pixel matrix. This LCD has two
s the command
instructions given to the LCD while the data
register stores the data to be displayed on the
A command is an instruction given to LCD to do
a predefined task like initializing it, clearing its
screen, setting the cursor position, contro
display etc. whereas the data comprises of the
ASCII value of the character to be displayed on
the LCD.
Figure .8. LCD i) Relay A relay is an electro-mechanical switch that is
capable of being remotely actuated/controlled.
The schematics involving relays could be very
simple, or incredibly complex since they may
employ the well-known "relay A relay contains two parts: a switch (or a system
of switches) that controls the
power/primary/analog circuits, and a digital
(remote) control part. Figure .9. Relay
j) DC Motor
A DC motor runs on DC electric power. It works on
the principal that when a current carrying conductor
is placed in Magnetic field, it experiences a torque
and has a tendency to move. This is known
motoring action. If the direction of current in the
wire is reversed, the direction of rotation also
reverses. The working principle of the DC motor is
based on
the fact that the interaction between magnetic field
and electric field produces a mechanica
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. whereas the data comprises of the
ASCII value of the character to be displayed on
mechanical switch that is
capable of being remotely actuated/controlled.
schematics involving relays could be very
simple, or incredibly complex since they may
known "relay-logic".
A relay contains two parts: a switch (or a system
of switches) that controls the
power/primary/analog circuits, and a digital
A DC motor runs on DC electric power. It works on
the principal that when a current carrying conductor
is placed in Magnetic field, it experiences a torque
and has a tendency to move. This is known as
motoring action. If the direction of current in the
wire is reversed, the direction of rotation also
reverses. The working principle of the DC motor is
the fact that the interaction between magnetic field
and electric field produces a mechanical force.
International Journal of Pure and Applied Mathematics Special Issue
580
.
Figure .9.DC Motor
k) Cooling and Exhaust Fans These are basically small PC fans to stimulate the
blower of an air conditioner and the exhaust of a
kitchen. Figure .11. Cooling and Exhaust Fans
l) Bulb The bulb or a tube switches on and off depending
on the LDR value. Any bulb can be used since it is
connected to the full 230V AC power supply
Figure .12. Bulb
3. Implementation of the
Proposed system The result of the implementation is the successful
transfer of information between the nodes and to
view all the information on the PC or laptop. Figure .13.Hardware Setup In node 1, the 230V AC power supply is
connected to the PLC modem and a 12V step
down transformer. The 12V transformer is
connected to the PIC microcontroller which is in
turn connected to the Temperature Sensor,
Humidity Sensor, PLC modem and the relay. Node 2 has a similar setup with some differences.
The 230V AC power supply is also connected to a
bulb in addition to the modem and transformer.
LDR and Gas Sensor are used here and the relay
switches on the bulb and exhaust fan in response
to crossing the threshold value corresponding to
them respectively.
The information regarding the nodes can be viewed
in the LCD display of the PIC microcontroller or on
the laptop
International Journal of Pure and Applied Mathematics Special Issue
581
Figure .14.Monitoring using PC
4. Real time smart home Architecture Smart home architecture using PLC would look like
the figure given below: Figure .15. Proposed Smart Home Architecture There are multiple sensor nodes in each room
connected to a PIC microcontroller. It is coded
using MPLAB to fit the necessary requirements of
the room. The PIC is then
connected to the PLC modem which is connected to
the electrical wiring running throughout the house.
The power line would then go to the PLC gateway
where it would connect to the computer. This is
where this system differs from most existing
systems where PIC is connected to wi-fi or ZigBee
which connect wirelessly to the computer and are
affected by problems like low range, packet loss
and interference with other wireless systems,
especially those operating in the 2,4 Ghz range like
WLAN, microwave oven etc. Additional features can also be added to the
proposed system like IOT through which you can
control your home system from any part of the
globe.
5. Conclusion
This work has involved designing a complete PLC
based smart home architecture. This proposed
system was developed by keeping in mind problems
facing WSNs. Here PLC is used both as the
backbone and for data sensing. We have developed
a prototype of the proposed system. It mitigates the
problem of wireless interference and packet loss, all
while increasing the range and scalability and even
reducing power loss. Using PLC based systems also
reduces the cost substantially and increases
efficiency.
References
[1] Ming Fu Li and Hung-Ju Lin “Design and
Implementation of Smart Home Control Systems
Based on Wireless Sensor Networks and Power
Line Communications”, IEEE Transactions on
Industrial Electronics Volume 62 Issue
7,December 2014.
[2] Nisha S Police Patil, Abhilasha P, Narendra
Kumar, “RF Based Data Communication Between
Industrial PLC’S USING KQ330 Module”,
International Journal of Industrial Electronics and
Electrical Engineering, Special Issue September
2016.
[3] Yin QUN, Zhang JIANBO, “Design of Power
Line Carrier Communication Systembased on
FSK-KQ330 Module” ELECTROTEHNICA
ELECTRONICA, AUTOMATICA.
vol.62(2014), Nr.3.
[4] V Padmajothi, Ankit Rai, M Dastagiri Reddy,
N Renu Kumar, “Cost Effective Home Energy
Monitoring System” International Innovative
Research Journal of Engineering and
Technology. Vol. 2, March 2017.
International Journal of Pure and Applied Mathematics Special Issue
582
583
584