A similar version of this article appeared in the May 27, 2011 issue of Digi-Key's TechZone
In the ever-connected world of today, most portable devices sport a display that allows users to access and consume video and Internet content. The concerns of power consumption and viewing comfort have led many of these devices to include ambient light sensors—in an effort to make the device aware of its surroundings. In dim environments the display backlight can be dialed back to save battery power, and in bright environments the enhanced use of fonts and backgrounds can improve use by making the device more readable. This note discusses a few application considerations to keep in mind when designing products with ambient light sensors.
Spectral Sensitivity of Light Measurements
First, consider the human eye's view of ambient light. Our eyes' sensitivity to light is generally described by the photopic curve, also called the CIE curve (Figure 1
). It shows that the human eye is blind to wavelengths in the ultraviolet (< 400nm) and infrared (> 700nm) portions of the spectrum. It also indicates that the eye is most sensitive to green light (~555nm), and is less sensitive to the blue and red wavelengths. We therefore use a normalized version of this sensitivity curve to convert an incident optical-power density (specified in µW/cm²) to sensitivity units for the human eye (specified in lux). At 555nm, one lux is equivalent to approximately 0.15µW/cm² of optical power intensity.
Figure 1. The photopic curve shows the eye's response to different wavelengths of light. Green light generates a maximum response in the eye, but the eye cannot see light in the infrared (> 700nm) or ultraviolet (< 400nm) portions of the spectrum.
The challenges posed by manufacturing and technology make it difficult for a practical, low-cost ambient light sensor (ALS) to replicate this spectrum exactly. It is also difficult to reject IR and UV radiation absolutely and completely. As a consequence of the wide spectral content in common light sources, even a slight deviation from the photopic curve, combined with incomplete IR and UV rejection, can have a substantial effect on the accuracy of brightness measurements by ambient light sensors.
In fact, many commercially available lux meters have a tough time matching the photopic curve exactly. As a result, most lux meters come specified with a parameter called 1'
which is commonly used to represent how well a lux meter matches the photopic CIE curve. Inexperienced users should also keep in mind another problem when handling commercial lux meters—many meters claim to be calibrated to standards traceable to the National Institute of Standards and Technology (NIST). In reality, however, this claim only asserts that the lux meter gives the correct reading when tested with an incandescent (Type A) light source. No guarantee is made for the accuracy of lux measurements of nonincandescent light sources, such as fluorescent lighting, sunlight, or LEDs—even though such sources are more common. Indeed, the world is moving towards the prohibition of incandescent light sources in everyday life, because they have low energy efficiency.
As a result, modern ambient light sensors attempt to live with an incomplete match to the photopic CIE curve, and instead use the principle of superposition to calculate the ambient light brightness. Most light sensors on the market today use two or more different types of photodiodes, each sensitive to a different portion of the light spectrum. By combining these photodiode outputs mathematically, each with a suitably adjusted gain, the sensor can be made to output a fairly accurate measurement of ambient brightness for the light sources commonly available.
If, for example, two photodiode types PD1 and PD2 give different readings for two incident light sources, you can derive a gain constant for each photodiode such that the sensor provides an accurate lux reading for both light sources:
LightSource1 = Gain1 × PD1 + Gain2 × PD2
LightSource2 = Gain1 × PD1 + Gain2 × PD2
The greater the number of photodiode types, the greater the number of light sources that can be matched closely.
The spectra of light sources found in everyday life differ greatly (Figure 2
). Of the light sources commonly encountered in home and office, fluorescent and incandescent lights are considered to be the extremes?one with very little infrared content, and the other with lots of infrared content. Data sheets for most ambient light sensors, therefore, show a response comparing these two common light sources (Figure 3
Figure 2. These plots compare the light spectra of sunlight (upper left), halogen/incandescent lamps (upper right), fluorescent lamps (lower left), and white LEDs (lower right).
Figure 3. Data sheets for most ambient light sensors include a graph of typical light sensitivity vs. the meter reading in lux. This one shows the response of a MAX44009 ambient-light sensor.
Dynamic Range of Light Measurements
The human eye is sensitive to a wide range of light conditions. When light-adjusted to a dark environment (it can take a few minutes to become attuned to this condition), the eye can detect brightness levels down to 10-4
lux. At the other end of the scale, the eye has some darkness perception even in environments as bright as 108
The typical brightness of environments encountered by people in real life is usually far narrower, ranging from 0.1 lux outdoors at night, to 300 lux for office lighting, to 100,000 lux in bright sunlight. Most portable devices require an accurate detection of ambient-light intensity only from 5 lux up to about 1000 lux. Portable-display backlights cannot really compete with the power of the sun, and for light environments below a certain level, the display is simply maintained at a minimum brightness.
Note that the human eye's perception of brightness is logarithmic (similar to the ear's sensitivity to sound). A lux level must increase almost 10 times before the eye perceives it to be twice as bright. A similar transfer function then relates the ideal percentage of display backlight brightness to relative ambient lux, as shown in the linear and logarithmic graphs of Figure 4
Figure 4a. This linear graph demonstrates backlight strength vs. the relative lux delivered. The black line is the ideal logarithmic curve, and the blue line is a piece-wise linear approximation more suitable for implementation with microcontroller code.
Figure 4b. These curves present the linear data of Figure 4a using a logarithmic scale for relative lux. The black line is the ideal logarithmic curve, and the blue line is a piece-wise linear approximation more suitable for implementation with microcontroller code.
As a result, fine resolution is required for low-light measurements, and large resolution is sufficient for high lux measurements. Probably the simplest method for implementing this scheme is to use high-resolution converters with front-end programmable gain, which allows one to balance the requirements of large dynamic range at the high end with high sensitivity at the low-end measurements.
The MAX44009 differs from other digital light sensors by its inclusion of an on-chip auto-ranging scheme. This scheme allows the IC to make 22-bit dynamic range measurements automatically, improving the code efficiency without need for the microcontroller to reconfigure registers. Further, these measurements are compressed and represented in a 12-bit format?in effect providing a pseudo-logarithmic step size for light measurements. As an example, the MAX44009 uses a 4-bit exponent and 8-bit mantissa to represent the 22-bit dynamic range, providing a 0.045 lux/count resolution at low light levels, and a higher count size at higher levels of ambient light.
Effect of Black Glass
The look and feel of modern electronic devices—their Industrial Design—is now as important as the features and functionality they provide. Customers have come to regard modern portable devices as representing "who they are." Ambient light sensors, for instance, are important to the devices, but it is now mandatory that these sensors be hidden from sight so as not to distract the user from the look and the feel of the product.
For glass panels, this "cover-up" is usually accomplished by applying a layer of thin black ink (that absorbs nearly all incident light) to the sensor opening. The small amount of light that gets through the ink then reaches the light sensor, enabling ambient-light measurements while allowing the panel to retain a sleek and unbroken black border (Figure 5
Figure 5. A typical tablet design shows the use of a black border panel around the LCD display. The presence of an ambient light sensor is hidden from the view of the user.
Unfortunately, this black ink has important implications for the proper functioning of light sensors. It not only attenuates the amount of light reaching the sensor, but also changes the spectrum of that light. First, consider the light-attenuation problem. Most black ink allows only 2% to 10% of visible light to get through, so five lux of external light can become only 0.1 lux at the sensor! The light sensor therefore needs high sensitivity. Secondly, the change of spectrum is such that while only 2% to 10% of visible light gets through the ink, it passes nearly all incident infrared radiation through to the sensor (Figure 6
Figure 6. This typical spectral profile characterizes the black ink found in commercial electronic devices today, showing the percent of transmission vs. wavelength of incident light.
Nonuniform spectral-transmission profiles impose the additional requirement that most modern light sensors be recalibrated to obtain accurate readings of the ambient lux when placed under black ink. Any factory settings chosen for accurate light measurements without the black ink will therefore need readjusting. For that reason, the MAX44007
ambient light sensors allow access to the multiple internal photodiodes. This flexibility lets the user tailor and recalibrate the sensor response for most applications. Sensitivities are 0.025 lux/LSB for the MAX44007.
Use of Interrupt Pin in Light Sensors
Most applications do not require real-time changes in the display-backlight strength, whose purpose would be to prevent a response to spurious noises such as passing shadows. Contrastingly, a quick response to consistent changes in the ambient light allows the user to remain fully engaged with the device, without the distraction of having to adjust the display brightness for readability. Note also that continuous polling of a light sensor (to check whether the ambient levels have changed) and the implementation of noise rejection in firmware represents a burden to the application's software resources. It slows the response to user commands, and raises the power consumption due to an increase in microcontroller processing.
Modern light sensors therefore come equipped with a powerful feature?the interrupt pin. The sensor continuously compares ambient-light readings against internal programmable window thresholds, and generates an interrupt when light levels exceed those thresholds?thereby alerting the host microcontroller that light conditions have indeed changed. A persist timer is used before an interrupt is actually flagged to the host to eliminate false triggers due to spurious, short-duration fluctuations in the ambient light.
The use of an interrupt pin allows the sensor to be smart, and ask for host intervention only when action is needed. Processing resources of the host microcontroller can then be dedicated to other tasks, or the microcontroller can extend battery life by remaining in a low-power wait state. A typical application circuit (Figure 7
) demonstrates the use of an interrupt pin. Note that the open-drain connection to this pin allows a wire-OR connection to multiple devices and sources.
Figure 7. This typical application circuit for an ambient light sensor on a multidrop I²C bus shows the connection of interrupt pin to host microcontroller.
This article outlines some application considerations commonly encountered when designing in a light sensor for modern portable devices. When established early in the development, a close engagement and partnership with the IC supplier can ensure a flexible and reliable system.