Comparison between Different Types of Sensors Used in the Real Operational Environment Based on Optical Scanning System

The present paper describes the experimentation in a controlled environment and a real environment using different photosensors, such as infrared light emitting diode (IRLED-as receiver), photodiode, light dependent resistor (LDR), and blue LED for the purpose of selecting those devices, which can be employed in adverse conditions, such as sunlight or artificial sources. The experiments that are described in this paper confirmed that the blue LED and phototransistor could be used as a photosensor of an Optical Scanning System (OSS), because they were less sensitive to sunlight radiation. Moreover, they are appropriate as reference sources that are selected for the experiment (blue LED flashlight and light bulb). The best experimental results that were obtained contained a digital filter that was applied to the output of the photosensor, which reduced the standard deviation for the best case for the phototransistor LED from 100.26 to 0.15. For the best case, using the blue LED, the standard deviation was reduced from 86.08 to 0.11. Using these types of devices the cost of the Optical Scanning System can be reduced and a considerable increase in resolution and accuracy.


Introduction
One of the principal targets of an Optical Scanning System (OSS) is the noise reduction under real-life conditions. There are several possible sources of interference, which may cause problems when the system is exposed to adverse environmental conditions. The main sources of noise are sunlight, electrically or magnetically induced interferences, and electronic components, such as Op-amps that are used in the OSS to measure and amplify small signals, as the 60 Hz power line frequency, which is a source of substantial noise in many photosensors. On the other hand, when photodetectors are used to evaluate the performance and the accuracy of an optical system, it is critical to take into a consideration both the sensor and the light source. It is also important to consider that all commercial photosensors are sensitive to sunlight due to their spectral response of the sun. In practice, however, it is possible to find solutions using filters, such as optical filters, to attenuate the undesired wavelength radiation and analog filters to remove the electrical noise. In addition, to solve these kind of problems, there are methods and sophisticated techniques, such as computational statistics and digital filters, which can be used to reduce the noise from environmental sources. These methods and devices can improve the performance of optical scanning systems. It is important to mention that these methodologies are based on the quality of the data. The authors in [1] reviewed the different aspects of SHM in detail, such as feature extraction and statistical analysis.
The OSS is based on optoelectronic sensors to capture an optical signal from a specific point in space and the main reason is because it is necessary to obtain the shape of an object or to monitor this point under observation. Devices, such as LED, phototransistor, photodiode, and light-dependent resistor (LDR) can be used as a natural filter due to their narrow electromagnetic spectrum, and which are available on the commercial market at low cost. However, choosing these types of sensors depend on the application, for example when the OSS is not influenced by other source of radiation. There are two types of techniques for remote object sensing, which are divided into active and passive methods [2]. Laser scanning systems as an active method for object scanning, which employs its own energy source [3]. The important advantage of using Laser Scanning Systems is that this system can control its own source of radiation and it is also possible to obtain measurements anytime.
Passive methods detect natural energy that is reflected or emitted from the observed object. Also, the OSS can work with an incoherent source light, such as light emitting diode (LED) or coherent light, such as laser. The advantage of this method is that the cost of the overall system is cheaper than the active method when compared to the active method. Another important advantage of the passive method is that it can be used to monitor a structural performance by placing on the structure a source of radiation, such as a light bulb, LED, or Laser. Nowadays, the development of optoelectronic sensors that can be used in adverse conditions, such as sunlight and other sources of radiation, represents a challenge, particularly in the industrial applications of structural health monitoring (SHM), navigation of autonomous mobile robots, remote sensing, and any other application that requires sensing the light from an object. The principle of operation of the passive method is that the object being observed reflects ambient radiation that is emitted by the sun or a nearby source of artificial light [4].
Photodiodes and photoresistors, such as light-dependent resistor (LDR), are an example of photodetectors [5]. The use of optoelectronic devices can provide a natural filter, due that they operate within a specific range of wavelength, this is important to compare each device mentioned before in this paper because under real-life environmental conditions some sensors not working well. Photodiode and phototransistors are widely used as optoelectronic sensors for optical scanning. However, in [6,7] the LED has been used as a photosensor with satisfactory results. The photosensor mentioned before is used as receiver of a light that is reflected from the object and can be found most commonly in scanning systems for three-dimensional (3D) vision-based range scanning tasks.
Paper [8] proposed a novel positioning system for indoor application, which can measure the angular position of a moving optical sensor by using visible light communication, photodiodes, and flickering infrared LEDs. Working under real-life environmental conditions, the accuracy of this can be affected by the interference of the sun, because its spectral response due to the infrared used responds to 940 nm. The infrared LED can be changed by far infrared LED, the accuracy and resolution may be better in spite of adversity of the environmental conditions that are caused by the sunlight. In [9], the photodiode has been used for spatial measurements using optical scanning in a controlled environment. There are other examples where there are applied photosensors, such as photodiodes, for example, OPT301 in [10]. However, when it comes to realizing the experiments in a real environment, the measurements are affecting the accuracy and precision of the OSS [11]. When the devices are near to visible light, it is most difficult to discriminate the signals that are generated by the sunlight and external sources. To solve this kind of issue, the photosensor uses a daylight blocking filter in order to select a specific operating wavelength.
The present paper only deals with passive methods, and the principal elements that are used are photosensors, such as photodiodes, blue and infrared LEDs as photosensors, and light dependent resistors (LDR). The main goal of this paper is discriminating the optical noise that is generated in a real environment caused by the sunlight with devices that are widely available and inexpensive. Another challenge that will be considered in this works belongs to the field of the OSS, that is the electrical noise that appears mainly in digital and analog circuits, and because it is important conditioning the signal before to process it. In [12], were applied the digital filters, such as median filter and moving average filter, for the conditioning of the scattered light signals of the three photodiodes that were employed in that work. In addition, transimpedance amplifier can be used to amplify the signal that is sensed by the photodiode.

