You are on page 1of 6

MIPRO 2014, 26-30 May 2014, Opatija, Croatia

Smart Home Automation System for


Energy Efficient Housing
c, Edin Koco, Vladimir Bachler, Hrvoje Nikola Vucemilo, Hrvoje Dzapo
Niksa Skeledzija, Josip Cesi
University of Zagreb, Croatia
Faculty of Electrical Engineering and Computing
Unska 3, Zagreb
Email: { niksa.skeledzija, josip.cesic, edin.koco, vladimir.bachler, hrvoje-nikola.vucemilo, hrvoje.dzapo } @fer.hr

AbstractThis paper presents a concept and implementation


of modern smart monitoring and control system for building
automatization. The system is designed to enable significant
reduction of energy consumption and carbon footprint by
increasing the energy efficiency of the building under control.
The system consists of a Linux-based remotely accessible
main embedded control unit, a custom designed programmable
logic controller named littlePLC, and a propriatery low-power
Wireless Sensor Network (WSN). The energy flow is optimized
by using a Model Predictive Control (MPC) algorithm that runs
on the main control unit. The main control unit communicates
with littlePLC, which serves as an interface that controls the
parameters and state of HVAC systems in the building. The
feedback information for MPC is gathered by means of the
WSN, which consists of various sensor node types, such as
temperature, air pressure, humidity, VOC and CO2 . The WSN
nodes are connected in a star type network topology, with a
communication HUB connected to the main control unit. The
information gathered by WSN are used in the MPC algorithm
in order to calculate and estimate the requirements for heat
corrections, with respect to ventilation and weather predictions.

I. I NTRODUCTION
One of the main concerns today is energy generation,
consumption and preservation. Since the reserves of fossil
fuels are limited, the use of alternative energy sources need
to be encouraged. Large part of the engineering community
considers solar energy being one of the most perspective
alternative sources, whether directly by using solar heat and
light or indirectly by using the wind, tidal changes and
similar effects generated by the Suns emitted energy. Apart
from considering sustainable sources, it is also important to
improve the efficiency at which the energy is consumed.
The focus in the research community is to reduce energy
wasted in residences in order to improve global energy
efficiency. Residential buildings consume a major part of all
produced electrical energy, in particular, the residential and
commercial sectors use almost 40% of overall energy used in
the world, while in European countries 76% of energy goes
towards comfort control in buildings and houses heating,
ventilation and air conditioning (HVAC) [1]. According to
some other studies, at least 20% of total energy produced is
consumed in residences [2].
On one hand, todays architecture often puts an emphasis
on passive methods for improving energy efficiency. On
the other hand, an approach that is not as widespread in

residential buildings is active control of humidity, ventilation


or air conditioning systems. By using such active monitoring
and control approaches, significant improvements in energy
efficiency can be achieved. Such smart buildings can produce
energy, consume it, store it for later use and even return
it to the electrical grid [3]. Having efficient distribution of
the produced and stored energy between HVAC systems, a
building can achieve a positive influence on the network,
meaning that it requires zero energy from the electrical grid
[4].
Generally, there is a large and increasing demand for
integrated system solutions that would facilitate a design of
energy efficient buildings by employing smart and adaptive
control techniques. These systems must provide means
for advanced HVAC monitoring and control, sensory data
gathering, system interoperability, flexiblity, blending into
ecosystem of mobile and web tehnologies etc. Large amount
of work has been undertaken in the field of smart home
monitoring and control and various approaches for building
systems for energy efficient buildings has been proposed
[5][7]. There are also numerous of proprietary commercial
closed system solutions. In this research we propose a
modular, open system architecture for smart automation of
energy efficient home, optimized for low-cost, flexibility
and interoperability. The proposed implementation was
built from the state-of-the-art open hardware and software
components, as well as custom designed electronic modules,
that provide an optimal price-performance ratio and that can
be easily adapted for various usage scenarios. The system
enables easy customization, both in terms of adding new
software functionality or additional hardware peripheral
extensions. An important part of the system solution is
Model Predictive Control (MPC) framework, which is the
key to energy efficient smart home usage scenario.
The paper is organized as follows. The Sec. II brings
the general idea of the home automation system through a
short overview. The Sec. III briefly describes a commercial
embedded processor as an important element of the smart
house. The advanced control approach used for controlling
such house, namely the MPC, is given in Sec. IV. WSN
developed by the team is shown in Sec. V. A custom made
PLC named littlePLC is presented in Sec. VI. Finally, the
conclusion and future work are given in the last section.

