# Smartphones as a Light Measurement Tool: Case of Study
## 5 Results and Hypothesis Validation
### Mobile Ambient Light Sensor  
The first methodology is based on the ambient light sensor consisting of capturing the amount of light directly from the smartphone's ambient light sensor. To check the accuracy of this sensor, a simple application in Android OS was developed to obtain the level of light registered directly by it. This application was executed in a first step in an LG Nexus 5 smartphone to obtain the information. When we compared the measured data of the smartphone with the information obtained to the referenced luxmeter (Figure 5), we obtained an absolute error of 39.08%. As can be appreciated, the accuracy of this value is not high, but it is possible to appreciate  
Figure 4: Alcalux sensor board. 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. To ensure the calibration's accuracy, we use all of the measured points to have a good sample of data with different lux levels, which were used in order to find the calibration factor of the device. The calibration defines which digital output value relates to which luminance input signal. This relationship between scene luminance and digital output levels of a digital image's capture system is called optoelectronic conversion function (OECF) [10]. This kind of calibration is important to adjust the model developed to the characteristics of the devices. Once the calibrated factor is obtained, to achieve the real measured data, it is necessary to multiply the measured value to this factor, as shows Equation (2):  
\[\text{Luxreal}=\text{Luxmeasure}\times\text{Ccal}. \tag{2}\]  
After calibrating the measures performed with the calibration factor, the absolute error has been reduced to 13.74%, and, as can be appreciated in Figure 6, the values are closer to the reference data. Figure 5: Ambient light sensor vs. luxmeter accuracy. Figure 6: Ambient light sensor vs. calibrated ambient light sensor vs. luxmeter accuracy. However, if we analyze the accuracy of the data in depth, it is possible to sort out three different groups. If we divide the measurements in these groups and recalculate calibration factor of each one separately, the accuracy of the sensor can be increased. The three groups of data are the following:  
1. The first group of values englobes measurements up to 100 lux. If we analyze the accuracy of this data independently of the global evaluation, it is possible to see how the accuracy of the data is too low with an absolute error of 61.77%. However, if we analyze these data separately from the rest of measurements, performing the calibration of these values, it is possible to see how the error decreases to 27.01%. 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 data in this section is higher, with an absolute error of 8.20%. However, performing again the 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 measurements not being high regarding the percentage (4.75%), the problem observed is that the higher the value measured, the higher the difference between real and calibrated values. For this reason, this section has been analyzed separately again to reduce the percentage of error as much 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 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 with this new calibration.