Theoretical Fundamentals of the Photosensors
A photosensor converts electromagnetic radiation into a different physical form, usually electrical charge [13], which are then classified into two major categories: photoelectric sensors and thermal sensors [14]. It must be emphasized that the present work is based on photoelectric sensors mainly made of semiconductor materials such as: photodiodes, light emitting diodes (LED) and LDRs. To understand how photoelectric sensors works, it is important to understand the photoelectric effect. According to [15], the observation of the photoelectric effect occurs by incident light on a metal surface, which causes the emission of electrons from this surface. Also, the amount of the emitted electrons and their velocity can be measured. Depending on the color of the light, the electron speed can change, for example, when the color of the light is red, the electron speed is slow when compared with the blue light. Equation (1) shows the relation between the energy gap of material and frequency of the photon.
where h is Planck's constant, v is the frequency of the photon and E g is the energy gap or band gap, known as energy difference between the valence band and the conduction band. By knowing v = c λ , Equation (1) can be represented in term of wavelength λ.
Equation (2) reveals the relationship between the wavelength and the bandgap of the optoelectronic sensor based on semiconductor. For example, the energy gap E g of silicon and germanium is 1.12 eV and 0.66 eV, respectively. Table 1 illustrates the principal parameters of the semiconductors materials that are used as photosensors.