166

Central processing unit (CPU)

HVAC system

Wireless access

UART

Wireless
network

WSN
command
parser

Database
p

fe bruar 14
s
p

3
1
0
1
7
2
4

4
1
1
1
8
2
5

5
1
2
1
9
2
6

6
1
3
2
0
2
7

7
1
4
2
1
2
8

s
1
8
1
5
2
2

n
2
9
1
6
2
3

On
Off

Database interface
Personal computer

WSN HUB
C

Web server

MPC engine
B

LittlePLC

Central tablet

Control
engine

Wired
network
4

LAN sockets

Wired access

RS485

Wireless
router

Fig. 1: Block diagram of the system

II. S YSTEM OVERVIEW


The overall system structure shown in Fig. 1 can be
logically divided into four subsystems:
Central Processor Unit (embedded processor)
Model Predictive Control algorithm (MPC)
Programmable Logic Controller (littlePLC)
Wireless Sensor Network (WSN)
The CPU provides the necessary computing resources that
need to run the control algorithm. The MPC algorithm uses
a mathematical model of the building, input from the WSN
and predictions of future conditions from the weather forecast
service to efficiently maintain good living conditions in the
home. The WSN has a star topology. It consists of a HUB
connected to the main processor and nodes scattered around
the building. Nodes provide various measurements such
as temperature, air pressure, humidity, etc. The (littlePLC)
controls the actuators of the system, namely a heat pump
for heating and cooling. It was designed as an alternative
to commercially available PLCs while paying heed to the
industries standards.
III. C ENTRAL P ROCESSOR U NIT
The CPU chosen for the project is BeagleBone Black.
It runs the MPC algorithm and interfaces towards each
of the subsystems. An embedded processor was chosen
for its small size and power consumption [8]. A Linux
distribution is installed on the board, allowing for a number
of advantages, such as using script based programming
languages (i.e. Python) or database programming languages
(i.e SQL). Thread management provided by an operating
system is also necessary, since the system will have multiple
tasks implemented in separate processes. The processor
gathers data from the WSN via a custom hardware plugin (HUB). The HUB is designed to fit as a cape plug-in

for the BeagleBone Black. Communication is achieved such


that the HUB sends standardised data packages over serial
communication which are then written into a database on the
Beaglebone. Data gathered from the WSN serves as input for
the MPC algorithm.
IV. M ODEL PREDICTIVE CONTROL
In the vein of previously presented general idea of
sustainable, affordable and energy efficient concept of
the house, energy management stands in the focus of the
concept. Thus, an optimal control system approach which
respects constraints resulting from desired occupant comfort
as well as actuators constraints was to be used. Such
requirements on optimal energy consumption were satisfied
using MPC approach as suggested in recent works [9][11].
The general idea of MPC is to use a model of the process
as well as the weather forecast (i.e. outdoor temperature,
insolation, humidity, etc.) in order to predict the future
evolution of the system and to compute a control actions
which ensure the fulfilment of demands. In particular, a
custom made heat pump serves as a controlled actuator,
while insolation and outdoor temperature are considered as
disturbances within such model. Ventilation system available
in the house also contributes notable heating flows and
therefore is included into computation of demands on the
actuator.
The basic concept of MPC is to use a dynamic model,
constraints of the process and current measurements to
forecast system behaviour and to produce the optimal
decision according to performance criteria the control
move at the current time. Therefore, the control action is
obtained by solving a finite horizon optimal control problem
at each sampling instant in which the initial state is the
current state of the house. The result of this optimization

167

is a finite control sequence and only the first action in this


