Applsci 07 00616 v2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

applied

sciences
Article
Smartphones as a Light Measurement Tool: Case
of Study
Jose-Maria Gutierrez-Martinez, Ana Castillo-Martinez *, Jose-Amelio Medina-Merodio,
Juan Aguado-Delgado and Jose-Javier Martinez-Herraiz
Department of Computer Sciences, Polytechnic School, University of Alcala, 28871 Alcalá de Henares, Spain;
josem.gutierrez@uah.es (J.-M.G.-M.); josea.medina@uah.es (J.-A.M.-M.); j.aguado @edu.uah.es (J.A.-D.);
josej.martinez@uah.es (J.-J.M.-H.)
* Correspondence: ana.castillo@uah.es; Tel.: +34-918856650

Academic Editor: Christos Bouras


Received: 25 April 2017; Accepted: 7 June 2017; Published: 14 June 2017

Abstract: In recent years, smartphones have become the main computing tool for most of the
population, making them an ideal tool in many areas. Most of these smartphones are equipped
with cutting-edge hardware on their digital cameras, sensors and processors. For this reason, this
paper discusses the possibility of using smartphones as an accessible and accurate tool, focusing on
the measurement of light, which is an element that has a high impact on human behavior, which
promotes conformance and safety, or alters human physiology when it is inappropriate. To carry
out this study, three different ways to measure light through smartphones have been checked: the
ambient light sensor, the digital camera and an external Bluetooth luxmeter connected with the
smartphone. As a result, the accuracy of these methods has been compared to check if they can be
used as accurate measurement tools.

Keywords: Luxmeter; mobile ambient light sensor; digital camera; light sensing

1. Introduction
Advances in mobile technology has led to its use in different environments such as intelligent
transportation, resource management and usability, environmental monitoring, city management
and social services. These advances include computing power enhancement and new measurement
systems and sensors, turning them into the cornerstone for interaction between people and digital
systems and services [1,2]. This upswing of smartphones combined with pervasive sensing enable the
collection of information about mobile users and their surrounding environments. The new available
information enhances the awareness of the cyber, physical, and social environment, which provides
essential support to our daily lives, in the form of services, applications, and so on.
Most recent smartphones are equipped with cutting-edge hardware on their digital cameras,
sensors and processors. These kinds of devices are an ideal tool in many areas such as business,
education, health or social life, changing dramatically the cultural norms and behavior of individuals.
Smartphones are much cheaper than classic tools that they can replace, even high-end devices. These
characteristics have led to today’s mobile devices becoming the primary computing platform for
many users [3]. Despite manufacturers and aggressive marketing promotion, there is no doubt that
smartphones have great features and capabilities [4].
On the other hand, lighting, both artificial and natural, has a high impact on human behavior,
promoting comfort and safety, or altering human physiology when inappropriate. Analyzing working
tasks related to the office, it is possible to see how most of them are linked to document processing,
be it through paper or digital documents. Therefore, these activities have high visual requirements,
making lighting an important factor to prevent discomfort and vision problems. Different studies

Appl. Sci. 2017, 7, 616; doi:10.3390/app7060616 www.mdpi.com/journal/applsci


Appl. Sci. 2017, 7, 616 2 of 18

attribute migraine headaches, fatigue, medically defined stress, anxiety or decreases in sexual function,
among others, to overly intense light [5–8]. To guarantee proper lighting in workplaces, two standards
were developed: UNE 12464-1 [9], which is relative to lighting of indoor workplaces, putting special
emphasis on the fulfillment of two aspects: the visual comfort and the performance of colors and
standards; the second standard is UNE 12464-2 [10], which is related to the lighting of outdoor
workplaces. In both regulations, the lighting requirements are established regarding the activity.
To improve lighting management, modern buildings have incorporated intelligent control
systems, saving energy and money and significantly contributing to creating a comfortable working
environment if possible [6].
Another field in which it is important to control the amount of light is photography, where
illuminance factors have a high impact on picture quality. Photographers use different techniques to
manipulate individual parts of a photograph, removing shadows and highlighting features, among
others [11]. Therefore, it is recommended to measure light intensity to adjust the camera characteristics
in order to get the best photograph quality [12].
Something similar happens on a movie set, where the circumstances of the ambient light where
the camera is located can make the difference between a great shot and a useless one, always according
to the director’s criteria about the purpose of the shot.
There are other cases where the quantity of ambient light is key, such as art museums or galleries.
It is essential that the intensity and quantity of light in the gallery rooms where the paintings
are presented is adequate, to ensure the correct visualization and to guarantee an optimal state
of conservation [13].
Lighting also has a great impact on enclaves that shelter living beings, such as zoological or
oceanographic ones, where inadequate lighting levels could produce adverse conditions that could
alter these said living beings [14] and even cause problems with their growth [15].
To measure the amount of light and its quality, a luxmeter is used, a specialized device that
measures the intensity of light that impacts a surface.
These two lines of reasoning join together if we exploit the advances in smartphones and their
processing power and network connectivity [16], to use them as a fairly accurate tool to measure
the light through a software development, making this functionality available to any smartphone
user. To achieve this goal, the authors ran a study to analyze three different approaches, creating the
software, testing it and analyzing the results.
The rest of this paper is divided as follows: Section 2 presents the prior research where different
aspects that have been of relevant to the work are studied; Section 3 describes the methodology and the
hypothesis that serves as a base for the research; Section 4 presents an analysis of the main elements
that have been studied; Section 5 shows the results obtained through the study and the validation of
the hypothesis, and, finally, Section 6 contains the conclusions.

2. Prior Research
As a first step, it is necessary to review the different options available to measure light amounts
and existing research in this field. The key concept to guiding this search is the need for an accurate
and quantifiable measurement of light needed to create appropriate and pleasant working spaces, it
being necessary in some cases to adapt the environment to the requirements to carry out different
types of tasks.
As a result of this search, we concluded that light analysis can be performed in two different
ways: either virtual scenarios can be created using evaluation software, where we will take lighting
information directly from the manufacturers; or real measurements can be taken in real scenarios,
where we will use real situations and we will take measurements using different tools. The advantages
of a virtual scenario are that you can get a fairly accurate light analysis to work easily and quickly,
without any physical deployment and measures. On the other hand, the results will never be as
accurate as in real scenarios, as quite a few factors will be omitted. Real scenarios will always be
Appl. Sci. 2017, 7, 616 3 of 18

accurate, although more difficult to achieve and with some limitations when performing measurements,
and hardware quality will always be essential.

2.1. Light Evaluation Software


Programs used to evaluate lighting requirements in different spaces enable a quantitative analysis
of scenarios thanks to its capability of creating a 3D virtual world where lighting effects are recreated
and analyzed in both artificial lighting and daylighting scenes [17]. In this field, the most important
software is called DIALux (DIALux evo 7, Dial, Lüdenscheid, Germany). The main strength of this
software is the complete database about lighting products of the main manufacturers, giving more
accuracy to the analysis. It also provides information about power consumption of elements to
guarantee compliance with the regulations [18].
Similarly, the software called RELUX (version 2017.1.9.0, Relux Informatik AG, Münchenstein,
Switzerland) allows us to generate quantitative and qualitative analysis of buildings’ lighting thanks
to simulation models created with specific materials; colors; reflection factors; natural and artificial
lighting elements in order to get a closer possible view of reality [19].
Another renowned and well-known tool to evaluate energy efficiency is the SEAD (Super-efficient
Equipment and Appliance Deployment) Street lighting evaluation toolkit. This tool can help to make
better choices regarding street lighting fixtures, which can lead to a maximum of 50% in energy
savings [20], by providing an easy way of performing evaluations of light quality, energy consumption,
and life cycle costs of efficient street lighting alternatives. This tool is supported by Mexico’s National
Commission for Energy Efficiency, India’s Bureau of Energy Efficiency, Natural Resources Canada, the
Swedish Energy Agency and the U.S. Department of Energy.
Finally, the program BTwin (versión 2.9.5.8, IMventa Ingenieros, Campanillas, Spain) [21] was
designed to plan the street lighting installation based on the standard EN 12464-2 [10], as the program
can import the manufacturer’s luminance information to give more accuracy to the calculations.
In addition, an evaluation of the installation’s energy efficiency to obtain the energy label before
carrying out its implementation can be performed by using the extended feature called AEwin. Vertical
obstacles can be considered as well, as they can affect the lighting, and, by doing so, it is possible to
increase the precision of the program.

2.2. Light Measurement Analysis