Optical Scanning System
In the optoelectronic and measurements laboratory of the Engineering Institute of Universidad Autónoma de Baja California, a method for the task of SHM by using an OSS has been developed. On the other hand, one of the principal targets to increment accuracy and resolution for this system is reducing the noise that is caused by sunlight and environmental conditions, due to those operational conditions that affect measured signals during data acquisition. In the field of SHM, the OSS plays an important role to measure structural deformation and displacements of buildings to monitor and prevent undesirable damage. Additionally, the OSS has several applications such as 3D & 2D machine vision technologies, medical scanning, and its necessary accuracy and resolution in each activity in order to measure minimal changes to assess structural conditions [16]. The developed OSS consists principally of devices and elements, such as a non-rotating incoherent light emitter that is mounted on the structure, a 45 • -slopping mirror inside of the OSS, a double convex lens, and an optoelectronic sensor as a photodiode, as shown in Figure 1: monitor and prevent undesirable damage. Additionally, the OSS has several applications such as 3D & 2D machine vision technologies, medical scanning, and its necessary accuracy and resolution in each activity in order to measure minimal changes to assess structural conditions [16]. The developed OSS consists principally of devices and elements, such as a non-rotating incoherent light emitter that is mounted on the structure, a 45°-slopping mirror inside of the OSS, a double convex lens, and an optoelectronic sensor as a photodiode, as shown in Figure 1: When two scanning apertures are used, the system can calculate coordinates and distances between the source of light and OSS. Each peak of the Gaussian curve is related to the angle of position of the source, in this way, the angle for the SA #1 and the angle for the second SA #2 are obtained. When considering that the distance between the apertures is known, the coordinates of the object or structure to analyze can be calculated by using theorems of sines and the correlation between the sides in the triangle.
However, in the present work, the different types of optoelectronics sensor were tested in a controlled environment (laboratory) and a real operational environment, in order to compare the accuracy and resolution of the OSS. The environment conditions affect the measurements of the angles of each SA, the principal source of noise and the loss of resolution from the optical scanning system is the excessive bright of sunlight, as previously mentioned. In [9,17], is presented a complete description of the device system principle of operation. According to these works, the OSS generates a Gaussian signal, where the peak of this signal is related to the center of energy. Once knowing the center of energy, the angle is measured, as follows.
The distance of is T2π equal to the time between M1 and M3, expressed in Equation (3).
where T2π and Tα are expressed in samples. With this consideration, the time variable can be eliminated from Equation (4) and  , thereby is calculated as follows. When two scanning apertures are used, the system can calculate coordinates and distances between the source of light and OSS. Each peak of the Gaussian curve is related to the angle of position of the source, in this way, the angle B i for the SA #1 and the angle C i for the second SA #2 are obtained. When considering that the distance a between the apertures is known, the coordinates of the object or structure to analyze can be calculated by using theorems of sines and the correlation between the sides in the triangle.
However, in the present work, the different types of optoelectronics sensor were tested in a controlled environment (laboratory) and a real operational environment, in order to compare the accuracy and resolution of the OSS. The environment conditions affect the measurements of the angles of each SA, the principal source of noise and the loss of resolution from the optical scanning system is the excessive bright of sunlight, as previously mentioned. In [9,17], is presented a complete description of the device system principle of operation. According to these works, the OSS generates a Gaussian signal, where the peak of this signal is related to the center of energy. Once knowing the center of energy, the angle is measured, as follows.
The distance of is T 2π equal to the time between M 1 and M 3 , expressed in Equation (3).
On the other hand, the time T α is equal to the distance between M 1 and M 2 , as expressed by Equation (4).
where T 2π and T α are expressed in samples. With this consideration, the time variable can be eliminated from Equation (4) and α, thereby is calculated as follows.
The procedure for measuring the virtual angle α is shown in Figure 2. For example, in step 1, the number of the rising and falling edge that is generated by the encoder in the variable M 1 and M 3 is recorded. The measurement that is shown in step 2 corresponds to the time of one scanning cycle and the difference between the starting pulses of motor and peak of the Gaussian signal by applying Equations (5) and (6), respectively. Once T 2π and T α are determined, the virtual angle α can be calculated, as shown in step 3 using Equation (7). Depending on the frequency of the DC motor, the virtual angles are stored in a column vector where the length of the vector is 1 × n, and n is equal to the scanning frequency, according to step 4. For example, the scanning frequency of the DC motor is 20 Hz, which means that the dimension of the column vector it will be equal to (1 × 20) T .
The procedure for measuring the virtual angle α is shown in Figure 2. For example, in step 1, the number of the rising and falling edge that is generated by the encoder in the variable M1 and M3 is recorded. The measurement that is shown in step 2 corresponds to the time of one scanning cycle and the difference between the starting pulses of motor and peak of the Gaussian signal by applying Equations (5) and (6), respectively. Once T2π and Tα are determined, the virtual angle α can be calculated, as shown in step 3 using Equation (7). Depending on the frequency of the DC motor, the virtual angles are stored in a column vector where the length of the vector is 1 × n, and n is equal to the scanning frequency, according to step 4. For example, the scanning frequency of the DC motor is 20 Hz, which means that the dimension of the column vector it will be equal to (1 × 20) . The photosensors, such as photodiode, phototransistor, LDR, and Infrared LED was capable to sense the light bulb that is illustrated in Figure 3. The experimental set-up for the optoelectronic sensor evaluation that was used in this paper is presented in Figure 4. The main elements are used with environmental conditions are: a reference The photosensors, such as photodiode, phototransistor, LDR, and Infrared LED was capable to sense the light bulb that is illustrated in Figure 3.
The procedure for measuring the virtual angle α is shown in Figure 2. For example, in step 1, the number of the rising and falling edge that is generated by the encoder in the variable M1 and M3 is recorded. The measurement that is shown in step 2 corresponds to the time of one scanning cycle and the difference between the starting pulses of motor and peak of the Gaussian signal by applying Equations (5) and (6), respectively. Once T2π and Tα are determined, the virtual angle α can be calculated, as shown in step 3 using Equation (7). Depending on the frequency of the DC motor, the virtual angles are stored in a column vector where the length of the vector is 1 × n, and n is equal to the scanning frequency, according to step 4. For example, the scanning frequency of the DC motor is 20 Hz, which means that the dimension of the column vector it will be equal to (1 × 20) . The photosensors, such as photodiode, phototransistor, LDR, and Infrared LED was capable to sense the light bulb that is illustrated in Figure 3. The experimental set-up for the optoelectronic sensor evaluation that was used in this paper is presented in Figure 4. The main elements are used with environmental conditions are: a reference The experimental set-up for the optoelectronic sensor evaluation that was used in this paper is presented in Figure 4. The main elements are used with environmental conditions are: a reference source, OSS, data acquisition (DAQ's system), and a computer to process the signal that was captured. This figure illustrates the OSS system at 90 • with respect to the source of light, in this example, a flashlight is used. However, it used a blue lamp as energy source and a LED as a photosensor with a maximum response at 420 nm wavelength. The reason for choosing a light bulb as energy source for the testing process is due to its wide spectral range to radiate energy to the phototransistor, LED, and photodiode that were used in this work. For example, the best response of the infrared LED and phototransistor is around 940 nm and the spectral response of the used LDR is around 600 nm wavelength. source, OSS, data acquisition (DAQ's system), and a computer to process the signal that was captured. This figure illustrates the OSS system at 90° with respect to the source of light, in this example, a flashlight is used. However, it used a blue lamp as energy source and a LED as a photosensor with a maximum response at 420 nm wavelength. The reason for choosing a light bulb as energy source for the testing process is due to its wide spectral range to radiate energy to the phototransistor, LED, and photodiode that were used in this work. For example, the best response of the infrared LED and phototransistor is around 940 nm and the spectral response of the used LDR is around 600 nm wavelength.