sequence is applied to the plant. A block diagram for this
approach is given on Fig. 2.
Dynamic PWA model
and constraints

Weather and
ventilation prediction

Solve optimization
problem using
performance criteria

Compute sequence of
future control inputs
Apply only
1st input

where U a represents the feasible space for the actuator. As


stated previously, the MPC problem also takes into account
the limitations on states of the system. Namely, xat+k|t X ,
where X represents the limitations of the system states (both
spaces U a and X are constrained using linear inequalities).
In principle, space X inherently possesses limitations on the
temperature inside the house. The remark regarding previous
discussion is given in the following subsection. Detailed
solution to such formulated problem is given in [13].

Measurement

House

U d = (udt|t , udt+1|t , ..., udt+N 1|t )T obtained from the weather


forecast service and determines the controlled input U a =
(uat|t , uat+1|t , ..., uat+N 1|t )T on the horizon N minimizing a
cost function (subscript t represents a discrete moment). This
approach also respects constraints of the actuator and can be
formalized as follows:
PN 1 a
min
k=0 kut+k|t k
a
U
(4)
s.t. uat+k|t U a

Heat flow demand

Fig. 2: Block diagram of the MPC control approach

A. MPC framework

B. Implementation remarks

Apart from typical materials that are often used in


buildings and houses, recent studies have proved the
efficiency of Phase Change Material (PCM) which has
a dominant non-linear behaviour [12]. Consequently, the
model of the house which arises from this fact can not be
well described as pure linear one. Still, the characteristics of
PCM can be well described using a piecewise affine (PWA)
model, which brings the same formulation of the model of
the house.
Aforementioned PWA time invariant dynamic system is
given with the following continuous system:

A1 x(t) + B1 u(t) if 1 = 1,
..
(1)
x(t)

=
.

A x(t) + B u(t) if = 1,

The mathematical model of the house used within this


project was gained in the vein of [14], where the model of
the house is generated through suitable RC network. The
state vector x contains the voltage levels on corresponding
capacitances, which corresponds to temperatures of particular
wall or room. Such gained mathematical model was consisted
of 40 states.
The first step towards implementation of the MPC
algorithm was to identify the mathematical model of the
system (1). For this reason, an accurate model of the
house was built using a commercial software for dynamic
multi-zone simulation application to study thermal indoor
climate conditions. The response of such model was thus
used for validation of mathematical representation of the
house developed in Matlab. This control approach assumes
the accuracy of the mathematical representation of the
house. Therefore, some identification technique still needs to
be developed to be used on-sight, since the house changes
its characteristics in time.
In order to have well estimated states of the house a
wireless sensor network was built. More details on it follow
in the next section.

where i {0, 1}, i = 1, .., s are variables satisfying the


condition
s
X
i = 1,
(2)
i=1

at the particular moment in time. The previous representation


of the model arises in gainscheduling, where the linear model
is switched among a finite set of models, according to
changes of the operating conditions. i can be considered
being a function of state of the system as well as input
variable. In principle,
[i = 1] [x; u] Ci

(3)

where Ci is a subspace of the space of feasible x and u.


The model given in (1) represents a continuous time model,
which is discretized using zero-order hold discretization
approach with 1 h sampling time in order to be used within
the discrete MPC, with states x and inputs u = [ua ud ].
Input ua corresponds to heat demands for controlled actuator,
namely the heat pump and ud corresponds to non-controlled
disturbances. The MPC takes into account the predictions

V. W IRELESS S ENSOR N ETWORK


As discussed in previous section, the CPU requires various
measurements as feedback for the control algorithm. Wireless
approach was chosen since it requires no additional wiring.
The wireless nodes are self contained and can be placed
around the house without impairing its visual appeal. The
sensor nodes send measurements to the WSN HUB, which
then relays the data to the CPU. The advantage of such a
topology is that the idle radio times of the battery powered
nodes are significantly reduced. The HUB is connected to a
fixed power supply and its radio frequency (RF) connection
is online perpetually. Each node has a sleep interval in
which the device powers down and consumes as little
electrical energy as possible. The node wakes up to send its