The most commonly used device for measuring light conditions is the luxmeter, a device that
allows for simple measurements quickly and not the subjective illuminance of an environment. This
device is composed by an integrating light meter with a circuit that develops a signal representing
the logarithm of the light being measured and utilizes a display having a linear f-number scale [22].
These devices are too specialized to be available in many situations where light conditions should
be measured. For this reason, some researchers have used CCD (Charge-Coupled Device) cameras
to obtain luminance [23,24], glare and illuminance measurements [25]. The utilization of CCD as
a luminance meter in order to calculate visibility level has big advantages because it reduces the
time required for the measurements. However, there are still limitations concerning the reliability on
low levels [26]. In addition, to obtain the illuminance level using this kind of camera, a computer,
connections between the computer and the light meter and finally software to collect, store and analyze
data are necessary. Due to its high-precision resolution, these cameras are very expensive and are not
commercially viable for many image-resolving measuring tasks. To solve this problem, the research
conducted by Wuller [27] analyzed the possibility to measure luminance with digital still cameras
(DSC). The main advantage of this kind of camera is that it can capture the luminance of an entire
scene. Despite this research showing that it is possible to obtain luminance value with a digital camera,
the quality of the device used is very important to the accuracy of the values. In this respect, the results
show how professional cameras are more qualified for use as a luminance measure camera owing to
its high color rendering.
Appl. Sci. 2017, 7, 616 4 of 18

Similar principles used by Wuller in the use of digital still cameras are applied to the research
carried out by Ismail et al. [12]. This study shows how it is possible to design a webcam based luxmeter
that is applicable and suitable for lighting monitoring as well as the ability to be used in an embedded
application. The research carried out by Sumriddetchkajorn and Somboonkaew [28], which shows
how it is possible to evaluate the illuminance directly to the image obtained by the digital camera of a
mobile phone, follows similar criteria. However, another research study that analyzes different mobile
applications for different platforms such as Android, iOS and Windows phones, that ensure that they
can measure the light directly with the mobile, shows how a serious measurement of illuminance
is only possible with professional hardware. This is due to the error found in the measurement
compared with a professional luxmeter being very high, and the fact that each mobile phone has
different measurement values because of its hardware characteristics.

3. Methodology
To guide this study, a set of hypotheses was proposed to help in the evaluation of the different
sensors studied and the subsequent presentation of results. These are the hypotheses:

• H1: The ambient light sensor present in mobile devices provide enough quality to be used as a
measurement tool.
• H2: The digital camera of mobile devices can be used as a lighting measuring tool.
• H3: The use of external sensors connected to the mobile device through via Wi-Fi or Bluetooth
provides measurements with a quality similar to that obtained by the internal mobile sensors.
• H4: Mobile devices can be used by any smartphone user as a fairly accurate light meter tool.

As part of the research, a series of tests were performed with mobile devices where the measures
were taken with dimmable lighting situations. The results of these measurements have been compared
with others performed in the same situations by a calibrated luxmeter, which has been considered as a
reference measurement.
Finally, if the hypotheses are all valid, we have to consider the possibility of using the mobile
sensors as a replacement of the external devices.

4. Analysis of Sensors in Mobile Devices


Over the last few years, smartphones, such as Android products or iPhones, among others,
have prevailed as sophisticated multi-function mobile phones. In the case of the Android platform,
it provides four different sensors that let users monitor several environmental properties such as
humidity, illuminance, ambient pressure and ambient temperature. These sensors are hardware-based
and are not available in all of the products due to the fact that their presence depends on the decision
of the manufacturer, as happens with other features such as the frontal camera. For this reason, the
light measurement performed in this study has been performed in different ways in order to give the
option that best fits with each terminal.

4.1. Mobile Ambient Light Sensor


Nowadays, most smartphones have a built-in ambient light sensor that is employed to provide
information about the intensity of the surrounding illumination. This information is commonly used
to adapt screen brightness control based on the surroundings, allowing for saving battery from the
screen and at the same time optimizing the visibility [29]. For instance, in outside places where the
ambient light is high, screen brightness must be increased to ensure that the device remains readable,
whereas, in dark places, the screen is dimmed to reduce eye fatigue [30].
This sensor is usually located on the surface above the screen and may be used for different
purposes. For example, it is broadly used in the field of physics, where during teaching practices
students are able to use their own smartphone as a light sensor, increasing the interest and motivation
in the execution of experiments.
Appl. Sci. 2017, 7, 616 5 of 18

Smartphones’ light sensors can obtain accurate readings despite using an easily obtainable
technology, but, theoretically, they cannot compare with the accuracy of dedicated hardware
devices [29]. One of the main problems of these sensors is that they are located inside the device,
allowing for measuring only the light that falls directly on the device, not the ambient light. However,
the results obtained in different research studies show how they can be useful in practical cases, as in
the undergraduate physics laboratory [31], where a high level of accuracy is not needed.
Some operating systems, like Android OS, allows the user to obtain the values from the light
sensor through APIs (Application Programming Interface) that collect data during the runtime of
the application. These APIs allow applications to register listeners that are notified about changes
in sensor values, returning a single value for each data event [32], whereas most motion and static
sensors will return a multidimensional array of values. Furthermore, the ambient-light sensor can be
accessed without any specific permission, which allows malicious applications to access this sensor
information without raising any suspicion.
Regarding the period of the measurements, the experiment performed by Spreitzer [30] shows
how, in a 10 s period, it was observed that about 750 measurement samples can be gathered per second.
This experiment also highlights how these sorts of sensors has a resolution of 1 lux.

4.2. Mobile Camera