Results
This section describes the experiments that were done in the laboratory and the real operational environment. The data in Tables 2, 4, 6, and 8 are from experiments that are realized only in laboratory, where the samples were taken from the OSS, as following: first, each sample had a duration of 10 s. The parameters and type of input of the DAQ system were sampled using a 50 KHz sampling frequency and two analog input channels were used for data acquisition. The motor frequency of the OSS was 20 Hz. In order to realize the experiment, three configurations were taken, such as changing the position of the reference source.
The first configuration of the experiment was called Position 90°, and the second and third configuration of the experiment were 91° and 92°, respectively. Position 90° means that blue flashlight was situated at 90° with respect to the position of the OSS at a distance of 1 m. Each sample was taken during 10 s in duration, for example in sample 1, the standard deviation σ1 and mean µ 1 were calculated. Also, it should be emphasized that each sample corresponds to the angles calculated by the OSS in a controlled environment. All data in the Tables 2-5 were calculated by developing an algorithm in MatLab and comparing the real angle of the source (90°, 91°, and 92°) with respect of the angle that was detected by the algorithm of SA by returning one column vector each number of sample. The total amount of time for all of the configurations was 300 s, with 100 s corresponding to each configuration. The column vector, called 1, has = 217 elements, if we multiply the number of pulses of the motor (20 pulses/seconds) by the time that was sampled by DAQ (10 s), we note that the number of angles calculated is ℎ = 220, which is not equal to the 217 elements calculated. This is due to the motor frequency was not controlled. Each sample is saved in Equation (6), as following.

