You are on page 1of 5

Smart light automation using a PID controller and LED

technology oriented to home and industrial applications


Hctor Effioa, Emilio Galloa, Csar Zapataa
a Facultad de Ingeniera, Programa acadmico de Ing. Mecnico-Elctrica
Universidad de Piura, Per.

Abstract Domotics, or house automation, air conditioning, so on. The implementation of


is whole that involve techniques about home automation provides intelligent
automation of some house processes in management, including the control and
order to improve security systems, automation of what the house includes,
energetic consumption, comfort, ON/OFF increasing efficiency and comfort, which is
optimized control of domestic appliances, what is required mostly at home.
and the most important: doing life easier for
In the coming years, its expected to expand
the customer at home, or workers in an
domotics application because it's easy to use,
office or industrial plant. [1] affordable and generates comfort at home, in
The purpose of this paper is to develop a fact, at this moment we have companies in our
smart automatic light system oriented to country that perform smart houses making
studies according to the number and age of
increment energy efficiency and
people living at, and making possible some
independence (without a person help) using
functions that years ago seemed impossible,
advanced control techniques as a PID for example: open doors via internet and
controller algorithm and avaible simulate the presence of people (this helps the
technologies in Per as presence sensors, safety part).
relays and arduino microcontrollers.
This article proposes the implementation of an
The prototype has been implemented in an
automatic light system using LED technology,
experimental module to test all our
based on PWM (Pulse-Width Modulation)
investigation about light automation before
control, turning lights on/off with a presence
a real installation in a house, office or
sensor and regulation of light intensity setting a
another industrial place.
set point according by Peruvian normative (500
I- INTRODUCTION lux average measured from the work space)
with a PID controller algorithm, helping us to
The growing technological advancement that increase energy efficiency making not
occurred in recent years has contributed necessary to use 100% of light output.
positively in peoples life, basically making
easier daily work, for example: automating II- SMART LIGHT AUTOMATION SYSTEM
processes, more advanced and effective
communication, even in the comfort at home. Nowadays, light automation are installed in
Today it can be said that there is no person in some applications, for example in offices of
the world who not use technology in any important enterprises, meeting halls, houses,
situation. universities, so on. But, this systems mainly
works with incandescent or saver bulbs with
Techniques that involve the application of alternant current (AC); and we know according
technology at home, also called domotics, to research that this type of bulbs are inefficient
integrates new technologies guided to [2] if we compare with LED lights as shown in
effectively improvement about everyday Fig. 1.
aspects, such as lighting system , energy
management, security,
Identification is a link between real and
mathematic world. System identification
means modeling of dynamic systems from
experimental data. Some identification
methods give model characterized by a
parameter vector: This vector can consist of the
coefficients for a differential equation or
parameters in a transfer function.

Fig 1. Comparative table between different The algorithm [3] that was used to do system
types of luminaires. identification is Recursive parameter
estimation by Dr. Robin de Keyser,
LED bulbs, opposite to traditional ones, works implemented in a Matlab code. See Fig. 3.
with continuous current (CC) and this detail
makes a little complex the design of the control Identification can be applied in offline or online
circuit, or driver. We have to do this because mode. Our type of process requires online or
its an important step and the only way for recursive mode: data are used as soon as they
develop and do the PWM control over the are available, parameters can be continuously
bulb/fluorescent. estimated during the experiment. Estimated
parameters are recalculated each time new
III- SYSTEM IDENTIFICATION data becomes available. Thus, when the model
is updated periodically, referenced to its past
After driver design, we have to build an values, this is called recursive identification or
algorithm for a correct system identification [3] recursive parameter estimation.
and it must be in an -all controlled- room, doing
this we have not problems with disturbs, noises
or another obstacles that keep away from the
correct read of parameters the Luxmeter
sensor. That is how we can do a correct system
identification and obtain without problems the
transfer function of our process. We can see
some results in Fig. 2.

Fig 3. Transfer function of automatic light


process with a PWM input of value 120
obtained by Robin de Keyser algorithm.

IV- RECURSIVE STIMATOR ALGORITHM

[3] Suppose the relationship between two time


series {y} and {u} is given by a constant gain K
that we want to estimate.

Assuming that the data acquisition takes place


Fig. 2. Data obtained in Matlab (10000
in discrete time, we have at time t received a
samples) with a Luxmeter sensor in an all
sequence of measurements
controlled- room, with a PWM input value= 30.
u(1),y(1),u(2),y(2),...u(i ),y(i ),...u(t ),y(t )}.
As indicated we are dealing with a static V- LOOKING FOR A PID CONTROLLER
process model, thus ideally
The next step is building the PID controller [4],
y() = K*u() in order to have an automatic regulation close
to a reference, and finally we have a closed-
To be realistic, this ideal relationship will be loop control. We can see closed-loop control
disturbed (measurement errors, modeling in Fig. 4.
errors, so on) such that we better take into How we set this reference?
account with a disturbance term v() in the
model: According to Peruvian Normative [5]: 500 lux,
y() = K*u() + v() average, measured from the work area.
Based on this value, we configure the set
Due to these errors it would be unwise to point for our controller.
estimate the gain K at time t by K(t) = y(t)/u(t)
To decrease the erroneous effect of
disturbances we could start from:

