Black glass presents a particular challenge for ambient light sensors since it changes the spectrum of ambient light that falls on the ambient light sensor. In particular, black glass enhances the infra-red content of the light spectrum, to which the human eye is blind. This application note explains how a calibration/compensation scheme corrects a light sensor's lux readings in the presence of different light sources. The article shows how to use Advanced Modes in the MAX44007 light sensor to adjust its response to visible and IR channels. Using the MAX44007's register map, you can optimize sensor performance under black glass.
The MAX44007 ambient light sensor provides advanced modes of operation designed to optimize sensor performance under black glass.
Today most smartphones, tablets, notebooks, and TVs have a black glass framing the LCD screen. This frame gives a sleek and professional look to the end-product. Traditionally, a clear circular window or slot was visible on the glass where the ambient light sensor was located. In recent designs, however, the window or slot for the light sensor is covered with a nearly opaque black ink to help that area blend with the color of the surrounding black housing. The manufacturers' reasoning is straightforward: darker the ink, the less distracting, more professional, and sleeker the look!
Unfortunately, the use of black ink over the ambient light sensor complicates its operation in two important ways. First, the black ink attenuates ambient light, thereby reducing the amount received by the sensor. Second, that ink also modifies the spectrum of the light that does get through. The spectral characteristics of the ink allow almost all the incident infrared light to be transmitted, while the visible light is attenuated to 3% to 5% of its original strength. As a result the infrared content is greatly amplified in the ambient light. The transmission of the light, infrared or ambient, is further complicated because the exact chemistry of the black ink can vary with suppliers.
Calibrating and Compensating for Black Glass
It is difficult to precisely match the human eye's CIE curve. For this reason most high-performance ambient light sensors (e.g., the MAX44009) include a calibration/compensation scheme to correct its lux readings in the presence of different light sources. This correction is accomplished by mixing two types of on-chip photodiodes so that their combined effect provides an accurate light reading regardless of the type of light source. With the significant change in light spectrum falling on the sensor under a black glass, these calibration parameters need to be adjusted further.
It is important to note that the light source does affect the amount of calibration correction that will be required for a sensor under black glass. The adjustment is especially important when the light sources are naturally high in infrared content, such as sunlight and incandescent light. Less adjustment will be needed for light from white LEDs (WLEDs) and fluorescent light.
The MAX44007 incorporates Advanced Modes that can be used to adjust its response to visible and IR channels.
Register Map for Optimizing Sensor Performance Under Glass
The following is the register map of MAX44007. You will also find this map in the device data sheet.
|REGISTER||BIT||REGISTER ADDRESS||POWER-ON RESET STATE||R/W|
|LUX high byte||E3||E2||E1||E0||M7||M6||M5||M4||0x03||0x00||R|
|LUX low byte||M3||M2||M1||M0||0x04||0x00||R|
|Upper Threshold—High Byte||UE3||UE2||UE1||UE0||UM7||UM6||UM5||UM4||0x05||0xFF||R/W|
|Lower Threshold—High Byte||LE3||LE2||LE1||LE0||LM7||LM6||LM5||LM4||0x06||0x00||R/W|
|ADVANCED MODE REGISTERS|
|Visible Gain Register||0xB||0x00||R/SW|
|IR Gain Register||0xC||0x00||R/SW|
|Trim Enable Register||1||ADV||0xD||0x80||R/W|
One-Time Presetup, Typically at Power-Up
Follow this procedure to perform a one-time presetup, typically at power-up.
- Read the content of each of four register addresses: 0x09–0x0C.
- Store as variables: Adv1, Adv2, VisibleGain, and IRGain, respectively.
- Store 1s complement of these variables into new variables: Adv1C, Adv2C, VisibleGainC, and IRGainC, respectively. For example, IRGainC = !IRGain;
- If IRGain = 1010 0110, IRGainC = 0101 1001.
- Write 1000 0001 to register 0x0D to enter Advanced Mode (i.e., set ADV=1).
- Write Adv1C, Adv2C, VisibleGainC, and IRGainC back to registers 0x09–0x0C, respectively.
- As an example, 0101 1001 is written to register 0x0C, although originally it had 1010 0110.
- Note: subsequent reads to register 0x0C (after the above write statement) would still read back 0101 1001 because of the internal automatic bit flipping carried out by the IC before storage into these advanced registers.
- Retain the value of IRGainC, in particular, for future use.
- Set a suitable delay for the Threshold Timer register, register 0x07 if necessary.
- Set INTE = 1 (register 0x01) to enable interrupt.
Enter Normal Mode Of Operation
Follow this procedure to enter Normal measurement mode.
- Read registers 0x03 and 0x04 to get a 12-bit lux reading.
- Store value as ComboLux.
- Write 0000 0000 to register 0x0C to enter Temporary measurement mode.
- Wait for at least 1.6s (2x 800ms).
- Contact Maxim to shorten this time, if necessary.
- Read registers 0x03 and 0x04 to get a 12-bit lux reading.
- Store value as ApproxLux.
- Write IRGainC to register 0x0C to exit Temporary measurement mode.
- Calculate: ActualLux = ApproxLux - IRFactor × (ApproxLux - ComboLux)
- ActualLux is the true ambient light lux reading.
- ApproxLux = ComboLux for fluorescent and WLED light, approximately.
- ApproxLux > ComboLux for Incandescent light and sunlight, typically
- For help calculating a suitable IRFactor, contact Maxim's applications team with your glass sample. The data can be generated directly from lab tests.
- Set the appropriate backlight strength based on the ActualLux calculated above.
- Set the appropriate Upper Lux Threshold (register 0x05) and Lower Lux Threshold (register 0x06) using ComboLux as reference (since this is normal operating mode for the part).
- Dummy Read the INTS bit (register 0x00) to clear any interrupts if previously set.
- Wait for a hardware interrupt.
- This is where the program spends much of its time.
- On hardware interrupt, read register 0x00 to confirm that INTS=1.
- If INTS=1, go to step 7 above.
- Otherwise, if INTS=0, return to Step 16 after checking other sources of hardware interrupt.