Results
This section describes the experiments that were done in the laboratory and the real operational environment. The data in Tables 2, 4, 6, and 8 are from experiments that are realized only in laboratory, where the samples were taken from the OSS, as following: first, each sample had a duration of 10 s. The parameters and type of input of the DAQ system were sampled using a 50 KHz sampling frequency and two analog input channels were used for data acquisition. The motor frequency of the OSS was 20 Hz. In order to realize the experiment, three configurations were taken, such as changing the position of the reference source.
The first configuration of the experiment was called Position 90 • , and the second and third configuration of the experiment were 91 • and 92 • , respectively. Position 90 • means that blue flashlight was situated at 90 • with respect to the position of the OSS at a distance of 1 m. Each sample was taken during 10 s in duration, for example in sample 1, the standard deviation σ 1 and mean µ 1 were calculated. Also, it should be emphasized that each sample corresponds to the angles calculated by the OSS in a controlled environment. All data in the Tables 2-5 were calculated by developing an algorithm in MatLab and comparing the real angle of the source (90 • , 91 • , and 92 • ) with respect of the angle that was detected by the algorithm of SA by returning one column vector each number of sample. The total amount of time for all of the configurations was 300 s, with 100 s corresponding to each configuration. The column vector, called Sample1, has m DAQ = 217 elements, if we multiply the number of pulses of the motor (20 pulses/seconds) by the time that was sampled by DAQ (10 s), we note that the number of angles calculated is m theorical = 220, which is not equal to the 217 elements calculated. This is due to the motor frequency was not controlled. Each sample is saved in Equation (6) Table 2 shows the experiment with blue LED in a controlled environment. For this experiment, the results with blue LED as a sensor can be appreciated, each sample was taken during 10 s and the motor frequency of the OSS was 20 Hz. In position 90 • , the minimum standard deviation that was obtained from the total samples was σ = 0.1 • , which was calculated from a row vector with 200 angles that were captured by the OSS during 10 s sample time. For the position 91 • and 92 • , the minimum standard deviation obtained was 0.08 and 0.13, respectively.
On the other hand, the blue LED was confronted to the adverse conditions caused by the sunlight. The signal captured from the blue LED was smoothed using a Savitzky-Golay filter (SG) [18]. Recalling the purpose of this paper, which is defined by the comparison between different photosensors In Figure 5 the signal generated by the blue LED is illustrated, note that signal in red color is the output of the OSS system without a filter. The signal in green color represents the signal filtered using the SG filter.  Table 2 shows the experiment with blue LED in a controlled environment. For this experiment, the results with blue LED as a sensor can be appreciated, each sample was taken during 10 s and the motor frequency of the OSS was 20 Hz. In position 90°, the minimum standard deviation that was obtained from the total samples was σ = 0.1°, which was calculated from a row vector with 200 angles that were captured by the OSS during 10 s sample time. For the position 91° and 92°, the minimum standard deviation obtained was 0.08 and 0.13, respectively.
On the other hand, the blue LED was confronted to the adverse conditions caused by the sunlight. The signal captured from the blue LED was smoothed using a Savitzky-Golay filter (SG) [18]. Recalling the purpose of this paper, which is defined by the comparison between different photosensors In Figure 5 the signal generated by the blue LED is illustrated, note that signal in red color is the output of the OSS system without a filter. The signal in green color represents the signal filtered using the SG filter.  In Figure 6a, the signal that was displayed by the oscilloscope is presented. Note that, in this case, the flashlight was turned off in order to compare when this is turned on. The voltage peak without flashlight was 1.52 V, while using a flashlight it was turned on the OSS could measure a voltage peak of 5.36 V, see Figure 6b. Table 6 summarizes statistical data from the experiment using a blue LED as a photosensor and In Figure 6a, the signal that was displayed by the oscilloscope is presented. Note that, in this case, the flashlight was turned off in order to compare when this is turned on. The voltage peak without flashlight was 1.52 V, while using a flashlight it was turned on the OSS could measure a voltage peak of 5.36 V, see Figure 6b. Table 6 summarizes statistical data from the experiment using a blue LED as a photosensor and a blue LED flashlight as an energy source. The statistical data were calculated, as follows. First, it was taken a sample with duration of 10 s for each position of the reference source, and then the number of peak sample of the Gaussian signal generated by the blue LED was detected. These numbers of samples were recorded using a column vector. By knowing the number of samples of the rising and falling edge that was provided from the pulses that were generated by the opto-interrupter placed in the motor, these samples are recorded in another column vector. With these column vectors, the angles are calculated, due to the period are known by the numbers of samples when the pulses are measured. Since the full period represents a cycle of 360 • , the next Equation (7), can be used: Sensors 2018, 18, x FOR PEER REVIEW 8 of 15 of peak sample of the Gaussian signal generated by the blue LED was detected. These numbers of samples were recorded using a column vector. By knowing the number of samples of the rising and falling edge that was provided from the pulses that were generated by the opto-interrupter placed in the motor, these samples are recorded in another column vector. With these column vectors, the angles are calculated, due to the period are known by the numbers of samples when the pulses are measured. Since the full period represents a cycle of 360°, the next Equation (7), can be used: It must be noted that the motor frequency was not controlled, for this reason in Table 3 at 90°, 91°, and 92°, the number of samples to calculate the frequency of motor is decreased. According to the data from this table, the difference is less than 0.06°, when considering the average calculated for the angles selected for the experiment such as 90° and 91°, which the results were 89.94°, 91.97° versus the correct angles 90° and 92°. However, the difference between the correct angles 91° and the virtual angle calculated 91.53°, resulting in 0.53°. It is clear that the variance decreases considerably when the signal is filtered in order to smooth the data. For example, for the position 90°, the variance calculated was 8054.03 without filter and 0.02 using a filter.
In Table 4, the results with Infrared LED as a sensor used in laboratory conditions can be appreciated, each sample using a 10 s duration and the motor frequency of the OSS was 20 Hz. Notice that in this experiment, the resolution of the system has decreased in comparison to the experiment with blue LED due to 2.4 V peak of the infrared LED versus 4.8 V peak of the blue LED. In position 90°, the minimum standard deviation that was obtained from the total samples was σ = 0.17°, which was calculated from a row vector with 200 angles that were captured by OSS with a duration of 10 s It must be noted that the motor frequency was not controlled, for this reason in Table 3 at 90 • , 91 • , and 92 • , the number of samples to calculate the frequency of motor is decreased. According to the data from this table, the difference is less than 0.06 • , when considering the average calculated for the angles selected for the experiment such as 90 • and 91 • , which the results were 89.94 • , 91.97 • versus the correct angles 90 • and 92 • . However, the difference between the correct angles 91 • and the virtual angle calculated 91.53 • , resulting in 0.53 • . It is clear that the variance decreases considerably when the signal is filtered in order to smooth the data. For example, for the position 90 • , the variance calculated was 8054.03 without filter and 0.02 using a filter.
In Table 4, the results with Infrared LED as a sensor used in laboratory conditions can be appreciated, each sample using a 10 s duration and the motor frequency of the OSS was 20 Hz. Notice that in this experiment, the resolution of the system has decreased in comparison to the experiment with blue LED due to 2.4 V peak of the infrared LED versus 4.8 V peak of the blue LED. In position 90 • , the minimum standard deviation that was obtained from the total samples was σ = 0.17 • , which was calculated from a row vector with 200 angles that were captured by OSS with a duration of 10 s each sample. For position 91 • and 92 • , the minimum standard deviation that was obtained was 0.14 • and 0.17 • , respectively.  In the following Figure 7, it can be appreciated that the infrared LED was saturated by sunlight, thereby this experiment could not be realized. However, in laboratory conditions, the infrared LED works without problems.  In the following Figure 7, it can be appreciated that the infrared LED was saturated by sunlight, thereby this experiment could not be realized. However, in laboratory conditions, the infrared LED works without problems. Note in Table 5, that the results in term of average and standard deviation were taken using a LDR as a photosensor with sampling time = 10 s and the motor frequency of = 20 Hz. The resolution of the OSS is about 1°, according to the results that are shown in this table. Figure 8 shows the output from the LDR it can be appreciated, that the rising and falling time of this sensor is different. However, the results that were obtained with this photosensor can be considered in order  Table 5, that the results in term of average and standard deviation were taken using a LDR as a photosensor with sampling time T S = 10 s and the motor frequency of f M = 20 Hz. The resolution of the OSS is about 1 • , according to the results that are shown in this table. Figure 8 shows the output from the LDR it can be appreciated, that the rising and falling time of this sensor is different. However, the results that were obtained with this photosensor can be considered in order to develop an application, where the response time is dispensable. In the position 90 • the minimum standard deviation obtained was σ = 0.14 • calculated from a row vector with 200 angles captured by OSS during 10 s each sample. For the position 91 • and 92 • , the minimum standard deviation obtained was 0.20 • and 0.26 • , respectively. The next Figure 8a shows the experimentation that was carried out in a controlled environment, such as laboratory, and the Figure 8b illustrates the output that was generated by LDR with the interference of the sunlight. Note that LDR cannot sense the reference source due to the exposure to the sunlight. Table 6 shows the results of the experiments using a phototransistor as photosensor and a bulb light as reference source, operating in a controlled environment. The results in terms of standard deviation from position 90 • , 91 • , and 92 • are 0.2, 0.14, and 0.32, respectively. On the order hand, the best results for the mean value are 90 • , 91.13 • , and 92.12 • , respectively.