168

measurements and, for a short period it listens for incoming


traffic from the HUB. This allows for the HUB to send
commands to the node, i.e. command for setting the sleep
interval duration. The node spends an short amount of time
in receive mode if it is not called out by the HUB. This
allows for quick transition back to the power down mode,
saving energy and extending battery life.
Power consumption was reduced by using low power
microcontroller units (MCU). The chosen processor for
the wireless nodes is the PIC18F26K22 microcontroller. It
interfaces the measurements from the sensors placed on the
node and communicates with the RF transceiver. Generally,
the PIC18F series of microcontrollers offers an extremely
low-power management technology suitable for reducing the
energy consumption of sensor nodes.
Even though most basic sensor nodes are designed to
be wireless, some sensors require a wired connection. For
example, most CO2 sensors require a warm up period
during which the heater on the sensor sets the adequate
temperature for gas percentage readings, whence the power
consumption duty cycling is not possible. Another example
of such a sensor is a smoke detector. The appearance of
smoke requires an instant detection for safety reasons. In
such situations, active time cannot be duty cycled with sleep
modes and the battery drain is increased drastically. A wired
solution (RS485 communication with a 12 V power supply)
is proposed as an alternative in this kind of situations.
A single sensor node consists of an MCU board, containing
either a regulated battery power supply or a 12 V supply line,
a processing unit and a communication interface. The sensor
unit is a plug-in board. The block diagram of a sensor node
is shown on Fig. 3. Sensor node duty cycling and estimated

Wireless
solution

Communicaton unit

Processing
unit

Wired
solution

Sensor unit

Power unit

Fig. 3: Sensor node diagram


current drain are given on Fig. 4, where Tmc is a measurment
collection time, Tmr is a measurement report time, Tnc is
node configuration time and Ts is sleep time. Active time is
sum of Tmc , Tmr and Tnc .
Voltage from the battery is regulated using a low dropout linear regulator. The batteries selected are Li-Po cells as
they have a high energy density and provide enough energy
to achieve long up times. Battery lifetime can be roughly

estimated with omitted self discharge current as:


tup =

Eb
,
Ion + Isleep (1 )

(5)

where Eb represents battery capacity, stands for duty cycle


coefficient (share of active time in overall time), while Ion
and Isleep represent average current in active and sleep mode,
respectively.
Example: Using a 1000 mAh Li-Po battery with a duty
cycle of 0.01% while assuming active current of 20 mA and
sleep current of 1 A yields tU P = 38.05 years.
The transceiver integrated circuit chosen for the wireless
sensor nodes is nRF24L01+ [15]. It is often used in ultra low
power wireless node designs [16], [17]. The chosen integrated
circuit is a RF transceiver operating in the 2.4 GHz frequency
band. It was chosen since it provides multiple useful features,
such as automatic packet handling, 6 data pipes, power down
modes, etc.
The sensing units are different for every node type.
Sensor boards can be designed independently since the plugin header predicts the usage of standard serial interfaces
(e.g. SPI, I2C, UART). Proposed sensor nodes include a
temperature measurement node, an air pressure and humidity
measurement node, an ambient light sensor node, a gas and
CO2 detector.
VI.

LITTLE PLC

The PLC is a standard component of industrial


automatization. It is a device dedicated to controlling
electrical machines (i.e. motors, compressors, pumps,
heaters, etc.), monitoring system operation, and providing
a control interface to the supervising personae. There are
many commercially available PLCs, most of them developed
for highly demanding tasks of industrial control. Using such
a device for control of a house is not financially viable. A
small PLC was designed to significantly reduce the cost of
the whole system of automatization.
LittlePLC was designed for use in milder environments.
It does not have an industrial grade temperature operating
range, nor is resistant to an aggressive atmosphere, but it
provides a large advantage over a standard PLCs processing
power. It was designed to provide a platform for easier
implementation of complex control algorithms with a lower
price than industrial equipment.
An ARM based MCU is the main processing unit of
LittlePLC ( in particular the STM32F407 microcontroller
[18]). The device was designed as a modular system that
allows the variation of the number of inputs and outputs using
expansion modules. Similarly to standard PLCs, LittlePLC
provides analog and digital inputs and outputs (Fig. 6). All
inputs, outputs and communications with the outside world
are galvanically separated from the microcontroller to ensure
reliable operation and to protect the internal circuitry. There
are several ways of communicating with external devices or
users (RS485, Ethernet, GSM, SD card, as shown on Fig. 6).
The littlePLC is shown on Fig. 5.
LittlePLC can be divided into following subsystems:

169

Measurment collection
state

Measurment
report state

Node configuration
state

Sleep

.........

Sleep

900 nA

Tmc

Tmr

Tnc

Ts

Fig. 4: The operation cycles of the sensor node and provides estimated currents for each state

Fig. 5: littlePLC

Motherboard (MCU, real time clock, SD card interface,


etc.)
Communication layer (GSM, ethernet and USB
communication modules)
Control layer (analog and digital outputs and inputs,
RS485 standard bus)
In the system described in this article, littlePLC
communicates with the CPU via Ethernet. The CPU
issues HVAC control commands to the LittlePLC, based on
the MPC algorithm results. LittlePLC then issues controls
to the HVAC systems. (i.e heat pump, condensing heater,
ventilation, air conditioning, etc.) Any errors that may
appear during operation are reported to the CPU. The main
advantages of using LittlePLC for HVAC systems control
are lower price, and increased processing power.

VII. C ONCLUSION
In this paper we presented an architecture and
implementation of a modular smart automation system
for energy efficient housing that was optimized for low-cost,
flexibility of system configuration, and interoperability
with other technologies. The core of the proposed system
consists of the Central Processor Unit (CPU), Wireless
Sensor Network (WSN), Programmable Logic Controller
(littlePLC), and Model Predictive Control algorithm of

the building HVAC system (MPC). The loosely coupled


system framework enables easy adaptation for various
specific usage scenarios, both in adding the new hardware
system components, and the additional software services.
Linux-based CPU promotes an open system approach design
which enables adding a new functionality as new system
process that integrates with rest of the system through the
dedicated IPC messaging protocol. The WSN was optimized
for energy efficient smart home monitoring usage scenario,
and it provides low cost multifunctional sensor nodes,
with ultra low power consumption and simple messaging
protocol, without an unnecessary overhead often met in
similar existing solutions. Furthermore improvements in
lowering the overall system costs and in providing the
extra features usually met in high-end industrial PLCs
have been achieved by means of the custom developed
littlePLC. Finally, the MPC control algorithm plays a key
role in a system that enables significant energy efficiency
improvements.
All described system components were tested in a
prototype implementation of the smart home automation
system. The initial development phase encompassed the
design and implementation of hardware and software
components of CPU, WSN and littlePLC, which were put
together to form a basic core of the proposed system. The
experimental tests showed that the proposed architecture and
components were well chosen both in terms of achieving
the low cost of the overall solution and satisfactory system
performance.
The future work will encompass the installation of the
described system into the actual smart building, assessment
of system components performance under realistic working
conditions, adjustment of the MPC algorithm to the realistic
house model, and experimental tests under the conditions
of real-world environment. The most interesting part of the
future research will be the answer how much energy savings
can be achieved by using the proposed system, what is

170

RF Sensor network
access point

GSM

Real time
clock

SD Card
Datalogging

ARM Based MCU

USB

Ethernet

Digital inputs

Analog
outputs

RS485

Analog inputs

Digital outputs

Digital inputs

Analog
outputs

RS485

Temperature
and pressure

Relay output

Expansion
module

Expansion
module

Electrical
isolation

Expansion
module

Fig. 6: Block diagram of the littlePLC

impossible to answer beforehand, but also difficult to assess


