19-5997; Rev 0; 5/12 EVALUATION KIT AVAILABLE MAX44004 Digital Ambient Light Sensor General Description The MAX44004 is a wide dynamic range, lowpower ambient light sensor (ALS) ideal for many light sensing applications: tablets, displays, accessories, medical devices, and light management systems. The on-chip ambient sensor has the power to measure the exact visible light from 0.03 lux to 65,000 lux and communicate through an I2C digital communication bus. The IC has patented sensors, filters, and circuitry to mimic the human eye response. With on-chip calibration registers, it performs the same in different light conditions (i.e., fluorescent, incandescent). The interrupt pin minimizes the need of constant polling of the device, freeing up microcontroller resources for efficient communication and thus reducing overall power consumption. The part-to-part matching is optimized by proprietary Maxim process to speed up end-product development time. The IC can operate from a VDD of 1.7V to 3.6V, including both supply and I2C times. It consumes just 5µA operating current. Applications Tablets and Netbooks Benefits and Features SConsumes Low Power 5µA Supply Current Interrupt Pin Delivers Efficient Communication SHigh Sensitivity 0.03 Lux Sensitivity SEasy to Design 1.7V to 3.6V Supply Voltage Tight Part-to-Part Variation SReliable Light Sensing Perfect Rejection of 50Hz/60Hz Noise Adjustable Visible and Infrared Sensor Gain STiny, 2mm x 2mm x 0.6mm OTDFN Package S-40°C to +105°C Temperature Range Ordering Information appears at end of data sheet. For related parts and recommended products to use with this part, refer to www.maxim-ic.com/MAX44004.related. Displays, TVs, Projectors Digital Lighting Management Medical Devices Industrial Automation Typical Application Circuit VDD VDD ALS PGA VIS + IR (ALS) I2C MAX44004 ALS PGA IR (ALS) GND SDA 14-BIT SCL MICROCONTROLLER INT 14-BIT A0 GND 1 For pricing, delivery, and ordering information, please contact Maxim Direct at 1-888-629-4642, or visit Maxim’s website at www.maxim-ic.com. MAX44004 Digital Ambient Light Sensor ABSOLUTE MAXIMUM RATINGS All Pins to GND.....................................................-0.3V to +4.0V Output Short-Circuit Current Duration........................Continuous Continuous Input Current into Any Terminal……............. Q20mA Continuous Power Dissipation OTDFN (derate 11.9mW/NC above +70NC)..................953mW Operating Temperature Range......................... -40NC to +105NC Soldering Temperature (reflow).......................................+260NC Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. These are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. ELECTRICAL CHARACTERISTICS (VDD = 1.8V, TA = -40NC to +105NC, TA = +25NC, unless otherwise noted.) (Note 1) PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS AMBIENT LIGHT RECEIVER CHARACTERISTICS Maximum Ambient Light Sensitivity Fluorescent light (Note 2) Ambient Light Saturation Level 0.03 Lux/ LSB 65,535 Lux Gain Error Green LED 538nm response, TA = +25NC (Note 2) Light Source Matching Fluorescent/incandescent light 10 % Infrared Transmittance 850nm vs. 538nm, TA = +25NC 363nm vs. 538nm, TA = +25NC 0.5 % Ultraviolet Transmittance Dark Current Level ADC Conversion Time 15 2 % 0 Count 100ms conversion time, 0 lux, TA = +25NC 14-bit resolution, has 50Hz/60Hz rejection 100 12-bit resolution 25 10-bit resolution 6.25 8-bit resolution 1.56 ms 0.7 TA = +25NC ADC Conversion Time Accuracy % 6 TA = -40NC to +105NC % POWER SUPPLY Power-Supply Voltage Quiescent Current Software Shutdown Current Power-Up Time VDD 1.7 Is ISHDN tON TA = +25NC 3.6 V 5 10 FA 0.1 0.3 0.6 TA = -40NC to +105NC 100 FA ms 2 MAX44004 Digital Ambient Light Sensor ELECTRICAL CHARACTERISTICS (continued) (VDD = 1.8V, TA = -40NC to +105NC, TA = +25NC, unless otherwise noted.) (Note 1) PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS ISINK = 6mA 0.06 0.4 V TA = +25NC 0.01 1000 nA 0.01 1000 nA 0.4 V DIGITAL CHARACTERISTICS—SDA, SCL, INT, A0 Output Low Voltage SDA, INT VOL INT Leakage Current SDA, SCL, A0 Input Current I2C Input Low Voltage VIL_I2C SDA, SCL I2C Input High Voltage VIH_I2C SDA, SCL I2C Input Low Voltage VIL_I2C A0 I2C Input High Voltage VIH_I2C A0 Input Capacitance 1.6 V 0.3 VDD - 0.3 SDA, SCL V V 3 pF I2C TIMING CHARACTERISTICS Serial Clock Frequency fSCL Bus Free Time Between STOP and START tBUF 1.3 Fs Hold Time (Repeated) START Condition tHD,STA 0.6 Fs Low Period of the SCL Clock tLOW 1.3 Fs High Period of the SCL Clock 400 kHz tHIGH 0.6 Fs Setup Time for a Repeated START tSU.STA 0.6 Fs Data Hold Time tHD,DAT Data Setup Time tSU,DAT 100 SDA Transmitting Fall Time Setup Time for STOP Condition Pulse Width of Suppressed Spike tf 0 ISINK P 6mA; tR and tF between 0.3 x VDD and 0.7 x VDD 0.9 ns 100 tSU,STO 0.6 tSP 0 Fs ns Fs 50 ns Note 1: The device is 100% production tested at TA = +25NC. Temperature limits are guaranteed by design. Note 2: Guaranteed by design, green 538nm LED chosen for production so that the IC responds to 100 lux fluorescent light with 100 lux. 3 MAX44004 Digital Ambient Light Sensor Typical Operating Characteristics (VDD = 1.8V, TA = -40NC to +85NC, unless otherwise noted. All devices are 100% production tested at TA = +25NC. Temperature limits are guaranteed by design.) 1200 1000 INCANDESCENT 800 600 400 20 90 200 0 WAVE LENGTH (nm) 50 40 30 20 -90 -70 -50 -30 -10 10 30 50 70 90 -80 -60 -40 -20 0 20 40 60 80 LUMINOSITY ANGLE (°) OUTPUT ERROR vs. TEMPERATURE 11 MAX44004 toc04 9 TA = +85°C 8 DARKROOM CONDITION VDD = 1.7 V TO 3.6V 10 9 TA = +105°C COUNTS (UNITS) 8 6 5 ROTATED WITH AXIS BETWEEN PIN 1/2/3 AND 4/5/6 10 REFERENCE METER READING (LUX) 10 TA = +25°C TA = -40°C 3 7 6 5 4 3 2 2 1 1 DARKROOM CONDITION 0 0 -40 1.7 1.9 2.1 2.3 2.5 2.7 2.9 3.1 3.3 3.5 3.7 -15 10 35 60 85 SUPPLY VOLTAGE (V) TEMPERATURE (°C) SUPPLY CURRENT vs. LUX OUTPUT LOW VOLTAGE vs. SINK CURRENT 25 20 15 10 5 180 160 OUTPUT LOW VOLTAGE (V) MAX44004 toc06 30 110 MAX44004 toc07 SUPPLY CURRENT (µA) 60 0 100 200 300 400 500 600 700 800 900 1000 SUPPLY CURRENT vs. SUPPLY VOLTAGE vs. TEMPERATURE 4 70 0 0 270 370 470 570 670 770 870 970 1070 7 80 MAX44004 toc05 ADC COUNT 40 FLUORESCENT 100 MAX44004 toc03 1400 60 MAX44004 toc02 ALSTIM[1:0] = 00 ALSPGA[1:0] = 10 1600 80 SUPPLY CURRENT (µA) NORMALIZED OUTPUT MAX44004 toc01 GREEN CHANNEL RED CHANNEL CIE CURVE 100 RADIATION PATTERN LIGHT SENSITIVITY vs. LUX LEVEL 1800 RELATIVE SENSITIVITY (% FROM 0°) SPECTRUM RESPONSE 120 THE DATA WAS TAKEN ON THE INTERRUPT PIN 140 120 100 80 60 40 20 0 0 1 10 100 1k LUX 10k 100k 5 10 15 20 SINK CURRENT (mA) 4 MAX44004 Digital Ambient Light Sensor Pin Configuration TOP VIEW + VDD 1 GND 2 A0 3 MAX44004 EP 6 SDA 5 SCL 4 INT Pin Description PIN NAME 1 VDD Power Supply FUNCTION 2 GND Ground 3 A0 Address Select 4 INT Active-Low Interrupt 5 SCL I2C Clock 6 SDA I2C Data — EP Exposed Pad. EP is internally connected to GND. EP must be connected to GND. 5 MAX44004 Digital Ambient Light Sensor Detailed Description The MAX44004 is a wide-dynamic-range ALS. The die is placed inside an optically transparent (ODFN) package. A photodiode array inside the device converts the light to a current, which is then processed by low-power circuitry into a digital value stream. The data is then stored in an output register that is read by an I2C interface. difficulties in trying to reproduce the ideal photopic curve in a small cost-efficient package. The devices instead use two types of photodiodes (green and infrared) that have different spectral sensitivities—each of which is amplified and subtracted on-chip with suitable gain coefficients so that the most extreme light sources (fluorescent and incandescent) are well matched to a commercial illuminance lux meter. Two types of photodiodes are used in the device: a green photodiode and an infrared photodiode. Ambient light sensing is accomplished by subtracting the green ALS photodiode signal and the infrared ALS photodiode signals, after applying appropriate gains. The photopic curve represents a typical human eye’s sensitivity to different wavelengths of light. As can be seen in Figures 1 and 2, its peak sensitivity is at 555nm (green). The human eye is insensitive to infrared (> 700nm) and ultraviolet (< 400nm) radiation. The photodiodes are connected to two ADCs. The user can choose to view either just the green ALS signal, or just the infrared ALS signal, or the difference of the green and infrared ALS photodiodes. Variation between light sources can extend beyond the visible spectral range—fluorescent and incandescent light sources, for example—with similar visible brightness (lux) and can have substantially different IR radiation content (since the human eye is blind to it). Since this infrared radiation can be picked up by silicon photodiodes, differences in light spectra can affect brightness measurement of light sensors. For example, light sources with high IR content such as an incandescent bulb or sunlight could suggest a much brighter environment than our eyes would perceive them to be. Other light sources, such as fluorescent and LED-based systems, have very little infrared content. The devices incorporate on-chip compensation techniques to minimize these effects and still output an accurate lux response in a variety of lighting conditions. Two key features of the device’s analog design are its low-power design and interrupt pin operation. The device can operate from a VDD of 1.7V to 3.6V and consumes just 5FA current. An on-chip programmable interrupt function eliminates the need to continually poll the device for data, resulting in a significant power saving. Ambient-Light Sensing On-chip, user-programmable green channel and IR channel gain trim registers allow the light-sensor response to be tailored to the application, such as when the light sensor is placed under a dark or colored glass. 120 120 100 100 80 60 STANDARD ALS (GREEN-RED) BLUE: IDEAL PHOTOPIC CURVE 40 20 NORMALIZED OUTPUT NORMALIZED RESPONSE Ambient-light sensors are designed to detect brightness in the same way as human eyes do. To achieve this, the light sensor needs to have a spectral sensitivity that is identical to the photopic curve of the human eye (Figure 1). Small deviations from the photopic curve can affect perceived brightness by ambient light sensors to be wildly different. However, there are practical 80 GREEN CHANNEL RED CHANNEL IDEAL PHOTOPIC CURVE 60 40 20 0 270 370 470 570 670 770 870 970 1070 WAVELENGTH (nm) Figure 1. MAX44004 Spectral Response Compared to Ideal Photopic Curve 0 270 370 470 570 670 770 870 970 1070 WAVELENGTH (nm) Figure 2. Green Channel and IR Channel Response at Identical Gains on a Typical MAX44004 6 MAX44004 Digital Ambient Light Sensor Register Description be valid anymore. The ALSINTS bit in the Status register 0x00 indicates that an ambient-light-interrupt condition has occurred. If any of these bits are set to 1, the INT pin is pulled low and is asserted. See Table 2. Table 1 is the register description. The individual register bits are explained in Table 2. Default power-up bit states are highlighted in bold. Reading the Interrupt Status register clears the PWRON and ALSINTS bits if set, AND deasserts the INT pin (i.e., INT is pulled high by the off-chip pullup resistor). The ALSINTS bit is disabled and set to 0 if the ALSINTE interrupt enable bit in Register 0x01 is set to 0. Interrupt Status 0x00 The PWRON bit in the Status register 0x00, if set, indicates that a power-on-reset (POR) condition has occurred, and any user-programmed thresholds may not Table 1. Component List REGISTER BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 POWERON RESET R/W STATE BIT0 REGISTER ADDRESS ALSINTS 0x00 0x04 R ALSINTE 0x01 0x24 R/W 0x02 0x00 R/W 0x04 0x00 R 0x05 0x00 R 0x06 0x00 R/W 0x07 0x00 R/W 0x08 0x00 R/W 0x09 0x00 R/W 0x0A 0x00 R/W 0x0F 0x80 R/TW 0x10 0x80 R/TW STATUS Interrupt Status PWRON CONFIGURATION Main Configuration TRIM MODE[1:0] Receiver Configuration ALSTIM[1:0] ALSPGA[1:0] ADC DATA ADC High Byte—ALS OFL ALSDATA[13:8] ADC Low Byte—ALS ALSDATA[7:0] THRESHOLD SET ALS Upper Threshold—High Byte UPTHR [13:8] ALS Upper Threshold—Low Byte UPTHR[7:0] ALS Lower Threshold—High Byte LOTHR[13:8] ALS Lower Threshold—Low Byte LOTHR [7:0] Threshold Persist Timer ALSPST[1:0] Digital Gain Trim of Green Channel TRIM_GAIN_IR [0] TRIM _GAIN_GREEN [6:0] Digital Gain Trim of Infrared Channel TRIM _GAIN_IR [8:1] Table 2. Interrupt Status REGISTER Interrupt Status BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 PWRON BIT1 BIT0 REGISTER ADDRESS POWERON RESET STATE R/W ALSINTS 0x00 0x04 R 7 MAX44004 Digital Ambient Light Sensor Ambient Interrupt Status (ALSINTS) Main Configuration 0x01 The individual ALSINTS register bits are explained in Table 3. The individual Main Configuration register bits are explained in Table 5. Power-On Reset Status (PWRON) This register is used to set the operating mode of the IC and to enable interrupt operation of the device. The individual Power-On Reset Status (PWRON) register bits are explained in Table 4. TRIM The individual TRIM register bits are explained in Table 6. The individual register bits are explained in Table 7. Table 3. Ambient Interrupt Status (ALSINTS) BIT0 OPERATION 0 No interrupt trigger event has occurred. 1 The ambient light intensity has traversed outside the designated window limits defined by the Threshold registers for greater than persist timer count ALSPST[1:0], or an overflow condition in the ambient-light readings has occurred. This bit also causes the INT pin to be pulled low. Once set, the only way to clear this bit is to read this register or to set the ALSINTE bit in register 0x01 to 0. Table 4. Power-On Reset Status (PWRON) BIT2 OPERATION 0 No interrupt trigger event has occurred. 1 The part went through a power-up event, either because the part was turned on, or because there was a power-supply voltage glitch. All interrupt threshold settings in the registers have been reset to a default state, and should be examined. A 1 on this bit also causes the INT pin to be pulled low. Once this bit is set, the only way to clear this bit is to read this register. Table 5. Main Configuration (0x01) REGISTER BIT7 Main Configuration BIT6 BIT5 TRIM BIT4 BIT3 BIT2 BIT1 MODE[1:0] BIT0 REGISTER ADDRESS POWERON RESET STATE R/W ALSINTE 0x01 0x24 R/W Table 6. TRIM BIT 5 OPERATION 0 Use bytes written to TRIM_GAIN_GREEN[6:0] and TRIM_GAIN_IR[8:0] registers to set the fine-trim gain of the green and IR gain channels. 1 Use factory-programmed gains for green and IR channels. Ignore bytes written to TRIM_GAIN_GREEN[6:0] and TRIM_GAIN_IR[8:0] registers. 8 MAX44004 Digital Ambient Light Sensor Ambient Interrupt Enable (ALSINTE) Receive Configuration 0x02 ADC conversions of MSB are made first (the device needs longer conversion times for higher resolution measurements, i.e., LSBs). Use of lower PGA gains helps expand the full-scale range of the ADC at the expense of per-LSB sensitivity. This register sets the ADC integration time and front-end photodiode circuitry sensitivity (gain). The ADC integration time also controls the bit resolution of measurements. The 2 bits ALSTIM [1:0] set the integration time for ALS ADC conversion, as shown in Table 10. The individual Ambient Interrupt Enable bits are explained in Table 8. Table 9 explains Receive Configuration 0x02. Ambient ADC Conversion Time (ALSTIM) Table 7. Individual Register Bits MODE[1:0] OPERATING MODE 00 Shutdown Analog circuits are shut down, but digital register retains values. OPERATION 01 ALS G-IR Standard ALS mode—stores difference between green and infrared channel readings. 10 ALS G ALS green channel only. 11 ALS IR Infrared channel only. Note: 100–111 are reserved. Do not use. Table 8. Ambient Interrupt Enable BIT0 OPERATION 0 The ALSINTS bit remains unasserted; ALS channel readings are not compared with interrupt thresholds. 1 Detection of an ambient-light interrupt event triggers a hardware interrupt (INT pin is pulled low) and sets the ALSINTS bit (register 0x00, B0). ALS channel readings are compared with ALS interrupt threshold settings and ALS persist timer. Table 9. Receive Configuration (0x02) REGISTER BIT7 BIT6 BIT5 Receive Configuration BIT4 BIT3 BIT2 ALSTIM[1:0] BIT1 BIT0 REGISTER ADDRESS POWERON RESET STATE R/W 0x02 0x00 R/W ALSINTE Table 10. ALSTIM Integration Time for ADC Conversions ALSTIM[1:0] INTEGRATION TIME (ms) FULL-SCALE ADC COUNTS BIT RESOLUTION RELATIVE LSB SIZE 00 100 16,384 14 1x 01 25 4096 12 4x 10 6.25 1024 10 16x 11 1.5625 256 8 64x 9 MAX44004 Digital Ambient Light Sensor set to 1 (enabled), then the ALSINTS bit is set to 1 and the INT pin is pulled low. Ambient Light Measurement Gain (ALSPGA) The data in this register could be either the green channel, infrared channel, or ALS readings (green channel, infrared channel readings), depending on the mode selected by the user. The 2 bits ALSPGA [1:0] set the gain of the ambient-light sensing measurement according to Table 11. ALS Data Register (0x04, 0x05) The 2 bytes here (ALSDATA[13:0]) hold the results of ALS signal conversion. The resolution and bit length of the result is controlled by the value of the ALSTIM[1:0] and ALSPGA[1:0] bits. The result is always right justified in the two registers, and the unused high bits are zero. See Table 12. Internal update of these two registers is disabled during I2C read operations to ensure proper data handoff between the ADC and the I2C registers. Update of the I2C registers is resumed once the master sends a STOP command. Therefore, when reading the 2 bytes of this register, the master should NOT send a STOP command between the 2-byte reads. Instead, a Repeated START command should be used. The exact read sequence using the Repeated START command is shown in the I2C Serial Interface section. OFL indicates an overflow condition on the ALS channel. If this occurs, set the ALS range (ALSPGA[1:0]) to a higher range (lower sensitivity). If the OFL bit is set to 1 (there is an overflow condition), and the ALSINTE bit is Table 11. Ambient Light Measurement Gain (ALSPGA) ALSPGA[1:0] LUX/LSB RELATIVE LSB SIZE 00 0.03125 1x 01 0.125 4x 10 0.5 16x 11 4 128x Table 12. ALS Data Register (0x04, 0x05) REGISTER BIT7 ADC High Byte—ALS BIT6 BIT5 BIT4 OFL BIT3 BIT2 BIT1 BIT0 ALSDATA[13:8] ADC Low Byte—ALS ALSDATA[7:0] REGISTER ADDRESS POWERON RESET STATE R/W 0x04 0x00 R 0x05 0x00 R REGISTER ADDRESS POWERON RESET STATE R/W 0x06 0x00 R/W 0x07 0x00 R/W 0x08 0x00 R/W 0x09 0x00 R/W Table 13. ALS Interrupt Threshold Registers (0x06–0x09) REGISTER ALS Upper Threshold— High Byte ALS Upper Threshold— Low Byte ALS Lower Threshold— High Byte ALS Lower Threshold— Low Byte BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 UPTHR [13:8] UPTHR [7:0] LOTHR[13:8] LOTHR [7:0] BIT1 BIT0 10 MAX44004 Digital Ambient Light Sensor ALS Interrupt Threshold Registers (0x06-0x09) This feature is useful in reducing false or nuisance interrupts due to optical noise/minor disturbances. See Table 15. ALS Interrupt Threshold registers (0x06-0x09) are explained in Table 13. When ALSPST[1:0] is set to 00, and the ALSINTE bit is set to 1, the first time an ALS interrupt event is detected, the ALSINTE interrupt bit is set and the INT pin goes low. If ALSPST[1:0] is set to 01, then four consecutive interrupt events must be detected on four consecutive measurement cycles. Similarly, if ALSPST[1:0] is set to 10 or 11, then 8 or 16 consecutive interrupts must be detected before the INT pin is pulled low. If there is an intervening measurement cycle where no interrupt is detected, then the count is reset to zero. The ALS upper threshold and ALS lower threshold (UPTHR[13:0] and LOTHR[13:0]) set the window limits that are used to trigger an ALS interrupt. It is important to set these values according to the selected bit resolution/integration time chosen for the ALS measurement based on the ALSTIM[1:0] and ALSPGA[1:0] settings. The upper 2 bits are always ignored. If the INTE bit is set, and the lux level is greater or lower than the respective thresholds for a period greater than that defined by the ALSPST persist time, the INTS bit in the Status register are set and the INT pin is pulled low. Digital Gain Trim Registers (0x0F, 0x10) Digital gain trim registers are described in Table 16. TRIM_GAIN_GREEN [6:0] is used to modify the gain of the green channel. Threshold Persist Timer Register (0x0A) The MAX44004 incorporates a persist function that allows users to set the number of consecutive triggers before interrupt. The Threshold Persist Timer register is explained in Table 14. TRIM_GAIN_IR [8:0] is used to modify the gain of the IR channel. To tell the part to use the values written to this register, set the TRIMB bit to 0 in the Main Configuration register after writing new values to these registers. ALSPST[1:0] sets one of four persist values that controls how readily the interrupt logic reacts to a detected event. Table 14. Threshold Persist Timer Register (0x0A) REGISTER BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 Threshold Persist Timer BIT0 ALSPST[1:0] REGISTER ADDRESS POWERON RESET STATE R/W 0x0A 0x00 R/W Table 15. APSPT [1:0] ALSPST[1:0] NO. OF CONSECUTIVE TRIGGERS BEFORE AN INTERRUPT 00 1 01 2 10 4 11 16 Table 16. Digital Gain Trim Registers (0x0F, 0x10) REGISTER Digital Gain Trim of Green Channel Digital Gain Trim of Infrared Channel BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0 REGISTER ADDRESS POWERON RESET STATE R/W TRIM _GAIN_GREEN [6:0] TRIM_GAIN_IR 0x0F 0x80 R/TW 0x10 0x80 R/TW TRIM _GAIN_IR [8:1] Note 1: Values read from the Trim_Gain registers are the complement of the written value. This is true for reading both the factoryprogrammed values and the customer-programmed values. 11 MAX44004 Digital Ambient Light Sensor Applications Information Ambient-Sensing Applications Typical applications involve placing the device behind a glass with a small semitransparent window above it. Use the photodiode-sensitive area as shown in Figure 3 to properly position the window above the part. The part comes equipped with internal gain trim registers for the green and IR ALS photodiodes. By suitably choosing the gains for these channels, accurate ambient light readings can be generated in all lighting conditions regardless of the type of glass/ink under which the part is used. This is especially useful for black glass applications where, for cosmetic reasons, the part is placed behind a black film to hide its presence, and this film has the peculiar property of attenuating most ambient light, but passing through IR radiation. In standard ALS mode, the green channel and infrared channel readings are internally subtracted. Since one is observing only the difference is observed in two separate ADC measurements, wrong readings can be obtained if one of the channels becomes saturated, while the other channel continues to rise. Since the green photodiode also picks up a lot of the infrared signal, this saturation can occur earlier than before the maximum expected 2mm full-scale lux, depending on lighting conditions. For example, under incandescent light, there is a lot more infrared optical power than in the visible spectral range. In these situations, the green channel can saturate much earlier than 511 lux in the most sensitive range. To assist the user in detecting these conditions, an OFL bit is provided that alerts the user of an overrange condition. This bit also triggers an ALS interrupt if it has been enabled. Typical Operating Sequence The typical operating sequence for the master to communicate to the device on first power-up is shown below: 1)Setup: a)Read the Interrupt Status register (0x00) to confirm only the PWRON bit is set. This also clears a hardware interrupt. b)Set Threshold and Persist Timer registers (registers 0x06–0x0C). c)Write 0x00 to the Receiver Configuration register (register 0x02) to set the ALS sensor in the highest gain setting, and in 14-bit modes of operation. d)Write 0x05 to the Main Configuration register (register 0x01) to set the part in ALS mode and to enable ALS interrupt. e)Set new green channel gains and IR channel gains, if necessary, to customize ALS operation for application conditions. Ensure the TRIM bit is set to 0 when not using default factory-trim settings. 2) Wait for interrupt. VCC 1 MAX44004 6 SDA TOP VIEW 1.226mm 0.753mm GND 2 0.39mm A0 3 5 SCL 2mm PHOTODIODE 4 INT 3) On interrupt: a) Read the Interrupt Status register (0x00) to confirm the device to be the source of interrupt, and to check for type of interrupt. This should clear the hardware interrupt on the part, if set. b)If an ALS interrupt has occurred, read ALS ADC registers (register 0x04–0x05) to confirm if data is valid (i.e., OFL = 0), and take appropriate action (e.g., set new backlight strength). Set new ALS thresholds, if necessary. c)Return to Step 2. 0.492mm Figure 3. MAX44004 Photodiode Location 12 MAX44004 Digital Ambient Light Sensor I2C Serial Interface The device features an I2C/SMBusK-compatible, 2-wire serial interface consisting of a serial data line (SDA) and a serial clock line (SCL). SDA and SCL facilitate communication between the device and the master at clock rates up to 400kHz. Figure 4 shows the 2-wire interface timing diagram. The master generates SCL and initiates data transfer on the bus. A master device writes data to the device by transmitting the proper slave address followed by the register address and then the data word. Each transmit sequence is framed by a START (S) or Repeated START (Sr) condition and a STOP (P) condition. Each word transmitted to the device is 8 bits long and is followed by an acknowledge clock pulse. A master reading data from the device transmits the proper slave address followed by a series of nine SCL pulses. The IC transmits data on SDA in sync with the master-generated SCL pulses. The master acknowledges receipt of each byte of data. Each read sequence is framed by a START or Repeated START condition, a not acknowledge, and a STOP condition. SDA operates as both an input and an open-drain output. A pullup resistor, typically greater than 500I, is required on the SDA bus. SCL operates as only an input. A pullup resistor, typically greater than 500I, is required on SCL if there are multiple masters on the bus, or if the master in a single-master system has an opendrain SCL output. Series resistors in line with SDA and SCL are optional. Series resistors protect the digital inputs of the device from high-voltage spikes on the bus lines, and minimize crosstalk and undershoot of the bus signal. Bit Transfer One data bit is transferred during each SCL cycle. The data on SDA must remain stable during the high period of the SCL pulse. Changes in SDA while SCL is high are control signals. See the START and STOP Conditions section. SDA and SCL idle high when the I2C bus is not busy. Table 17. Slave Address A0 SLAVE ADDRESS GND 0x94 VDD 0x96 SDA tSU, STA tSU, DAT tHD, DAT tLOW tBUF tHD, STA tSP tSU, STO SCL tHIGH tHD, STA tR tF START CONDITION REPEATED START CONDITION STOP CONDITION START CONDITION Figure 4. 2-Wire Interface Timing Diagram SMBus is a trademark of Motorola Corp. 13 MAX44004 Digital Ambient Light Sensor START and STOP Conditions SDA and SCL idle high when the bus is not in use. A master initiates communication by issuing a START condition. A START condition is a high-to-low transition on SDA with SCL high. A STOP condition is a low-to-high transition on SDA while SCL is high (Figure 5). A START condition from the master signals the beginning of a transmission to the device. The master terminates transmission, and frees the bus by issuing a STOP condition. The bus remains active if a Repeated START condition is generated instead of a STOP condition. Early STOP Conditions The device recognizes a STOP condition at any point during data transmission, except if the STOP condition occurs in the same high pulse as a START condition. For proper operation, do not send a STOP condition during the same SCL high pulse as the START condition. Acknowledge The acknowledge bit (ACK) is a clocked 9th bit that the device uses to handshake receipt of each byte of data when in write mode (Figure 6). The device pulls down SDA during the entire master-generated 9th clock pulse if the previous byte is successfully received. Monitoring S Sr ACK allows for detection of unsuccessful data transfers. An unsuccessful data transfer occurs if a receiving device is busy or if a system fault has occurred. In the event of an unsuccessful data transfer, the bus master may retry communication. The master pulls down SDA during the 9th clock cycle to acknowledge receipt of data when the device is in read mode. An acknowledge is sent by the master after each read byte to allow data transfer to continue. A not acknowledge is sent when the master reads the final byte of data from the device, followed by a STOP condition. Write Data Format A write to the device includes transmission of a START condition, the slave address with the R/W bit set to 0, 1 byte of data to configure the internal register address pointer, 1 or more bytes of data, and a STOP condition. Figure 7 illustrates the proper frame format for writing 1 byte of data to the device. Figure 8 illustrates the frame format for writing n bytes of data to the device. The slave address with the R/W bit set to 0 indicates that the master intends to write data to the device. The device acknowledges receipt of the address byte during the master-generated 9th SCL pulse. P CLOCK PULSE FOR ACKNOWLEDGMENT START CONDITION SCL SCL 2 1 8 9 NOT ACKNOWLEDGE SDA SDA ACKNOWLEDGE Figure 5. START, STOP, and Repeated START Conditions Figure 6. Acknowledge ACKNOWLEDGE FROM MAX44004 B7 ACKNOWLEDGE FROM MAX44004 S SLAVE ADDRESS 0 B6 B5 B4 B3 B2 B1 B0 ACKNOWLEDGE FROM MAX44004 A R/W REGISTER ADDRESS A DATA BYTE A P 1 BYTE Figure 7. Writing 1 Byte of Data to the MAX44004 14 MAX44004 Digital Ambient Light Sensor The second byte transmitted from the master configures the device’s internal register address pointer. The pointer tells the device where to write the next byte of data. An acknowledge pulse is sent by the device upon receipt of the address pointer data. from register 0x00 and subsequent reads autoincrement the address pointer until the next STOP condition. The address pointer can be preset to a specific register before a read command is issued. The master presets the address pointer by first sending the device’s slave address with the R/W bit set to 0 followed by the register address. A Repeated START condition is then sent, followed by the slave address with the R//W bit set to 1. The device transmits the contents of the specified register. Attempting to read from register addresses higher than 0xFF results in repeated reads of 0xFF. Note that 0xF6 to 0xFF are reserved registers. The third byte sent to the device contains the data that is written to the chosen register. An acknowledge pulse from the device signals receipt of the data byte. Read Data Format Send the slave address with the R/W bit set to 1 to initiate a read operation. The device acknowledges receipt of its slave address by pulling SDA low during the 9th SCL clock pulse. A start command followed by a read command resets the address pointer to register 0x00. The master acknowledges receipt of each read byte during the acknowledge clock pulse. The master must acknowledge all correctly received bytes except the last byte. The final byte must be followed by a not acknowledge from the master and then a STOP condition. Figure 8 illustrates the frame format for reading 1 byte from the device. Figure 9 illustrates the frame format for reading two registers consecutively without a STOP condition in between reads. The first byte transmitted from the device is the contents of register 0x00. Transmitted data is valid on the rising edge of the master-generated serial clock (SCL). The address pointer does not autoincrement after each read data byte. A STOP condition can be issued after any number of read data bytes. If a STOP condition is issued followed by another read operation, the first data byte to be read is NOT ACKNOWLEDGE FROM MASTER ACKNOWLEDGE FROM MAX44004 ACKNOWLEDGE FROM MAX44004 S SLAVE ADDRESS 0 A REGISTER ADDRESS R/W ACKNOWLEDGE FROM MAX44004 A Sr SLAVE ADDRESS REPEATED START 1 DATA BYTE A R/W A P 1 BYTE Figure 8. Reading 1 Byte of Data from the MAX44004 NOT ACKNOWLEDGE FROM MASTER ACKNOWLEDGE FROM MAX44004 ACKNOWLEDGE FROM MAX44004 S SLAVE ADDRESS 0 A REGISTER ADDRESS 1 R/W ACKNOWLEDGE FROM MAX44004 A Sr SLAVE ADDRESS REPEATED START 1 DATA BYTE 1 A R/W A Sr 1 BYTE NOT ACKNOWLEDGE FROM MASTER ACKNOWLEDGE FROM MAX44004 S SLAVE ADDRESS 0 R/W ACKNOWLEDGE FROM MAX44004 A REGISTER ADDRESS 2 ACKNOWLEDGE FROM MAX44004 A REPEATED START Sr SLAVE ADDRESS 1 R/W A DATA BYTE 2 A P 1 BYTE Figure 9. Reading Two Registers Consecutively Without a STOP Condition in Between Reads 15 MAX44004 Digital Ambient Light Sensor Package Information Ordering Information PART TEMP RANGE PIN-PACKAGE MAX44004GDT+ -40NC to +105NC 6 OTDFN +Denotes a lead(Pb)-free/RoHS-compliant package. For the latest package outline information and land patterns (footprints), go to www.maxim-ic.com/packages. Note that a “+”, “#”, or “-” in the package code indicates RoHS status only. Package drawings may show a different suffix character, but the drawing pertains to the package regardless of RoHS status. PACKAGE TYPE PACKAGE CODE OUTLINE NO. LAND PATTERN NO. 6 OTDFN D622N+2 21-0490 90-0344 16 MAX44004 Digital Ambient Light Sensor Revision History REVISION NUMBER REVISION DATE 0 5/12 DESCRIPTION Initial release PAGES CHANGED — Maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim product. No circuit patent licenses are implied. Maxim reserves the right to change the circuitry and specifications without notice at any time. Maxim Integrated Products, 160 Rio Robles Drive, San Jose, CA 95134 408-601-1000 © 2012 Maxim Integrated Products 17 Maxim is a registered trademark of Maxim Integrated Products, Inc.