Note in
Once the parameters of standard deviation and mean are established from the experiment that was realized in the laboratory, the next step was to experiment in a place exposure to environmental agents, such temperature and dust, especially with sunlight. Figure 9 illustrates the experiment that was realized in a real operation environment using a phototransistor as photosensors. According to Figure 9a, the OSS is detecting the reflection of the sunlight on the surfaces from the environment. For this case, the bulb light was turned off in order to make it possible to distinguish between the different external sources of light that were caused by the sunlight. Figure 9b shows the signal that was detected by the OSS when the bulb light was turned on. to develop an application, where the response time is dispensable. In the position 90° the minimum standard deviation obtained was σ = 0.14° calculated from a row vector with 200 angles captured by OSS during 10 s each sample. For the position 91° and 92°, the minimum standard deviation obtained was 0.20° and 0.26, respectively. The next Figure 8a shows the experimentation that was carried out in a controlled environment, such as laboratory, and the Figure 8b illustrates the output that was generated by LDR with the interference of the sunlight. Note that LDR cannot sense the reference source due to the exposure to the sunlight. Table 6 shows the results of the experiments using a phototransistor as photosensor and a bulb light as reference source, operating in a controlled environment. The results in terms of standard deviation from position 90°, 91°, and 92° are 0.2, 0.14, and 0.32, respectively. On the order hand, the best results for the mean value are 90°, 91.13°, and 92.12°, respectively.
Once the parameters of standard deviation and mean are established from the experiment that was realized in the laboratory, the next step was to experiment in a place exposure to environmental agents, such temperature and dust, especially with sunlight. Figure 9 illustrates the experiment that was realized in a real operation environment using a phototransistor as photosensors. According to Figure 9a, the OSS is detecting the reflection of the sunlight on the surfaces from the environment. For this case, the bulb light was turned off in order to make it possible to distinguish between the different external sources of light that were caused by the sunlight. Figure 9b shows the signal that was detected by the OSS when the bulb light was turned on.
(a) (b) Figure 8. Signal captured by using a LDR as photosensor of the OSS, in (a), the output was taken from a controlled environment such as laboratory. In the (b), is illustrated the output that was generated in adverse conditions.  Signal captured by using a LDR as photosensor of the OSS, in (a), the output was taken from a controlled environment such as laboratory. In the (b), is illustrated the output that was generated in adverse conditions.    After the signal was detected by inspection, as mentioned before, the signal was acquired using a DAQ with 50 kHz sampling rate and a DC motor with angular frequency of 20 Hz. The reference source was placed at 90°, 91°, and 92° with respect to the OSS. Figure 10 reveals that the Gaussian signal that was generated by the phototransistor was clipped off at 5 V, due to the gain of this photosensor exceeds the power supply. After the signal was detected by inspection, as mentioned before, the signal was acquired using a DAQ with 50 kHz sampling rate and a DC motor with angular frequency of 20 Hz. The reference source was placed at 90 • , 91 • , and 92 • with respect to the OSS. Figure 10 reveals that the Gaussian signal that was generated by the phototransistor was clipped off at 5 V, due to the gain of this photosensor exceeds the power supply.  Table 7 shows the statistical data that were calculated from phototransistor and provides an estimation of when the angles between the OSS and light of source have been calculated. There are two columns for each angle, where the first column contains data processed without a filter, and the second column contains data smoothed using the Savitzky-Golay filter. The difference is considerable when the signal is filtered. For example, at the angle 90°, the system calculated an angle of 189.13°. However, the real angle is 90°, resulting a difference of −99.13°, on the other hand, the difference is reduced to 0.39° when the signal is smoothed by the digital filter. As it can be seen from Figure 11, it was not possible to detect the signal in the real operational environment generated reference source (bulb light) by using the photodiode OPT301 as a photosensor, due to the interference with sunlight. Figure 11 illustrates the experiment that was realized in sunlight and the output from OPT301 that was displayed by the oscilloscope. Figure 11a shows the OSS, the source of light (light bulb), and Figure 11b illustrates the signal that was displayed by the oscilloscope. It must be noted that the output in yellow color is caused by reflections of the sunlight. The results from the photodiode OPT301 in laboratory are shown in Table 8.  Table 7 shows the statistical data that were calculated from phototransistor and provides an estimation of when the angles between the OSS and light of source have been calculated. There are two columns for each angle, where the first column contains data processed without a filter, and the second column contains data smoothed using the Savitzky-Golay filter. The difference is considerable when the signal is filtered. For example, at the angle 90 • , the system calculated an angle of 189.13 • . However, the real angle is 90 • , resulting a difference of −99.13 • , on the other hand, the difference is reduced to 0.39 • when the signal is smoothed by the digital filter. As it can be seen from Figure 11, it was not possible to detect the signal in the real operational environment generated reference source (bulb light) by using the photodiode OPT301 as a photosensor, due to the interference with sunlight. Figure 11 illustrates the experiment that was realized in sunlight and the output from OPT301 that was displayed by the oscilloscope. Figure 11a shows the OSS, the source of light (light bulb), and Figure 11b illustrates the signal that was displayed by the oscilloscope. It must be noted that the output in yellow color is caused by reflections of the sunlight. The results from the photodiode OPT301 in laboratory are shown in Table 8.

