# Smartphones as a Light Measurement Tool: Case of Study
## 4 Analysis of Sensors in Mobile Devices
### External Sensor Device  
The use of lighting information can be useful for multiple applications. For example, with this information, it is possible to check lighting efficiency or lighting regulation's accomplishment. Due to the possibilities of communication that smartphones offer, the use of external devices that can interact with our applications is possible. For this reason, an analysis of the use of external device as measurement tool was conducted, which can be used with the smartphone in real time. To perform this evaluation, an external device, called 'Alcalux', a luxmeter developed by the University of Alcala, has been made. To choose the best option of communication, and taking into account that the battery life is the most important factor for mobile users [40], the different possibilities of data transmission and the energy consumption of each one has been studied. On that aspect, the best option is Bluetooth because of its low power consumption compared with other wireless communication systems, such as Wi-Fi,  
Figure 1: Flow chart of mobile application to obtain luminance through the digital camera. Figure 2: Device used as a light diffusor. as is shown in the study carried out by [PERSON] et al. [41]. Another important aspect to take into account is that Bluetooth is embedded in nearly all smartphones. In order to enable Bluetooth in the external device, an embedded module (RN-42 from Roving networks, Los Gatos, CA, USA [42]) was chosen because of its simplicity and relative low power consumption (about 30 mA during the transmission, 3 mA when it is connected and 26 mA in sleep mode). The data transmission process simulates a pipe of messages where the Bluetooth module receives data from the UART (Universal Asynchronous Receiver-Transmitter) of the microcontroller and transmits the information through the wireless connection. Despite the present study only covering illuminance measurement, the created device is able to control other factors such as presence or temperature. It is also possible to set the frequency of data registration and to store the data in EEPROM (Electrically Erasable Programmable Read-Only Memory) memory. To avoid storing excessive information in the memory, a device has been developed with the possibility of configuring the automated measures to be taken in a time range between 2 and 65,524 s.  
To develop this measurement device, different prototypes were built to improve the final result to achieve the objectives of the project. The prototypes developed are:  
1. The first prototype to be built was focused on measuring the illuminance. To do it, an LDR (Light-Dependent Resistor) was used as a light sensor, which sends the information to a PIC (Programmable Interrupt Controller) microcontroller, which is responsible for sending the information to the computer through a serial cable. In this case, the LDR used was the NORPS-12 model of Silonex (Montreal, Canada) [43], which is composed of a CdS photocell with a spectral response similar to the human eye. 2. The second prototype developed has incorporated improvements regarding new sensors such as movement or temperature, apart from the use of the Bluetooth connection. Figure 3 shows this second prototype. 3. The third prototype developed was the final device. The main difference regarding the previous prototype is the incorporation of a printed circuit board that electrically connects the electronic components using conductive tracks, pads and other features etched on copper sheets. This characteristic gives the final device a professional appearance compared to the previous prototypes. Furthermore, the light sensor was encapsulated with a plastic cylinder with an aperture at the top to reduce up to 500 times the sensibility of the lighting sensor, incrementing the accuracy for a normal range of measurement intended for the device. The final  
Figure 3: Alcalux device—second prototype.