Fig 4. Closed-Loop system simulated in


SIMULINK

In order to avoid that the integral part of our


PID controller get saturated, we set a reset
anti-windup: it consist in define output limits,
once the process reaches it maximum or
minimum, integral part of PID stops. Doing
this, we still have a problem: Proportional and
Summing up all terms we have: derivative part are adding small values,
resulting this in a superior value in the output
of the process, and this is unacceptable. The
solution is that we have to set limits for output
of the process. [4]

Before this, supposing that the average value The first way to obtain the PID parameters are
of disturbances is zero, we have the third therm with Matlab tool SIMULINK, PID Tuner. In this
from the equation equals to zero. With this, we tool, all we have to do is simulate the closed
have a good estimate for K: loop system, execute PID Tuner and software
give you the parameters in time (seconds).
(P=0.038822, I=9.6939 and D=-5.4566*e^-5).
It is correct if we consider this as the first try
to control our process.

In order to do a manual tuning for our PID [7],


Finally, for this method is recommended: we use Ziegler-Nichols Open-Loop tuning. In
industries this method is usually done using
- Store all measured values y and u in a trial and error, but using this method can be
computer memory. dangerous because ignorance can lead the
- Measure the necessary data during a process to instabilities or unacceptable
sufficiently period of time. overshoots. Also, a tuned process only by trial
and error method does not guarantee a
- Use the data to identify the unknown K by
the formula. correct behavior or a good
response affronting suddenly changes in the modules when a person enter to the room
disturbance or references. where the smart light system are installed. [6]

Steps for doing Z-N open-loop tuning are: VI RESULTS

1) The process receives a step input, only When we set PID parameters with the values
avaible for a system whose derivative is that we obtained with Tune PID from Matlab,
positive. and Z-N manual tuning, our PID controller
2) Register and graphic output time works well and we have a correct control of
response y(t) of the process, calculate this smart light automatic system.
maximum slope and make a tangent line Relays turns on and off the LED tubes
to the curve. depending if presence sensor detects some
3) In the graphic, we have two important movement around it.
points: a (intersection with vertical axis)
and L (intersection with x axis). With this The set point value we have to set manually,
2 parameters we can tune a PID controller according to the person requirement: if one
warranting stability. LED tube satisfy this condition, only this stays
4) We have to follow PID equation form and on, in the opposite case, system turns on the
values from tables that are obtained from controlled tube until it reaches the set point
different tests. value. Consequently, due for the PID
operation, system error keeps constant: it
warrants the stability in our process.

Fig 5. Response y(t) to step input

Fig 7. Experimental module working


obtaining data in Matlab
Fig 6. Equation form from the PID controller
implemented in arduino code.

Obtained values are: Kp=0.096, Ti=0.01834,


Td= 0.005

Once we closed the loop, system can be more


interesting with the implementation of a PIR
(Passive Infrared Sensor) sensor, it
measures infrared light of objects that appear
around it, and its based in: all bodies that
have a temperature above absolute zero emit
heat, and this radiation can be measured by
this electronic device. Mainly, the use for this Fig. 8. Doing some tests in experimental
sensor is to turn on/off lights with relay module using presence sensor. Both LED
tubes turn on, with a set point of 2500 lux.
VII CONCLUSIONS VIII References

1. Although all automated systems offer a [1] Albert Hijano Badillo, Proyecto de
specific management manually, you cannot instalacin elctrica y domtica en una
overlook the fact that by automating any vivienda unifamiliar. Thesis. Universitat
installation creates a greater reliance on Politcnica de Catalunya.
electricity supply, which could be temporarily
replaced using small batteries in most [2] U.S Department of Energy, Energy
essential elements. Efficiency of LEDs. Link: http://www.hi-
led.eu/wp-
2. With PWM regulation, is not necessary to content/themes/hiled/pdf/led_energy_efficienc
use 100% of light output, while the user gets y.pdf
the necessary light for his requirements.
Lights are only on if presence sensor detects [3] Robin de Keyser, Recursive parameter
some movement in the area. All of this details estimation. Pages 2-11.
finally traduces in an efficient use of power
consumption. [4] Brett Beauregard, Improving the beginners,
PID introduction. Pages 3-28.
3. LED luminaires are currently used and
known because it has a high efficiency, which [5] Normativa de iluminacin Peruana. Pages
is traduced in a greater level of illumination 32-44.
(lumens) compared with energy consumption
(watts) required for operation. LED [6] Ji Xiong, Fang-Min Li and Jing-Yuan Zhang,
technology have an efficiency of Human Tracking System Based
approximately 80 %, which means that 80 % on PIR Sensor Network and Video. Pages 1-2
of electricity is utilized, while the remaining 20
% is wasted as heat. [7] William Ipanaqu Alama, Control
Automtico de Procesos. Pages 166-168
4. The LED lights have a life time of
approximately 100,000 hours, if LED have to
work 8 hours a day, it would take 20 years to
replace: it represents a zero maintenance of
lamps.

5. High effectiveness should not be the only


factor for choosing a product, also must have
to consider another features such as color
quality and distribution of light intensity.
Although that high efficiency is an important
energy saving attribute, the most important
thing is that this will be imperceptible to users
in a determined room.

You might also like