Conclusions
The comparison between different types of photosensors has been presented in order to select a photosensor, which can be employed in a hostile environment where naturals and external light sources are presented. The photosensors that can detect the reference light source exposed to sunlight conditions, are visualized in the Table 9. The results with the phototransistor and LED show that it is possible to discriminate the reflection of the sunlight with the support of digital filters, such as FIR filters. Under sunlight conditions, using the blue LED gives satisfactory results, including a standard deviation of 0.16 and an average of 89.94 at 90° versus a standard deviation of 0.138 and an average of 89.83° for the same angle of reference. The results from the blue LED as a sensor and phototransistor that was obtained from both the laboratory and outdoors can be considered to be applied by OSS with adverse conditions. It is important to mention that the error in angle measurements for the blue LED in sunlight conditions were better (0.06°) than the experiments that were carried out under laboratory conditions (0.17°). The reason for this difference is due to the signal sensed in the adverse environment had to be smoothed by digital filter.
All of the photosensors were placed at a distance of 1 m with respect to the light source. However, in the case of the gain of the phototransistor at this distance, the output was clipped off because the voltage gain of this photosensor exceeded the power supply. According to the datasheet, the peak response wavelength is at 940 nm, while considering that the literature part of this region is blocked by atmospheric water vapor that is centered at this wavelength. Furthermore, the phototransistor contains a daylight blocking filter in order to reduce the sunlight radiation. The use of the blue LED in environmental conditions resulted that this device can attenuate the radiation that

