# Smartphones as a Light Measurement Tool: Case of Study
## 5 Results and Hypothesis Validation
### Mobile Camera  
The second methodology used to measure the illuminance through the mobile devices is based on the use of the digital camera. As it does happen in previous sections, in order to perform an accurate measurement, the digital camera has to be calibrated first before using it for measuring luminance. This time, to calibrate the measurements obtained, it is necessary to take into account not only the differences in hardware between devices but also the camera settings that have to be fixed for all of the measurements. These values are: ISO, which is the level of sensitivity of the camera to available light; Shutter Speed, which is the length of time a camera shutter is open to expose light into the camera sensor; and Aperture, which is a hole within a lens, through which light travels into the camera body. For this reason, the measurements carried out in the experiment keep the same camera characteristics fixed throughout the experiments. In this way, it was possible to compare the obtained results. To check the accuracy of this method, another Android application was developed to obtain the luminance level directly with the digital camera. This application was executed in a first step in a Sony Xperia M2 smartphone and a Luxi device was used as a filter to guarantee that the luminance is measured as close as possible to the camera. To perform the picture capture in the same conditions, the application fixed the camera settings. Before that, the camera captures the picture, the application developed evaluates it pixel by pixel in order to obtain the RGB values and transforms these values to grey scale through Equation (1), which performs the sum of Red, Green and Blue components. 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  
Figure 8: Sony Xperia M2’s Ambient light sensor vs. BQ Aquaris X5’s Ambient light sensor vs. luxmeter accuracy. defines which digital output value relates to which luminance input signal. After the calibration of the measures was performed, the absolute error of the measurements became 12.63% (Figure 9). However, if we evaluate the accuracy of the data in more detail, it is possible again to divide the data into three different groups. Dividing the measurements in these groups and recalculating the calibration factor of each one separately, the accuracy of the measurements can be increased. The three groups studied are the following:  
1. The first group of values englobes measurements up to 100 lux. If we analyze the accuracy of this portion of data, it is too low, with an absolute error of 46.43%. However, if we perform the calibration limited to these values, it is possible to see how the error decreases to 20.35%. 2. The second group of values englobes measurements from 100 to 500 lux. With an absolute error of 5.35%, performing again the calibration of the system to these values, it is possible to decrease the error to 4.21%. 3. The last group englobes measurements higher than 500 lux. Without a high amount of error regarding the percentage (10.70%), the problem observed is that error increases if the value measured is higher. For this reason, this section has been analyzed separately, obtaining an absolute error of 2.17%. As a result, after this new calibration method, the accuracy of the light sensor, compared with a referenced luxmeter, increased, having an absolute error of 6.35% (Figure 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.  
Figure 9: Digital camera vs. luxmeter accuracy.