Since most smartphones are equipped with digital cameras, the functionality of this tool has been
extended beyond taking pictures. Nowadays, these devices are used in areas such as telemedicine [33],
microscopy [34], biology [35] or fluorescent imaging [36], among others.
For instance, if we pay attention to the field of photography, it is possible to see some relationships
between photographs and illuminance factors. Nowadays, it is normal to see photographers measuring
light characteristics with external luxmeters to adjust their shutter speed and depth of field to get best
picture quality [12]. This relationship is present in the photographs’ characteristics to the point that it is
possible to measure the illuminance through the camera values at the time of taking a picture, as well
as the characteristics of the colors of the picture taken. Thus, by using the camera and photographs
characteristics, it is possible to calculate the luminance of the scene.
For this purpose, an Android application that is able to obtain the luminance of a picture has
been developed. This application allows for obtaining the picture directly from the gallery or from the
digital camera. Once the image to process has been acquired, the next step is to process the image to
evaluate it. The first stage for performing this task of evaluating the luminance of a picture consists of
adapting the spectral luminous efficiency of the human eye for photopic vision through the CIE XYZ
(Commission Internationale de l'Éclairage) and (λ) curve. Hence, this value is able to make a direct
statement about the luminance of colors [27]. It is possible to evaluate the individual luminance of the
tints through the main color wheel palette with constant saturation and lightness levels converted to
grayscale. As in a photograph, the images obtained are in RGB (Red Green Blue) colors, and they must
be converted into greyscale images to ease the computational burden using the formula of a weighted
sum of Red, Green and Blue components, as is shown in Equation (1) [37,38]:

Luminance = (0.299 × R + 0.587 × G + 0.114 × B). (1)

This way, the three dimensions of color can be translated into one, where white is represented
with the highest value, and black with the lowest.
Figure 1 shows a chart with the process done by the application to obtain the luminance of
a scenario.
Appl. Sci. 2017, 7, 616 6 of 18
Appl. Sci. 2017, 7, 616 6 of 18
Appl. Sci. 2017, 7, 616 6 of 18

Figure 1. Flow chart of mobile application to obtain luminance through the digital camera.
Figure 1. Flow chart of mobile application to obtain luminance through the digital camera.

One of
One of the main
main drawbacks
drawbacks detected
detected while measuring the the illuminance on on a concrete
concrete surface with
One of the
the main drawbacks detected while
while measuring
measuring the illuminance
illuminance on aa concrete surface
surface with
with
a digital
aa digital camera is that the illuminance measured will take into account the distance of the device
digitalcamera
cameraisisthat
thatthe
theilluminance
illuminance measured
measured willwill
taketake
intointo
account the distance
account of theofdevice
the distance from
the device
from
the the surface
surface where where the measure
the measure is taken.is taken.
solveTo solve this problem, it is necessary to of
use a sort of
from the surface where the measure isTotaken. this
To problem,
solve it is necessary
this problem, to use a sort
it is necessary to usefilter close
a sort of
filter
to close
theclose
deviceto the device to ensure that the measurement is performed at this point. To perform the
filter toto ensure
the devicethat
to the measurement
ensure is performedisatperformed
that the measurement this point. atTothis
perform
point.the
Tostudy,
perform a Luxi
the
study, a(Extrasensory
device Luxi device (Extrasensory
Devices, PaloDevices,
Alto, CA, Palo Alto,
USA) CA,
[39] USA)
was used.[39] wasdevice
This used. This device in is shown
study, a Luxi device (Extrasensory Devices, Palo Alto, CA, USA) [39] was used. is shown
This device Figure
is shown 2.
in
This Figure
device2. This
is a device
diffusion is a diffusion
dome dome
attachment attachment
for a for
smartphone’s a smartphone’s
front-facing front-facing
camera. camera.
in Figure 2. This device is a diffusion dome attachment for a smartphone’s front-facing camera.

Figure 2. Device used as a light diffusor.


Figure 2.
Figure 2. Device
Device used
used as
as aa light
light diffusor.
diffusor.

Another issue detected is the camera parameters, where values as such ISO, shutter speed or F-
Another issue detected is the camera parameters, where values as such ISO, shutter speed or F-
Stop Another
can change issuethedetected
values obtained in the same
is the camera lightingwhere
parameters, conditions.
valuesForas that
suchreason, and inspeed
ISO, shutter order orto
Stop can change the values obtained in the same lighting conditions. For that reason, and in order to
evaluate
F-Stop itschange
can use in thelighting
values measurement,
obtained in the it issame
necessary
lightingtoconditions.
take these parameters into and
For that reason, account.
in order to
evaluate its use in lighting measurement, it is necessary to take these parameters into account.
evaluate its use in lighting measurement, it is necessary to take these parameters into account.
4.3. External Sensor Device
4.3. External
4.3. Sensor Device
External Sensor Device
The use of lighting information can be useful for multiple applications. For example, with this
The use
The use itof
ofislighting
lighting information can canbebe useful
usefulforfor
multiple applications. For For
example, withwiththis
information, possibleinformation
to check lighting efficiency or multiple applications.
lighting regulation’s example,
accomplishment. Due
information,
this information,it is possible to check lighting efficiency or lighting regulation’s accomplishment. Due
to the possibilitiesit ofis possible to check
communication lighting
that efficiency
smartphones or lighting
offer, the useregulation’s
of external accomplishment.
devices that can
to
Due the possibilities
to the possibilitiesof communication
of communication that smartphones
thatthissmartphones offer, the use of external devices that can
interact with our applications is possible. For reason, anoffer, the use
analysis of external
of the devicesdevice
use of external that canas
interact
interact with our
with our applications is possible. For this reason, an analysis of the use of external device as
measurement toolapplications
was conducted,is possible.
which Forcan this reason,
be used withanthe
analysis of the use
smartphone of external
in real time. Todevice
perform as
measurement tool was
measurement was conducted,
conducted, whichwhich cancan be be used
used with
with the
the smartphone
smartphone in realreal time.
time. To perform
this evaluation,tool an external device, called ‘Alcalux’, a luxmeter developed by in the University Toofperform
Alcalá,
this
this evaluation,
evaluation, an
an external
external device,
device, called
called ‘Alcalux’,
‘Alcalux’, a
a luxmeter
luxmeter developed
developed by
by the
the University
University of
of Alcalá,
Alcalá,
has been made.
has been
has been made.
made. the best option of communication, and taking into account that the battery life is the
To choose
To choose
choose the best best option
option of of communication, and and taking
taking into
into account
account that
that the
the battery
battery life
life is
is the
mostTo importantthe factor for mobilecommunication,
users [40], the different possibilities of data transmission and the
most
most important
important factor for mobile
factorofforeach
mobile users [40], the different possibilities of data transmission and the
energy consumption oneusers [40], the
has been different
studied. On possibilities
that aspect, of thedata
besttransmission and the
option is Bluetooth
energy consumption of each one has been studied. On that aspect, the best option is Bluetooth
energy
becauseconsumption
of its low power of each one has been
consumption studied. On
compared with that aspect,
other the best
wireless option is Bluetooth
communication because
systems, such
because of its low power consumption compared with other wireless communication systems, such
of its low power consumption compared with other wireless communication
as Wi-Fi, as is shown in the study carried out by Perrocci et al. [41]. Another important aspect to takesystems, such as Wi-Fi,
as Wi-Fi, as is shown in the study carried out by Perrocci et al. [41]. Another important aspect to take
into account is that Bluetooth is embedded in nearly all smartphones.
into account is that Bluetooth is embedded in nearly all smartphones.
Appl. Sci. 2017, 7, 616 7 of 18

Appl.
as is Sci. 2017, 7,
shown in616
the study carried out by Perrocci et al. [41]. Another important aspect to take7 into of 18
account is that Bluetooth is embedded in nearly all smartphones.
In order
In order to to enable
enable Bluetooth
Bluetooth in in the
the external
external device,
device, anan embedded
embedded module module (RN-42
(RN-42 from
from Roving
Roving
networks, Los Gatos, CA, USA [42]) was chosen because of its simplicity
networks, Los Gatos, CA, USA [42]) was chosen because of its simplicity and relative low power and relative low power
consumption (about 30 mA during the transmission, 3 mA when
consumption (about 30 mA during the transmission, 3 mA when it is connected and 26 µA it is connected and 26 μA in sleep
in
mode).
sleep mode).
The data
The datatransmission
transmissionprocessprocess simulates
simulates a pipe
a pipe of messages
of messages where where the Bluetooth
the Bluetooth module
module receives
receives
data fromdatathefrom
UART the (Universal
UART (Universal Asynchronous
Asynchronous Receiver-Transmitter)
Receiver-Transmitter) of theofmicrocontroller
the microcontrollerand
and transmits the information through the
transmits the information through the wireless connection.wireless connection.
Despite the
Despite the present
present study
studyonly
onlycovering
coveringilluminance
illuminancemeasurement,
measurement,the created
the createddevice
deviceis able
is ableto
control
to control other
otherfactors such
factors as presence
such as presence or temperature.
or temperature. It is It
also possible
is also to settothe
possible setfrequency of data
the frequency of
registration and to store the data in EEPROM (Electrically Erasable
data registration and to store the data in EEPROM (Electrically Erasable Programmable Read-Only Programmable Read-Only
Memory) memory.
Memory) memory.ToTo avoid
avoid storing
storing excessive
excessive information
information in the memory,
in the memory, a device
a device has has been
been developed
developed
with with theofpossibility
the possibility configuring of the
configuring
automated themeasures
automated to bemeasures
taken in to be taken
a time rangeinbetween
a time range
2 and
between
65,524 s. 2 and 65,524 s.
To develop
To developthis thismeasurement
measurementdevice, device,different
differentprototypes
prototypeswere were built
built toto improve
improve thethe final
final result
result to
to achieve the objectives of the project. The prototypes
achieve the objectives of the project. The prototypes developed are: developed are:

1. The
The first
first prototype
prototype to be built was focused on measuring
measuring the illuminance.
illuminance. ToTo do it, an LDR
(Light-Dependent
(Light-Dependent Resistor)
Resistor) was
was used
used asas aa light
light sensor, which sends the information to a PIC
(Programmable
(Programmable Interrupt
Interrupt Controller)
Controller) microcontroller,
microcontroller, which
which is responsible for sending the
information
information to the computer through a serial cable. In this
computer through a serial cable. In this case, case,the
theLDR
LDRused
used was
was thethe NORPS-
NORPS-12
12 model
model of Silonex
of Silonex (Montreal,
(Montreal, Canada)
Canada) [43], which
[43], which is composed
is composed of a CdS of photocell
a CdS photocell with a
with a spectral
spectral
responseresponse similar
similar to to theeye.
the human human eye.
2. The
The second prototype
prototype developed
developedhashasincorporated
incorporatedimprovements
improvementsregarding
regarding new
new sensors
sensors such
such as
as movement
movement or or temperature,
temperature, apart
apart from
from the the
useuse of Bluetooth
of the the Bluetooth connection.
connection. Figure
Figure 3 shows
3 shows this
this second
second prototype.
prototype.

Figure 3. Alcalux device—second prototype.

33. The
The third
thirdprototype
prototype developed
developedwaswas
the the
finalfinal
device. The main
device. Thedifference regarding
main difference the previous
regarding the
prototype is the incorporation of a printed circuit board that electrically connects
previous prototype is the incorporation of a printed circuit board that electrically connectsthe electronic
components
the electronicusing conductive
components tracks,
using pads and
conductive other
tracks, features
pads etched
and other on copper
features etchedsheets. This
on copper
characteristic gives the final device a professional appearance compared to
sheets. This characteristic gives the final device a professional appearance compared to the the previous
prototypes. Furthermore,
previous prototypes. the light sensor
Furthermore, was
the light encapsulated
sensor with a plastic
was encapsulated with acylinder with an
plastic cylinder
aperture at the top to reduce up to 500 times the sensibility of the lighting sensor,
with an aperture at the top to reduce up to 500 times the sensibility of the lighting sensor,incrementing
the accuracy for
incrementing theaaccuracy
normal for
range of measurement
a normal intended forintended
range of measurement the device. Thedevice.
for the final result is a
The final
device the size of a cellphone, which is able to read some factors of the real world with high
precision and send it to our smartphone. In the case of light, it is possible to perform
measurements from 1 to 60,000 lux. Figure 4 shows the final device.
Appl. Sci. 2017, 7, 616 8 of 18

result is a device the size of a cellphone, which is able to read some factors of the real world
with high precision and send it to our smartphone. In the case of light, it is possible to perform
measurements from 1 to 60,000 lux. Figure 4 shows the final device.
Appl. Sci. 2017, 7, 616 8 of 18

Figure
Figure 4.
4. Alcalux
Alcalux sensor
sensor board.
board.

An important part of the developed device is the energy source that allows it to be used. From
An important part of the developed device is the energy source that allows it to be used. From the
the beginning, the aim was to create a low consumption device, setting this consumption on 200 mA
beginning, the aim was to create a low consumption device, setting this consumption on 200 mA or
or 0.1 W to allow it to operate with as much autonomy as possible. The device may use two different
0.1 W to allow it to operate with as much autonomy as possible. The device may use two different
energy sources:
energy sources:
USB connection. This sort of connection can be used to supply energy to the device by connecting
USB connection. This sort of connection can be used to supply energy to the device by connecting
it to an appropriate power source. Taking advantage of this, an external battery using 4 batteries of a
it to an appropriate power source. Taking advantage of this, an external battery using 4 batteries of a
1.2 V and 2100 mA was made, which takes the role of an autonomous energy source.
1.2 V and 2100 mA was made, which takes the role of an autonomous energy source.
Solar panel. It has been done with four small solar panels that give a voltage of 4.8 V to the
Solar panel. It has been done with four small solar panels that give a voltage of 4.8 V to the device,
device, which is enough to supply the developed device.
which is enough to supply the developed device.
5. Results and Hypothesis Validation
5. Results and Hypothesis Validation
To validate the hypothesis, a series of tests has been run using different methodologies. To make
To validate the hypothesis, a series of tests has been run using different methodologies. To make
the validation more adequate, we have tested each measure methodology in order to study the
the validation more adequate, we have tested each measure methodology in order to study the accuracy
accuracy of each one, so we are able to combine all of them in tables to analyze the results and study
of each one, so we are able to combine all of them in tables to analyze the results and study the range
the range of error and accuracy.
of error and accuracy.
There is no doubt that data acquisition conditions are very important to properly evaluate the
There is no doubt that data acquisition conditions are very important to properly evaluate the
accuracy of the different systems analyzed in the study. To ensure that the information obtained is as
accuracy of the different systems analyzed in the study. To ensure that the information obtained is as
accurate as possible, all of the measurements have been performed in the same scenario, in a dark
accurate as possible, all of the measurements have been performed in the same scenario, in a dark room
room with a light bulb and a dimmer. The light source is a 220 W dimmable incandescent light bulb,
with a light bulb and a dimmer. The light source is a 220 W dimmable incandescent light bulb, and
and it has been connected to a dimmer, which controls the light intensity level as desired. As a
it has been connected to a dimmer, which controls the light intensity level as desired. As a reference
reference value for the measurements, the authors use a standard luxmeter model PCE-174 (PCE
value for the measurements, the authors use a standard luxmeter model PCE-174 (PCE Iberia, Tobarra,
Iberia, Tobarra, Spain) [44], which has been previously calibrated.
Spain) [44], which has been previously calibrated.
The results of tests are presented and analyzed separately in the following sections.
The results of tests are presented and analyzed separately in the following sections.

5.1.
5.1. Mobile
Mobile Ambient
Ambient Light
Light Sensor
Sensor
The first methodology
The first methodologyisisbased
basedon onthetheambient
ambientlight
lightsensor
sensorconsisting
consistingofof capturing
capturing thethe amount
amount of
of light directly from the smartphone’s ambient
light directly from the smartphone’s ambient light sensor. light sensor.
To check the
To check the accuracy of this
accuracy of this sensor,
sensor, aa simple
simple application
application inin Android
Android OS
OS was was developed
developed to to obtain
obtain
the
the level
level of
of light
light registered directly by
registered directly by it.
it. This
This application
application was
was executed in aa first
executed in first step
step in
in an
an LG
LG Nexus
Nexus
55 smartphone
smartphone to obtain the
to obtain the information.
information. When When wewe compared
compared the the measured
measured data data ofof the
the smartphone
smartphone
with the information obtained to the referenced luxmeter (Figure 5), we obtained
with the information obtained to the referenced luxmeter (Figure 5), we obtained an absolute error an absolute error
of
of 39.08%. As can be appreciated, the accuracy of this value is not high, but it is possible
39.08%. As can be appreciated, the accuracy of this value is not high, but it is possible to appreciate to appreciate
that the tendency of the measures is similar to the data obtained from the luxmeter. This is a signal
that a process of calibration of the sensor is necessary. The calibration method consists of comparing
a reference illumination value with the value displayed on the luxmeter that is to be calibrated.
Appl. Sci. 2017, 7, 616 9 of 18

that the tendency of the measures is similar to the data obtained from the luxmeter. This is a signal
that a process of calibration of the sensor is necessary. The calibration method consists of comparing a
Appl. Sci.
reference 2017, 7, 616
illumination 9 of 18
value with the value displayed on the luxmeter that is to be calibrated.
Appl. Sci. 2017, 7, 616 9 of 18

800
800
700
700
600
600
(lux)
(lux)

500
500
Iluminance
Iluminance

400
400
300
300
200
200
100
100
0
0 0 5 10 15 20 25
0 5 10 15 20 25
Measurements
Measurements
Luxmeter Measured Values
Luxmeter Measured Values
Figure 5. Ambient light sensor vs. luxmeter accuracy.
Figure 5. Ambient light sensor vs. luxmeter accuracy.
Figure 5. Ambient light sensor vs. luxmeter accuracy.
To ensure
To ensure thethe calibration’saccuracy,
calibration’s accuracy, wewe use
useall allofof
thethemeasured
measured points to have
points to ahave
goodasample of
good sample
To ensure the calibration’s accuracy, we use all of the measured points to have a good sample of
data
of data with different lux levels, which were used in order to find the calibration factor of the device.
datawith
with different luxlevels,
different lux levels, which
which werewere
used used
in orderin to order to find
find the the calibration
calibration factor of thefactor
device.of the
TheThe
device. calibration defines whichwhich
digitaldigital
outputoutput
value relates to whichtoluminance input signal. This
The calibration defines which digital output value relates to which luminance input signal. Thissignal.
calibration defines value relates which luminance input
relationship between scene luminance and digital output levels of a digital image’s capture system is
This relationship
relationshipbetween
betweenscene
scene luminance
luminance andand digital
digital output
output levelslevels of a digital
of a digital image’s image’s
capturecapture
system issystem
called optoelectronic conversion function (OECF) [10]. This kind of calibration is important to adjust
is called optoelectronic
called optoelectronicconversion
conversion function (OECF)[10].
function (OECF) [10]. This
This kind
kind of calibration
of calibration is important
is important to adjust
to adjust
the model developed to the characteristics of the devices. Once the calibrated factor is obtained, to
the model
the model developed
developed to to
thethe characteristics of
characteristics of the
the devices.
devices. Once
Once thethe
calibrated
calibrated factor is obtained,
factor is to
obtained, to
achieve the real measured data, it is necessary to multiply the measured value to this factor, as shows
achieve
achieve the
the real real measured data, it is necessary to multiply the measured value to this factor, as shows
Equation (2):measured data, it is necessary to multiply the measured value to this factor, as shows
Equation
Equation (2): (2):
Luxreal = Luxmeasure × Ccal. (2)
Luxreal Luxmeasure ××Ccal.
Luxreal==Luxmeasure Ccal. (2) (2)
After calibrating the measures performed with the calibration factor, the absolute error has been
AfterAfter
reduced
calibrating the
calibrating
to 13.74%, the
measuresperformed
and,measures
performed with
as can be appreciated with
in
the
thecalibration
Figure calibration
6,
factor, thethe
the values factor,
absolute errorerror
are closer toabsolute
has been
has been
the reference data.
reduced to 13.74%, and, as can be appreciated in Figure 6, the values are closer
reduced to 13.74%, and, as can be appreciated in Figure 6, the values are closer to the reference data. to the reference data.

800
800
700
700
600
(lux)

600
(lux)

500
500
Illuminance
Illuminance

400
400
300
300
200
200
100
100
0
0 0 5 10 15 20 25
0 5 10 15 20 25
Measurements
Measurements
Luxmeter Measured Values Calibrated Values
Luxmeter Measured Values Calibrated Values

Figure
Figure 6. Ambient
6. Ambient light
light sensorvs.
sensor vs. calibrated
calibrated ambient
ambientlight sensor
light vs. vs.
sensor luxmeter accuracy.
luxmeter accuracy.
Figure 6. Ambient light sensor vs. calibrated ambient light sensor vs. luxmeter accuracy.
Appl. Sci. 2017, 7, 616 10 of 18
Appl. Sci. 2017, 7, 616 10 of 18

However,
However, ifif we
we analyze
analyze the
the accuracy
accuracy of
of the
the data
data in
in depth,
depth, itit is
is possible
possible to
to sort
sort out
out three
three different
different
groups.
groups. If
If we
we divide
divide the
the measurements
measurements in in these
these groups
groups and
and recalculate
recalculate calibration
calibration factor
factor of
of each
each one
one
separately, the accuracy of the sensor can be increased. The three groups of data are the
separately, the accuracy of the sensor can be increased. The three groups of data are the following:following:
1.
1. The
The first
first group of values
group of valuesenglobes
englobesmeasurements
measurementsupup toto 100
100 lux.
lux. If we
If we analyze
analyze the the accuracy
accuracy of
of this
this data independently of the global evaluation, it is possible to see how the accuracy
data independently of the global evaluation, it is possible to see how the accuracy of the data of the data
isistoo
toolow
lowwith
withan
anabsolute
absoluteerror
error of
of 61.77%.
61.77%. However,
However, ifif we
we analyze
analyze these
these data
data separately
separately from
from
the
the rest of measurements, performing the calibration of these values, it is possible to
rest of measurements, performing the calibration of these values, it is possible to see
see how
how the
the
error decreases to 27.01%.
error decreases to 27.01%.
2. The second group of values englobes measurements from 100 to 500 lux. Analyzing once again
2. The second group of values englobes measurements from 100 to 500 lux. Analyzing once again
the accuracy of this data separately from the global evaluation, it is shown how the accuracy of
the accuracy of this data separately from the global evaluation, it is shown how the accuracy of
the data in this section is higher, with an absolute error of 8.20%. However, performing again
the data in this section is higher, with an absolute error of 8.20%. However, performing again the
the calibration of the system to these values, it is possible to decrease the error to a 5.86%.
calibration of the system to these values, it is possible to decrease the error to a 5.86%.
3. The last group englobes measurements higher than 500 lux. Despite the errors obtained in these
3. The last group englobes measurements higher than 500 lux. Despite the errors obtained in these
measurements not being high regarding the percentage (4.75%), the problem observed is that
measurements not being high regarding the percentage (4.75%), the problem observed is that the
the higher the value measured, the higher the difference between real and calibrated values. For
higher the value measured, the higher the difference between real and calibrated values. For this
this reason, this section has been analyzed separately again to reduce the percentage of error as
reason, this section has been analyzed separately again to reduce the percentage of error as much
much as possible, obtaining an absolute error of 1.84%.
as possible, obtaining an absolute error of 1.84%.
As a result, and after this new recalibration, if we evaluate again the accuracy of the light sensor
As a result, and after this new recalibration, if we evaluate again the accuracy of the light sensor
for all the measurements, and always having in mind the luxmeter as the reference level, the accuracy
for all the measurements, and always having in mind the luxmeter as the reference level, the accuracy
of the evaluation increases, having an absolute error of 8.41%. Figure 7 shows the final data analysis
of the evaluation increases, having an absolute error of 8.41%. Figure 7 shows the final data analysis
with this new calibration.
with this new calibration.

800

700

600
Illuminance (lux)

500

400

300

200

100

0
0 5 10 15 20 25
Measurements

Luxmeter Calibrated Values

Figure 7. Calibrated ambient light sensor vs. luxmeter accuracy.


Figure 7. Calibrated ambient light sensor vs. luxmeter accuracy.

To evaluate
To evaluate the
thebehavior
behaviorofofthis
thissensor,
sensor,and
andininorder
ordertoto know
know if these
if these calibrations
calibrations cancan be used
be used by
by other
other devices,
devices, we we have
have repeated
repeated thethe experiment,
experiment, with
with a aSony
SonyXperia
XperiaM2 M2andandaaBQBQ Aquaris
Aquaris X5
X5
smartphones. After repeating the experiment in the same conditions as in the
smartphones. After repeating the experiment in the same conditions as in the previous case, andprevious case, and
performing the
performing the initial
initial calibration
calibration according
according to to Equation
Equation (2),
(2), we
we have
have obtained
obtained anan average
average error
error of
of
10.33% in
10.33% in the
the first
first device
device and
and 11.82%
11.82% in in the
the second. The results
second. The results are
are shown
shown in in Figure
Figure 8.
8.
Appl. Sci.
Sci. 2017,
2017, 7,
7, 616
616 11
11 of
of 18
18

800
700
Illuminance (lux)

600
500
400
300
200
100
0
0 5 10 15 20 25
Measurements

Luxmeter Sony Xperia M2 BQ Aquaris X5

Figure 8. Sony Xperia M2’s Ambient light sensor vs. BQ Aquaris X5’s Ambient light sensor vs.
Figure 8. accuracy.
luxmeter Sony Xperia M2’s Ambient light sensor vs. BQ Aquaris X5’s Ambient light sensor vs.
luxmeter accuracy.

To know if the measurement groups used in the previous experiment to recalculate the devices’
To know if the measurement groups used in the previous experiment to recalculate the devices’
calibration factor can be used in other devices, they were used in the new experiments. As a result,
calibration factor can be used in other devices, they were used in the new experiments. As a result,
we have that the accuracy of the measurements are higher than if we use just one calibration factor,
we have that the accuracy of the measurements are higher than if we use just one calibration factor,
passing from 10.33% to 7.80% of average error in Sony Xperia M2, and passing from 11.82% to 9.58%
passing from 10.33% to 7.80% of average error in Sony Xperia M2, and passing from 11.82% to 9.58%
in the case of BQ Aquaris X5. However, to check if those calibration groups can be optimized in each
in the case of BQ Aquaris X5. However, to check if those calibration groups can be optimized in each
device, an analysis to find the best calibration option in each case was performed. As a result, it is
device, an analysis to find the best calibration option in each case was performed. As a result, it is
possible to see how, in the case of Sony Xperia M2, the best measurement groups match the case of
possible to see how, in the case of Sony Xperia M2, the best measurement groups match the case of
the first experiment. However, in the case of BQ Aquaris X5, there are differences in the behavior
the first experiment. However, in the case of BQ Aquaris X5, there are differences in the behavior
regarding the measurements performed in the initial experiment, which suggest that it is possible to
regarding the measurements performed in the initial experiment, which suggest that it is possible to
move the group of measurements to perform the recalibration. In this case, it is possible to decrease the
move the group of measurements to perform the recalibration. In this case, it is possible to decrease
error from 9.58% to 7.87% if we move the barriers of the recalibration in the following groups: 0–100;
the error from 9.58% to 7.87% if we move the barriers of the recalibration in the following groups: 0–
101–500 and 501–700.
100; 101–500 and 501–700.
5.2. Mobile Camera
5.2. Mobile Camera
The second methodology used to measure the illuminance through the mobile devices is based on
Theofsecond
the use methodology
the digital camera. Asused to measure
it does happen the illuminance
in previous through
sections, the mobile
in order devices
to perform is based
an accurate
on the use of the digital camera. As it does happen in previous sections, in order to
measurement, the digital camera has to be calibrated first before using it for measuring luminance. perform an
accurate measurement, the digital camera has to be calibrated first before using it for
This time, to calibrate the measurements obtained, it is necessary to take into account not only the measuring
luminance. This time, to calibrate the measurements obtained, it is necessary to take into account not
differences in hardware between devices but also the camera settings that have to be fixed for all of the
only the differences in hardware between devices but also the camera settings that have to be fixed
measurements. These values are: ISO, which is the level of sensitivity of the camera to available light;
for all of the measurements. These values are: ISO, which is the level of sensitivity of the camera to
Shutter Speed, which is the length of time a camera shutter is open to expose light into the camera
available light; Shutter Speed, which is the length of time a camera shutter is open to expose light
sensor; and Aperture, which is a hole within a lens, through which light travels into the camera body.
into the camera sensor; and Aperture, which is a hole within a lens, through which light travels into
For this reason, the measurements carried out in the experiment keep the same camera characteristics
the camera body. For this reason, the measurements carried out in the experiment keep the same
fixed throughout the experiments. In this way, it was possible to compare the obtained results.
camera characteristics fixed throughout the experiments. In this way, it was possible to compare the
To check the accuracy of this method, another Android application was developed to obtain the
obtained results.
luminance level directly with the digital camera. This application was executed in a first step in a
To check the accuracy of this method, another Android application was developed to obtain the
Sony Xperia M2 smartphone and a Luxi device was used as a filter to guarantee that the luminance is
luminance level directly with the digital camera. This application was executed in a first step in a
measured as close as possible to the camera. To perform the picture capture in the same conditions,
Sony Xperia M2 smartphone and a Luxi device was used as a filter to guarantee that the luminance
the application fixed the camera settings. Before that, the camera captures the picture, the application
is measured as close as possible to the camera. To perform the picture capture in the same conditions,
developed evaluates it pixel by pixel in order to obtain the RGB values and transforms these values to
the application fixed the camera settings. Before that, the camera captures the picture, the application
grey scale through Equation (1), which performs the sum of Red, Green and Blue components.
developed evaluates it pixel by pixel in order to obtain the RGB values and transforms these values
Furthermore, and to ensure the accuracy of the methodology, a calibration phase where we use
to grey scale through Equation (1), which performs the sum of Red, Green and Blue components.
all of the measured points to find the calibration factor of the device is required. The calibration
Furthermore, and to ensure the accuracy of the methodology, a calibration phase where we use
all of the measured points to find the calibration factor of the device is required. The calibration
Appl. Sci.
Appl. Sci. 2017,
2017,7,7,616
616 12 of
12 of 18
18

defines which digital output value relates to which luminance input signal. After the calibration of
defines which digital output value relates to which luminance input signal. After the calibration of the
the measures was performed, the absolute error of the measurements became 12.63% (Figure 9).
measures was performed, the absolute error of the measurements became 12.63% (Figure 9).

800

700

600
Illuminance (lux)

500

400

300

200

100

0
0 5 10 15 20 25 30
Measurements

Luxmeter Camera Luminance

Figure 9. Digital camera vs. luxmeter accuracy.


Figure 9. Digital camera vs. luxmeter accuracy.

However, if
However, if we
we evaluate
evaluate the
the accuracy
accuracy ofof the
the data
data in
in more
more detail,
detail, it
it is
is possible
possible again
again to
to divide
divide the
the
data into three different groups. Dividing the measurements in these groups and recalculating
data into three different groups. Dividing the measurements in these groups and recalculating the the
calibration factor
calibration factor of
ofeach
eachone
oneseparately, thethe
separately, accuracy of the
accuracy measurements
of the measurements can be
canincreased. The three
be increased. The
groups studied are the following:
three groups studied are the following:
1.
1. Thefirst
The firstgroup
groupof of values
values englobes
englobes measurements
measurementsup up to
to 100
100 lux.
lux. IfIf we
we analyze
analyze the
the accuracy
accuracy of of
thisportion
this portionof ofdata,
data,ititisistoo
toolow,
low, with
with an an absolute
absolute error
error ofof 46.43%.
46.43%. However,
However, ifif we
we perform
perform the the
calibration limited to these values, it is possible to see how the error decreases
calibration limited to these values, it is possible to see how the error decreases to 20.35%. to 20.35%.
2.
2. Thesecond
The secondgroup
groupof ofvalues
valuesenglobes
englobesmeasurements
measurementsfrom from 100100 to
to500
500lux.lux. With
Withan
anabsolute
absolute error
error
of 5.35%, performing again the calibration of the system to these values, it is possible
of 5.35%, performing again the calibration of the system to these values, it is possible to decrease to decrease
theerror
the errortoto4.21%.
4.21%.
3.
3. The
Thelast
last group
group englobes
englobes measurements
measurementshigherhigher than
than 500
500 lux.
lux. Without
Withoutaa high high amount
amount of of error
error
regarding
regarding thethe percentage
percentage (10.70%),
(10.70%), the
the problem
problem observed
observed isis that
that error
error increases
increases ifif the
the value
value
measured
measuredisis higher.
higher. ForForthis
thisreason,
reason, this
this section
section has
has been
been analyzed
analyzed separately,
separately, obtaining
obtaining an an
absolute
absoluteerror
errorofof2.17%.
2.17%.
As
As aa result,
result, after
after this
this new
new calibration
calibration method,
method, the
the accuracy
accuracy of
of the
the light
light sensor,
sensor, compared
compared with
with aa
referenced
referenced luxmeter,
luxmeter, increased, having an
increased, having an absolute
absolute error
error of
of 6.35%
6.35% (Figure
(Figure 10).
10).
To evaluate the behavior of this sensor, and in order to know if these calibrations can be used by
other devices, we have repeated the experiment in the same conditions, with an LG Nexus 5 and a
BQ Aquaris X5. After repeating the experiment and performing the initial calibration according to
Equation (2), we have obtained an average error of 12.93% in the first device and 10.02% in the second.
The results are shown in Figure 11.
700
600

Illuminance (lux)
500

Appl.
400
Appl.Sci.
Sci. 2017,7,7,616
2017, 616 13of
13 of18
18
300
200
800
100
700
6000
Illuminance (lux)

0 5 10 15 20 25 30
500
Measurements
400
300 Luxmeter Camera Luminance Calibrated camera
200
100 Figure 10. Digital camera vs. calibrated digital camera vs. luxmeter accuracy.
0
To evaluate
0 the behavior
5 of this sensor,
10 and in order
15 to know if20 these calibrations
25 can be used30 by
other devices, we have repeated the experiment in the same conditions, with an LG Nexus 5 and a
Measurements
BQ Aquaris X5. After repeating the experiment and performing the initial calibration according to
Equation (2), we have obtained an average
Luxmeter errorLuminance
Camera of 12.93% in Calibrated
the first device
cameraand 10.02% in the second.
The results are shown in Figure 11.
Figure 10. Digital camera vs. calibrated digital camera vs. luxmeter accuracy.
Figure 10. Digital camera vs. calibrated digital camera vs. luxmeter accuracy.
800
To evaluate the behavior of this sensor, and in order to know if these calibrations can be used by
700
other devices, we have repeated the experiment in the same conditions, with an LG Nexus 5 and a
600 X5. After repeating the experiment and performing the initial calibration according to
BQ Aquaris
Illuminance (lux)

Equation500
(2), we have obtained an average error of 12.93% in the first device and 10.02% in the second.
The results
400
are shown in Figure 11.

300
800
200
700
100
6000
Illuminance (lux)

500 0 5 10 15 20 25 30

400 Measurements

300
Luxmeter LG Nexus 5 BQ Aquaris X5
200
Figure 11. LG Nexus 5’s digital damera vs. BQ Aquaris X5’s Digital camera vs. luxmeter accuracy.
100
Figure 11. LG Nexus 5’s digital damera vs. BQ Aquaris X5’s Digital camera vs. luxmeter accuracy.
0 if the accuracy of the measurements increases if we use the calibration ranges used in
To know
To know0 if the accuracy
5 of the measurements
10 15
increases if we 20 25
use the calibration
the previous experiment, a recalibration of the measurement following the same methodology as in
30
ranges used in
the
the previous experiment,was
previous experiment a recalibration
performed. of Asthe Measurements
measurement
a result, following
the accuracy of the the same methodology
measurements is higheras in
than
the
if weprevious experiment
used just was performed.
one calibration factor, goingAsfrom
a result, the accuracy
12.93% to 9.24% of of average
the measurements
error in LGisNexus
higher5,than
and
ifgoing
we used just one calibration Luxmeter
factor, going LG Nexus
from 5 toBQ
12.93% Aquaris
9.24% of X5
average error in LG Nexus 5, and
from 10.02% to 8.82% in the case of BQ Aquaris X5. However, analyzing both cases separately,
going from 10.02%
it is possible to see to 8.82% in the
differences casebehavior
in the of BQ Aquaris X5. However,
regarding analyzing
the measurements both casesinseparately,
performed the initial
itexperiment,
is possible to see differences
which suggest in it
that theis behavior
possible regarding thegroup
measurements performed in the initial
Figure 11. LG Nexus 5’s digital damera vs. BQtoAquaris
move X5’s
the of measurements
Digital camera vs. luxmeter to perform
accuracy. the
experiment,
recalibration.which
In the suggest that
case of the it is possible
measurement to move on
performed theLG group
Nexus of 5,measurements
it was possibletotoperform
decrease the
the
recalibration.
errorToupknow In the
if the
to 7.26% case of
if accuracy the
we move of measurement
thethe measurements
barriers performed on LG
increases ifinwe
of the recalibration Nexus
theuse 5, it was possible
the calibration
following to
groups: ranges decrease
used in
0–100; 101–400
the
the error
andpreviousup to
401–700. 7.26% if we
experiment,
The same amove the
in barriers
recalibration
happened of measurement
caseofofthe
BQ the recalibration
Aquaris in the
following
X5, where following
it was the samegroups:
possible 0–100;
methodology
to reduce 101–
the as in
error
the previous
to 7.87%, experiment
performing thewas performed.
recalibration As a result,
according thefollowing
to the accuracy of the measurements
groups: 0–50; 51–575;is576–700.
higher than
if we used just one calibration factor, going from 12.93% to 9.24% of average error in LG Nexus 5, and
5.3. External
going Sensorto
from 10.02% Device
8.82% in the case of BQ Aquaris X5. However, analyzing both cases separately,
it is possible
The last to see differences
methodology in the
studied behavior
includes theregarding
use of the the measurements
external performed
sensor device. in the initial
In this situation, the
experiment,
mobile phone which
does suggest
not measurethat the
it islight.
possible to receives
It only move the thegroup of measurements
sensor’s information about to perform the
the quantity
recalibration.
of light acrossIn the case ofsignal.
a Bluetooth the measurement
At first sight,performed on LG Nexus
this methodology 5, it was
is expected to bepossible
the mosttoaccurate
decrease of
the error up to 7.26% if we move the barriers of the recalibration in the following groups: 0–100; 101–
error to 7.87%, performing the recalibration according to the following groups: 0–50; 51–575; 576–700.

5.3. External Sensor Device


The last methodology studied includes the use of the external sensor device. In this situation,
the
Appl.mobile
Sci. 2017,phone
7, 616 does not measure the light. It only receives the sensor’s information about the
14 of 18
quantity of light across a Bluetooth signal. At first sight, this methodology is expected to be the most
accurate of the three studied in this paper because it presents a dedicated hardware developed with
the three studied in this paper because it presents a dedicated hardware developed with the intention
the intention of measuring the light. In this situation, we started from a device that was previously
of measuring the light. In this situation, we started from a device that was previously calibrated,
calibrated, so that the information received is ready to be used directly in every device connected to
so that the information received is ready to be used directly in every device connected to the sensor.
the sensor.
To perform the study of the accuracy of this device, the same conditions as in the previous
To perform the study of the accuracy of this device, the same conditions as in the previous
experiments (a dark room with a dimmable light) were used, and the results obtained when the
experiments (a dark room with a dimmable light) were used, and the results obtained when the
measurements were compared with the reference values obtained from the luxmeter show an absolute
measurements were compared with the reference values obtained from the luxmeter show an
error of 2.70% (Figure 12). Despite everything indicating that two calibrated sensors should measure
absolute error of 2.70% (Figure 12). Despite everything indicating that two calibrated sensors should
the same value in the same conditions, the differences in the design could cause differences derived
measure the same value in the same conditions, the differences in the design could cause differences
from the position and angle misalignments, making the comparison of the values a difficult task to
derived from the position and angle misalignments, making the comparison of the values a difficult
be performed.
task to be performed.
450
400
350
Illuminance (lux)

300
250
200
150
100
50
0
0 2 4 6 8 10 12 14 16
Measurements

Luxmeter Alcalux

Figure 12. External sensor device (Alcalux) vs. luxmeter accuracy.


Figure 12. External sensor device (Alcalux) vs. luxmeter accuracy.

5.4. Hypothesis Validation


5.4. Hypothesis Validation
Regarding the proposed hypotheses, they can be answered based on the research performed.
Regarding the proposed hypotheses, they can be answered based on the research performed.
The first hypothesis (H1) stated that the ambient light sensor that is present in most mobile devices
The first hypothesis (H1) stated that the ambient light sensor that is present in most mobile
provides enough quality to be used as a measurement tool, with the developed Android application
devices provides enough quality to be used as a measurement tool, with the developed Android
and the measurements performed twice, one with the mobile phone and another with a calibrated
application and the measurements performed twice, one with the mobile phone and another with a
luxmeter. Once all of the data were obtained and compared, it was possible to check how the accuracy
calibrated luxmeter. Once all of the data were obtained and compared, it was possible to check how
of the light meter was too low, with an error of 39.08%. However, after a process of calibration, this
the accuracy of the light meter was too low, with an error of 39.08%. However, after a process of
error was reduced up to 8.41% in the case of the first experiment. Given these results, it is possible to
calibration, this error was reduced up to 8.41% in the case of the first experiment. Given these results,
assert that this kind of sensor can be used as a measurement tool. However, the average error observed
it is possible to assert that this kind of sensor can be used as a measurement tool. However, the
suggests that this kind of device can be used only as an orientative tool because you need a luxmeter
average error observed suggests that this kind of device can be used only as an orientative tool
for calibrating every mobile phone model.
because you need a luxmeter for calibrating every mobile phone model.
Concerning the second hypothesis (H2), which stated that the smartphones’ digital camera can be
Concerning the second hypothesis (H2), which stated that the smartphones’ digital camera can
used as a lighting measuring tool, an extra functionality to the previous mobile application, in order to
be used as a lighting measuring tool, an extra functionality to the previous mobile application, in
capture the required data from the digital camera, was developed. As in the previous hypothesis, the
order to capture the required data from the digital camera, was developed. As in the previous
precision of the measurements when they are compared with a reference luxmeter was at a medium
level, with an absolute error of 12.63%. For this reason, a calibration process was necessary in order to
improve the accuracy of the data, having the possiblity to reduce this error up to 6.35%. These results
highlight that a smartphone’s digital camera can be used as a light measurement tool, asserting the
proposed hypothesis.
Furthermore, according to the third hypothesis (H3), the use of external sensors connected
to the mobile device through Wi-Fi or Bluetooth provides measurements with a similar quality as
Appl. Sci. 2017, 7, 616 15 of 18

that obtained by the internal mobile sensors (ambient light sensor and digital cameras). To check
the validation of this hypothesis, other measurements were performed with an external sensor that
transferred all of the information directly to the mobile device through a Bluetooth connection. After
studying all of the measurements, an average error of 2.70% was noted, meaning this hypothesis
cannot be accepted due to the accuracy of the external device being higher than the others.
In relation to the last hypothesis (H4), which stated that mobile devices can be used by any
smartphone user as a fairly accurate light meter tool, we can assert that it is always possible that
a pre-calibration process was performed for each device. However, the process of calibration may
result in being difficult to be performed by users due to the fact that it requires the use of a calibrated
luxmeter, which is not a common device for users. Furthermore, despite a complete process of
calibration requiring an analysis performed by measuring sections, the accuracy obtained with just
one calibration factor is enough to be used for a general purpose.

6. Conclusions
As a conclusion, this study shows how the smartphones can be used in lighting measurement
tasks when high precision of data is not required, being a great tool to have a reference of the luminance
levels, but they are not as accurate as professional hardware designed for the task.
The results do show how the accuracy of each of the three methods used to perform the evaluation
of the luminance is high after calibration. However, if the results are compared between the three
methods, it can be seen how the precision of the internal sensors, as ambient light sensor or the digital
camera, regarding to an external sensor is lower.
This can be caused by the perturbation of ambient light and the fact that the mobile ambient light
sensor, due to its physical characteristics, is only able to read direct light, while the luxmeter used on
the experiment is able to also measure indirect light.
However, a light meter can never be 100% accurate. There will always be slight variances
between light meters, even if they are identical models. It is important to take into consideration
that luxmeters can also drift over time, making it necessary to calibrate them to eventually ensure
readings as accurately as possible. This characteristic that makes it necessary to calibrate each device
separately, even in identical models, hinders the use of smartphones as an accurate measurement tool
due to the need to perform the calibration on each device separately. On the other hand, the use of an
external device not only improves measurements accuracy, but it can also be used by more than one
mobile device.
During the experiments, it was also showed how the use of more than one calibration’s parameter
increases the accuracy of each sensor. However, the lighting section used to perform this calibration
can be different in each device, a reason why, before performing this evaluation, it is necessary to
determine values that fit better for each case.
Nevertheless, the work performed does not stop here. For future directions of study, the use of
artificial intelligence is proposed, specifically a multi-agent, to evaluate the values obtained for the
external sensor to help in decision-making about lighting.
Likewise, the use of both ambient light sensors and digital cameras as tools for home automation
control in offices, centers and homes, where the measurements do not need to be as accurate,
is also proposed.
Finally, creating a collaborative system that allows the combination of measures from more than
one mobile phone, with the aim of self-discovering the calibration needed for every device, is proposed.

Acknowledgments: Authors want to thank the support of ESVI-AL EU project, and to the “University Master in
Information Technology Project Management” of the University of Alcalá.
Appl. Sci. 2017, 7, 616 16 of 18

Author Contributions: Jose-Maria Gutierrez-Martinez and Ana Castillo-Martinez have developed the mobile
application used along the experiments and performed the analysis of the results obtained on the different
experiments; Jose-Amelio Medina-Merodio and Juan Aguado-Delgado have been in charge of the measurements
performed, have perform the measurements and Jose-Javier Martinez-Herraiz have coordinate the work performed
and validated the results.
Conflicts of Interest: The authors declare no conflict of interest.

References
1. Park, B.S.; Choi, H.H. Design and Implementation of Interactive-typed Bluetooth Device interact with
An-droid Platform-based Contents Character. J. Korea Soc. Comput. Inf. 2014, 19, 127–135. [CrossRef]
2. Hong, S.P.; Kang, S.; Kim, J. Design and Implementation of Reliable Content Transaction System in
Smartphone Environment. Int. J. Smart Home 2013, 7, 333–342. [CrossRef]
3. Bajad, R.A.; Srivastava, M.; Sinsha, A. Survey on Mobile Cloud Computing. J. Eng. Sci. Emerg. Technol. 2012,
1, 8–19.
4. Sarwar, M.; Soomro, T.R. Impact of Smartphone’s on Society. Eur. J. Sci. Res. 2013, 98, 216–226.
5. Electricity Cost Calculator. Available online: https://play.google.com/store/apps/details?id=com.
winterparadox.Watt_Calculator (accessed on 24 April 2017).
6. Koroglu, M.T.; Passino, K.M. Illumination balancing algorithm for smart lights. IEEE Trans. Control
Syst. Technol. 2014, 22, 557–567. [CrossRef]
7. Baum, A.; West, R.; Weinman, J.; Newman, S.; McManus, C. Cambridge Handbook of Psychology, Health and
Medicine; Cambridge University Press: Cambridge, UK, 1997. [CrossRef]
8. Burks, S.L. Managing Your Migraine; Humana Press: Totowa, NJ, USA, 1994; ISBN 0-89603-277-9.
9. European Committee for Standardization. UNE-EN 12464-1:2012 Light and Lighting—Lighting of Work
Places—Part 1: Indoor Work Places; European Committee for Standardization: 2012.
10. European Committee for Standardization. UNE-EN 12464-2:2008. Light and Lighting—Lighting of Work
Places—Part 2: Outdoor Work Places; European Committee for Standardization: 2008.
11. Marschner, S.R.; Greenberg, D.P. Inverse lighting for photography. In Proceedings of the Color and Imaging
Conference, Scottsdale, AZ, USA, 17–20 November 1997; Society for Imaging Science and Technology:
Springfield, VA, USA, 1997; Volume 1, pp. 262–265.
12. Ismail, H.; Azmi, M.S.; Hashim, M.A.; Ayob, M.N.; Hashim, M.S.M.; Hassrizal, H.B. Development of a
webcam based lux meter. In Proceedings of the 2013 IEEE Symposium on Computers & Informatics (ISCI),
Langkawi, Malaysia, 7–9 April 2013; pp. 70–74. [CrossRef]
13. Pavlogeorgatos, G. Environmental parameters in museums. Build. Environ. 2003, 38, 1457–1462. [CrossRef]
14. Lorne, J.K.; Salmon, M. Effects of exposure to artificial lighting on orientation of hatchling sea turtles on the
beach and in the ocean. Endanger. Species Res. 2007, 3, 23–30. [CrossRef]
15. Wise, S. Studying the ecological impacts of light pollution on wildlife: Amphibians as models. In StarLight:
A Common Heritage; Marın, C., Jafari, J., Eds.; StarLight Initiative la Palma Biosphere Reserve, Instituto
de Astrofısica de Canarias, Government of the Canary Islands, Spanish Ministry of the Environment,
UNESCO-MaB: Canary Islands, Spain, 2007; pp. 107–116.
16. Sparks, D.D. The Design and Implementation of a Smartphone Illuminance Meter. Doctoral Dissertation,
Massachusetts Institute of Technology, Cambridge, MA, USA, 2013.
17. García García, E. Cálculo de Iluminación en Interiores con el Software Visual Profesional Edition;
Universidad Veracruzana 2015. (In Spanish). Available online: https://core.ac.uk/display/33661584?
source=3&algorithmId=14&similarToDoc=16308316&similarToDocKey=CORE&recSetID=58cfaae7-a2ae-
4bcc-b3c5-1c66fbe95869&position=4&recommendation_type=same_repo&otherRecs=16306137,54242594,
80118441,33661584,29406445 (accessed on 9 June 2017).
18. Gómez-Llorente, D. A new methodology for calculating roadway lighting design based on a multi-objective
evolutionary algorithm. J. Expert Syst. Appl. 2013, 40, 2156–2164. [CrossRef]
19. Raminhos, F.M.; Valdez, M.; Ferreira, C.M.; Barbosa, F.M. Programas de Cálculo Luminotécnico-Uma Análise
Comparativa entre O DIALUX e o RELUX. Proceeding of the International Conference on Engineering UBI,
Covilhã, Portugal, 28 November 2011; pp. 28–30.
20. SEAD (Super-efficient Equipment and Appliance Deployment) (2014). Available online: http://
superefficient.org/sltool (accessed on 24 April 2017).
Appl. Sci. 2017, 7, 616 17 of 18

21. iMventaingenrios. Available online: http://www.imventa.com/btwin-baja-tensi%C3%B3n (accessed on


24 April 2017).
22. Blakeslee, T.; Bryll, E. Integrating Light Meter with Movable Meter Mechanism. U.S. Patent No. 3,709,615,
9 January 1973.
23. Ekrias, M.; Eloholma, M.; Halonen, L.; Song, X.J.; Zhang, X.; Wen, Y. Road lighting and headlights: Luminance
measurements and automobile lighting simulations. Build. Environ. 2008, 43, 530–536. [CrossRef]
24. Glenn, J.; Dodds, G.; Robinson, R. Calibration and use of camera-based systems for road lighting assessment.
Light. Res. Technol. 2000, 32, 33–40. [CrossRef]
25. Zatari, A.; Dodds, G.; McMenemy, K.; Robinson, R. Glare, luminance and illuminance measurements of road
lighting using vehicle mounted CCD cameras. LEUKOS J. Illum. Eng. Soc. N. Am. 2005, 1, 85–106. [CrossRef]
26. Manzano, E.R.; Cabello, A.J. Visibilty measurements with CCD in road lighting. J. Ing. Iliminatilui 2000,
59–63.
27. Wüller, D.; Gabele, H. The usage of digital cameras as luminance meters. In Proceedings of the SPIE 6502,
Digital Photography III, 65020U, San José, CA, USA, 28 January 2007. [CrossRef]
28. Sumriddetchkajorn, S.; Somboonkaew, A. Low-Cost Cell phone-based Digital Lux Meter. In Proceedings
of the SPIE 7853, Advanced Sensor system and Applications IV, 78530L, Beijing, China, 18 October 2010.
[CrossRef]
29. Dhondge, K.; Choi, B.Y.; Song, S.; Park, H. Optical Wireless authentication for smart devices using an onboard
ambient light sensor. In Proceedings of the 2014 23rd International Conference Computer Communication
and Networks (ICCCN), Shanghai, China, 4–7 August 2014; IEEE: New York, NY, USA, 2014; pp. 1–8.
30. Spreitzer, R. Pin skimming: Exploiting the ambient-light sensor in mobile devices. In Proceedings of the
4th ACM Workshop on Security and Privacy in Smartphones & Mobile Devices, Scottsdale, AZ, USA,
3–7 November 2014; ACM: New York, NY, USA, 2014; pp. 51–62. [CrossRef]
31. Sans, J.A.; Manjón, F.J.; Pereira, A.L.J.; Gómez-Tejedor, J.A.; Monsoriu, J.A. Oscillations studied with the
smartphone ambient light sensor. Eur. J. Phys. 2013, 34, 1349–1354. [CrossRef]
32. Corcoba Magaña, V.; Muñoz-Organero, M. Artemisa: Using and android device as an eco-driving
assistant. In Proceedings of the IEEE International Conference on Consumer Electronics, Berlin, Germany,
6–8 September 2011; pp. 211–2015. [CrossRef]
33. Preechaburana, P.; Macken, S.; Suska, A.; Filippini, D. Mobile phone analysis of NT-proBNP using high
dynamic range (HDR) imaging. Procedia Eng. 2010, 5, 584–587. [CrossRef]
34. Sumriddetchkajorn, S.; Somboonkaew, A.; Chanhorm, S. Mobile device-based digital microscopy
for education, healthcare, and agriculture. In Proceedings of the ECTI International Conference,
Prajuabkeerekun, Thailand, 12–28 May 2012. [CrossRef]
35. Sumriddetchkajorna, S.; Chaitavonb, K.; Intaravanneba, Y. Mobile-platform based colorimeter for monitoring
chlorineconcentration in water. Sens. Actuators B Chem. 2014, 191, 561–566. [CrossRef]
36. Zhu, H.; Mavandadi, S.; Coskun, A.F.; Yaglidere, O.; Ozcan, A. Optofluidic fluorescent imaging cytometry
on a cell phone. Anal. Chem. 2011, 83, 6641–6647. [CrossRef] [PubMed]
37. Gonzales, R.C.; Woods, R.E.; Eddins, S.L. Digital Image Processing Using MATLAB; Pearson Prentice Hall:
New Jersey, NJ, USA, 2014.
38. Negar, N.; Williams, D.; Schwartz, J.; Ahamed, S.I.; Smith, R.O. Smartphone-based Light Intensity Calculation
Application for Accessibility Measurement. In Proceedings of the RESNA Annual Conference, Indianapolis,
IN, USA, 11–15 June 2014.
39. Extrasensory Devices. Luxi for All. Available online: http://www.esdevices.com/products/luxi (accessed
on 24 April 2018).
40. Kumar, K.; Lu, Y.H. Cloud computing for mobile users: Can offloading computation save energy? Computer
2010, 4, 51–56. [CrossRef]
41. Perrucci, G.P.; Fitzek, F.H.P.; Widmer, J. Survey on energy consumption entities on the smartphone platform.
In Proceedings of the IEEE 73rd Vehicular Technology Conference (VTC Spring), Budapest, Hungary,
15–18 May 2011; pp. 1–6. [CrossRef]
42. Rouving Networks. RN42/RN42N Class 2 Bluethooth Module. Available online: http://ww1.microchip.
com/downloads/en/DeviceDoc/rn-42-ds-v2.32r.pdf (accessed on 25 May 2016).
Appl. Sci. 2017, 7, 616 18 of 18

43. NORPS-12 Silonex. Available online: http://docs-europe.electrocomponents.com/webdocs/0034/


0900766b8003484c.pdf (accessed on 24 April 2017).
44. PCE Instruments. Luxometro PCE-174. (In Spanish). Available online: https://www.pce-instruments.com/
espanol/slot/4/download/91663/hoja-datos-pce-174.pdf (accessed on 24 April 2017).

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access
article distributed under the terms and conditions of the Creative Commons Attribution
(CC BY) license (http://creativecommons.org/licenses/by/4.0/).

You might also like