ALS-DPDIC17-78C-L749/TR8 数据手册
APPLICATION NOTES
Ambient Light Sensor
Digital ambient light sensor ALS-DPDIC17-78C/L749/TR8
application note
Introduction
Ambient light sensor (ALS) can sense light source similar to the human eye. ALS
application product on, off or automatically are determined by light source information to
reach the goal of power saving and safety.
Analog ALS has poor accuracy cause by adjust load resistance to set threshold value.
Digital ALS is more accurate cause by read and write to registers through the I2C interface
control by the Microcontroller Unit (MCU). Everlight′s ALS-DPDIC17-78C/L749/TR8 has two
sets of photodiode (PD) sensing elements with different spectrums in the package. Different
light sources can be distinguished by the sensing different frequency spectrums, so higher
accuracy can be achieved.
Optical window design
Regardless of whether the ALS is used indoors or outdoors, the ambient light is usually
irradiated from above or diagonally above. Therefore, it is recommended that the direction of
the window is upward first, followed by forward, and try to let the ambient light directly reach
the ALS. Generally speaking, a higher amount of light can get higher accuracy and speed up
the measurement speed, but it should be noted that if too strong light (such as noon
sunlight) is directly exposed, it may cause ALS saturation. Some have the window facing down
for beautiful design, and use reflection to detect ambient light. However, this method will
cause by reflectivity of the reflector to decrease ALS accuracy.
1
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
Figure 1 is the recommended facing upwards window design.
Figure 1. Window size determination (upward)
Based on the consideration of the amount of light entering.
θ1 is recommended to be greater than 35° and D1 is recommended to be less than
2.6mm.
Recommend window size formula:DLENS= tanθ1 x D1 x 2 + Package Width.
Assuming D1= 1mm, θ1= 35°, then DLENS= tan35° x 1mm x 2 + 2.0 = 3.4mm.
Increasing the window size or shortening the distance of D1 can increase the amount of
light entering to make ALS more accurate.
If the window is facing forward, the ambient light is irradiated from diagonally above
(Figure 2). With the same window size, let θ1 greater than θ2.
Figure 2. Window size determination (forward)
2
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
Generally ID design does not want users to see ALS directly, so a translucent cover lens is
usually added above ALS. The higher transmittance of the Lens is better, but not lower than
30%.
Illuminance conversion method
Electromagnetic waves of different wavelengths are all around us. According to the
wavelength from short to long, it can be divided into ultraviolet (UV), visible light and infrared
(IR). The illuminance defines the electromagnetic spectrum visible to humans with
wavelength of 380~770nm. ALS mainly measures the intensity of electromagnetic waves in
this band.
Figure 3. Spectral wavelength classification
In visible light band, human eyes is most sensitive to green light (555nm) in a bright
environment. Assuming that the luminous flux required for other visible light wavelengths to
produce the same bright sensation as 555nm light is X(λ), the ratio of 555nm luminous flux to
other X(λ) can describe as visual sensitivity function. The definition of illuminance refers to the
viewing function, because different light sources have different radiation intensities at
different wavelengths, and the coating of ALS cannot be exactly to the visual sensitivity
function, so the value obtained by ALS cannot convert into illuminance (Lux).
ALS-DPDIC17-78C/L749/TR8 has two types of PDs with different coatings inside, as
shown in Figure 4. Two PDs will have different responses to light of different spectra, and
different light sources can be distinguished by this feature. According to the corresponding
conversion formulas given by different light sources, the above-mentioned problem that light
sources with different spectrums under the same illuminance can get different converted
illuminance values can be solved.
3
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
Figure 4. ALS-DPDIC17-78C/L749/TR8 PDs and human eye spectral response
The process of converting the value read by ALS-DPDIC17-78C/L749/TR8 into
illuminance is as follows:
1. Prepare standard parts (illuminance meter) and different light sources (white light LED,
incandescent lamp and standard light source D65...etc.)
2. The first light source illuminates ALS and illuminance meter, records reading value Ev
of the illuminance meter, adjusts the settings of the register ALS_GAIN (0x04) and
ALS_TIME (0x05), while recording ALS CH0 (0x1C, 0x1D) and CH1 (0x1E) , 0x1F). When
adjusting, consider maximum ambient illuminance and design the processing when
the output of the ALS is saturated.
3. Consider the ratio of CH0/CH1 as R(1).
4. Calculation coefficient K(1) = Ev/CH0.
5. The illuminance of this light source Lux = CH0 * K(1)
6. Change to different light source and repeat steps 1~5 to get different ratio R(n) and
coefficient K(n).
7. Match the corresponding light source with the ratio R(n) and coefficient K(n) can get
the Lux conversion formula for different light sources.
4
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
When calculating the coefficient K(n), it is recommended to make the K value less than
2. If the K value is too large, you can go back to step 2 to adjust the settings of register
ALS_GAIN (0x04) and ALS_TIME (0x05).
Table 1 is ALS bare test data (without cover lens), refer to this table can get the following
formula.
If CH0/CH1 = 0.66, Lux = CH0/GAIN_value x 64/(ALS_TIME+1) x 1.58
Note: There will be some slight differences in the coating and process of each ALS, so
converted Lux will also have some different. Therefore, if required higher accuracy, will need
to calibrate and modify the formula.
Table 1. ALS actual bare test data (without cover lens)
5
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
Process of converting ALS-DPDIC17-78C/L749/TR8 readings into illuminance shown in
Figure 5.
Figure 5. ALS-DPDIC17-78C/L749/TR8 reading value conversion illuminance flow chart
6
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
Register description and firmware flow chart
ALS-DPDIC17-78C/L749/TR8 I2C address is 0x38, and initialization steps are as follows:
1.
After system is stable, check the values of the register 0xBC and 0xBD are 0x14 and
0x16, judge whether I2C is operating normally.
2.
Set bit7 of register 0x02 INT_POR = 0, this bit will be set to 1 after power-on, voltage
drop or ALS is reset, confirm whether this bit is 0 before each subsequent reading. If is
1 means ALS is reset to the default value and ALS must be re-initialized.
3.
Set register 0x00 bit 0 EN_ALS=1 to enable ALS.
4.
Set initial setting of 0x04 ALS_GAIN and 0x05 ALS_TIME.
5.
After ALS_TIME + WTIME ms, check whether INT_POR is 0. If is 0 then read 0x1C~0x1F
to calculate the Lux value.
ALS_TIME (register 0x05) is the ADC conversion time of ALS. The larger register value,
the longer integration time and the higher output resolution. The maximum value is
0xFF, but as long as it is set to 0x3F, can get maximum output resolution (16 bits
0~65535). Unless need to measure very low brightness or ID design causes less light
entering, can set ALS_TIME more than 0x3F. The larger the value, the longer
measurement time of ALS. Please refer to specification for more detail.
Enable wait time function need to set register 0x00 bit 6 (EN_WAIT) to 1. This
function puts the IC into a power saving mode during non-detection time, thereby
reducing average power consumption.
ALS internal amplifier gain is adjust by ALS_GAIN (register 0x04), generally set to
0x00, unless light entering is weak then set to 0x01. The greater the value, the greater
output value under the same light source. This setting will not increase the
measurement time of ALS.
ALS-DPDIC17-78C/L749/TR8 also has an interrupt function. If necessary, please refer
to the specification for more detail.
If the application of ALS only take few switching points and directly change the
brightness (or other actions). It is recommended to add a debounce function to
avoid jitter (flicker) when the light source falls near the switching point.
7
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com
APPLICATION NOTES
Ambient Light Sensor
The firmware flow chart of ALS-DPDIC17-78C/L749/TR8 as shown in Figure 6.
Figure 6. Firmware flow chart
The information in this application manual is only for customers' design
reference. Please verify when actually use it. If have any other questions,
please contact Everlight for further technical support.
8
Copyright © 2016, Everlight All Rights Reserved. Release Date :
April 12 , 2021. Rev.1.0
www.everlight.com