without the custom developed system for this purpose. Beside
the basic system core described in this paper, we plan to
extend the basic system functionality by providing additional
modules and services, such as smart entry control subsystem,
human behaviour patterns learning and monitoring, remote
access system control, configuring and controlling system
configuration over smartphone or tablet etc.
ACKNOWLEDGMENT
We would like to thank to the members of the UNIZG
team of the University of Zagreb for their collaboration on
membrain project (http://www.membrain.com/ ).
R EFERENCES
[1] Energy efficiency policies for new buildings, International Energy
Agency, Energy Efficiency Requirements in Building Codes, 2008.
[2] S. Basuroy, J. W. Chuah, and N. Jha, Making buildings energyefficient through retrofits: A survey of available technologies, in Power
and Energy Society General Meeting (PES), 2013 IEEE, July 2013, pp.
15.
[3] B. Morvaj, L. Lugaric, and S. Krajcar, Demonstrating smart buildings
and smart grid features in a smart energy city, in Energetics (IYCE),
Proceedings of the 2011 3rd International Youth Conference on, July
2011, pp. 18.
[4] B. Todorovic, Towards zero energy buildings: New and retrofitted
existing buildings, in Exploitation of Renewable Energy Sources
(EXPRES), 2011 IEEE 3rd International Symposium on, March 2011,
pp. 714.
[5] D.-M. Han and J.-H. Lim, Smart home energy management
system using ieee 802.15.4 and zigbee, Consumer Electronics, IEEE
Transactions on, vol. 56, no. 3, pp. 14031410, Aug 2010.
[6] K. Gill, S.-H. Yang, F. Yao, and X. Lu, A zigbee-based home
automation system, Consumer Electronics, IEEE Transactions on,
vol. 55, no. 2, pp. 422430, May 2009.

[7] H. ElKamchouchi and A. ElShafee, Design and prototype


implementation of sms based home automation system, in Electronics
Design, Systems and Applications (ICEDSA), 2012 IEEE International
Conference on, Nov 2012, pp. 162167.
[8] Beaglebone black system reference manual, 2013, revision A4.
[9] A. E.-D. Mady, G. Provan, C. Ryan, and K. N. Brown, Stochastic
model predictive controller for the integration of building use
and temperature regulation. in 25th AAAI Conference on Artificial
Intelligence, 2011.
[10] F. Oldewurtel, A. Parisio, C. Jones, M. Morari, D. Gyalistras,
M. Gwerder, V. Stauch, B. Lehmann, and K. Wirth, Energy efficient
building climate control using stochastic model predictive control and
weather predictions, in American Control Conference (ACC), 2010,
June 2010, pp. 51005105.
[11] F. Oldewurtel, A. Parisio, C. N. Jones, D. Gyalistras, M. Gwerder,
V. Stauch, B. Lehmann, and M. Morari, Use of model predictive
control and weather forecasts for energy efficient building climate
control, Energy and Buildings, vol. 45, no. 0, pp. 15 27, 2012.
[12] P. A. Mirzaei and F. Haghighat, Modeling of phase change materials
for applications in whole building simulation, Renewable and
Sustainable Energy Reviews, vol. 16, no. 7, pp. 5355 5362, 2012.
[13] A. Bemporad and M. Morari, Control of systems integrating logic,
dynamics, and constraints, Automatica, vol. 35, no. 3, pp. 407 427,
1999.
[14] M. Vasak, A. Starcic, and A. Martincevic, Model predictive control of
heating and cooling in a family house, in MIPRO, 2011 Proceedings
of the 34th International Convention, May 2011, pp. 739743.
[15] nrf24l01+ single chip 2.4ghz transceiver, product specifications,
2008, version 1.0.
[16] S. Sonavane, V. Kumar, and B. Patil, Designing wireless sensor
network with low cost and low power, in Networks, 2008. ICON 2008.
16th IEEE International Conference on, Dec 2008, pp. 15.
[17] D. Zhao and C. Peng, A small low-power reliable communication
module in a wireless monitoring system, in Bioinformatics and
Biomedical Engineering, 2007. ICBBE 2007. The 1st International
Conference on, July 2007, pp. 11941197.
[18] STM32 32bit arm cortex mcu - STM32F407 datasheet, 2013, rev 4.

171

You might also like