Conclusions
The comparison between different types of photosensors has been presented in order to select a photosensor, which can be employed in a hostile environment where naturals and external light sources are presented. The photosensors that can detect the reference light source exposed to sunlight conditions, are visualized in the Table 9. The results with the phototransistor and LED show that it is possible to discriminate the reflection of the sunlight with the support of digital filters, such as FIR filters. Under sunlight conditions, using the blue LED gives satisfactory results, including a standard deviation of 0.16 and an average of 89.94 at 90 • versus a standard deviation of 0.138 and an average of 89.83 • for the same angle of reference. The results from the blue LED as a sensor and phototransistor that was obtained from both the laboratory and outdoors can be considered to be applied by OSS with adverse conditions. It is important to mention that the error in angle measurements for the blue LED in sunlight conditions were better (0.06 • ) than the experiments that were carried out under laboratory conditions (0.17 • ). The reason for this difference is due to the signal sensed in the adverse environment had to be smoothed by digital filter.
All of the photosensors were placed at a distance of 1 m with respect to the light source. However, in the case of the gain of the phototransistor at this distance, the output was clipped off because the voltage gain of this photosensor exceeded the power supply. According to the datasheet, the peak response wavelength is at 940 nm, while considering that the literature part of this region is blocked by atmospheric water vapor that is centered at this wavelength. Furthermore, the phototransistor contains a daylight blocking filter in order to reduce the sunlight radiation. The use of the blue LED in environmental conditions resulted that this device can attenuate the radiation that is generated by the sunlight at 2 V, and can detect our reference of source that was used in the experiments. It is important to mention that gain of the blue LED and phototransistor was clipped off at 5.2 V because of the power supply limitation. It is clear, that it is possible to avoid the saturation of the op amp by incrementing the distance between the OSS and the source of light. However, it was not done for reasons of standardization of the experiments. Table 9. Experiment in a laboratory with bulb source light and photodiode OP301 used as photosensor. On the other hand, the devices, such as OPT301, LDR, and infrared LED, cannot detect the reference of source, because the sunlight saturated the sensor according to their spectral responsivity, see Table 9. The best response of the photodiode OPT301 is the over spectral range (700 nm to 800 nm) according to a datasheet in the infrared region. In the region of visible light, the OPT301 has high responsivity at 650 nm 0.47 A/W. However, it cannot detect the light bulb because of interference with sunlight. This device can be limited to work in real-life environmental conditions, but we can get satisfactory results in a controlled environment, such as a laboratory. When the LDR was used and infrared for the experiment out of the laboratory the results were null.

Laboratory
The perspective to work is controlling the angular velocity of motor due to the OSS accuracy and resolution depends on the stability of the measurement speed. Additionally, one of the main goals is to implement and develop a system that is based on microcontroller by employing digital filters that can be used for various practical applications, such as large engineering structures SHM, mobile robot navigation, remote sensing, etc.
Author Contributions: Wendy Flores-Fuentes established the method in this paper in order to find the energy center; Jesús Elías Miranda-Vega wrote the paper and realized the experiments; Moisés Rivas-López analyzed the data; Oleg Sergiyenko designed the experiments with other types of photosensors; Julio C. Rodríguez-Quiñonez proposed the experimental set-up for the evaluation of the optical scanning system; Lars Lindner revised the final version of the paper.