Designing VCNL4010 Into an Application

Preparing to load PDF file. please wait...

0 of 0
100%
Designing VCNL4010 Into an Application

Transcript Of Designing VCNL4010 Into an Application

VISHAY SEMICONDUCTORS
www.vishay.com

Optical Sensors

Application Note

Designing VCNL4010 Into an Application

INTRODUCTION AND BASIC OPERATION
The VCNL4010 is a fully integrated proximity and ambient light sensor. It combines an infrared emitter and PIN photodiode for proximity measurement, ambient light sensor, and signal processing IC in a single package with a 16 bit ADC. The device provides ambient light sensing to support conventional backlight and display brightness auto-adjustment, and proximity sensing to minimize accidental touch input that can lead to call drops and camera launch. With a range of up to 20 cm (7.9"), this stand-alone, single component greatly simplifies the use and design-in of a proximity sensor in consumer and industrial applications because no mechanical barriers are required to optically isolate the emitter from the detector. The VCNL4010 features a miniature leadless package (LLP) for surface mounting in a 3.9 mm x 3.9 mm package with a low profile of 0.75 mm designed specifically for the low height requirements of smart phone, mobile phone, digital camera, and tablet PC applications. Through its standard I2C bus serial digital interface, it allows easy access to a “Proximity Signal” and “Light Intensity” measurements without complex calculations or programming. The programmable interrupt function offers wake-up functionality for the microcontroller when a proximity event or ambient light change occurs which reduces processing overhead by eliminating the need for continuous polling.
COMPONENTS (BLOCK DIAGRAM)
The major components of the VCNL4010 are shown in the block diagram.
12 GND

Fig. 1 - VCNL4010 Top View

Cathode Emitter Anode Emitter
Pinning Bottom View
GND

SDA SCL
INT GND

Pad must not be

VDD

electrical connected

Fig. 2 - VCNL4010 Bottom View

IR Anode 1

IRED

VCNL4010

Proxi PD 11 nc

IR Cathode 2 IR Cathode 3
SDA 4 SCL 5

LED Driver

MUX Amp.

Oscillator

Integrating ADC

Data Register Command Register
I2C

Signal Processing
Interrupt

Ambi PD

10 nc 9 nc 8 nc 7 VDD

INT 6 13 GND Fig. 3 - VCNL4010 Detailed Block Diagram

.

1

Document Number: 84138

For technical questions, contact: [email protected]om

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

APPLICATION NOTE

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

The integrated infrared emitter has a peak wavelength of 890 nm. It emits light that reflects off an object within 20 cm of the sensor. The infrared emitter spectrum is shown in Figure 4.

Ie, rel - Relative Radiant Intensity

1.1 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1
0 750
22305

IF = 100 mA
800 850 900 950 1000 1050 λ - Wavelength (nm)

Fig. 4 - Relative Radiant Intensity vs. Wavelength

The infrared emitter has a programmable drive current from 10 mA to 200 mA in 10 mA steps. The infrared light emitted is modulated at one of four user defined carrier frequencies: 390.625 kHz, 781.25 kHz, 1.5625 MHz (not recommended), or 3.125 MHz (not recommended).
The PIN photodiode receives the light that is reflected off the object and converts it to a current. It has a peak sensitivity of 890 nm, matching the peak wavelength of the emitter. It is insensitive to ambient light. It ignores the DC component of light and “looks for” the pulsed light at one of the two recommended frequencies used by the emitter. Using a modulated signal for proximity provides distinct advantages over other sensors on the market.
The ambient light sensor receives the visible light and converts it to a current. The human eye can see light of wavelengths from 400 nm to 700 nm with a peak of 560 nm. Vishay’s ambient light sensor closely matches this range of sensitivity. It has peak sensitivity at 540 nm and a bandwidth from 430 nm to 610 nm.
The application specific integrated circuit or ASIC includes an LED driver, I2C bus interface, amplifier, integrating analog to digital converter, oscillator, and Vishay’s “secret sauce” signal processor. For proximity, it converts the current from the PIN photodiode to a 16-bit digital data output value. For ambient light sensing, it converts the current from the ambient light detector, amplifies it and converts it to a 16-bit digital output stream.

PIN CONNECTIONS
Figure 3 shows the pin assignments of the VCNL4010.
The connections include:
• Pin 1 - IR anode to the power supply
• Pin 2 - IR cathode
• Pin 3 - IR cathode
• Pin 4 - SDA to microcontroller
• Pin 5 - SCL to microcontroller
• Pin 6 - INT to microcontroller
• Pin 7 - VDD to the power supply • Pin 8 thru 11 - must not beconnected
• Pin 12, pin 13 - GND
The power supply for the ASIC (VDD) has a defined range from 2.5 V to 3.6 V. The infrared emitter may be connected in the range from 2.5 V to 5.0 V. It is best if VDD is connected to a regulated power supply and pin 1, IR Anode, is connected directly to the battery. This eliminates any influence of the high infrared emitter current pulses on the VDD supply line. The ground pins 12 and 13 are electrically the same. They use the same bottom metal pad and may be routed to the same stable ground plane. The power supply decoupling components shown in Figure 5 are optional. They isolate the sensor from other possible noise on the same power rail but in most applications are not needed. If separate power supplies for the VDD and the infrared emitter are used and there are no negative spikes below 2.5 V, only one capacitor at VDD could be used. The 100 nF capacitor should be placed close to the VDD pin. The SCL and SDA as well as the interrupt lines need pull-up resistors. The resistor values depend on the application and on the I2C bus speed. Common values are about 2.2 kΩ to 4.7 kΩ for the SDA and SCL and 10 kΩ to 100 kΩ for the Interrupt.

2.5 V to 5.0 V
2.5 V to 3.6 V

C1 C2 22 μF 100 nF

R1 IR_Anode (1) 10R C4 C3 VDD (7)

10 μF

100 nF

VCNL4010

INT (6)

1.7 V .. 5.0 V R2 R3 R4

SCL (5) GND (12,13) SDA (4)

Host Micro Controller
GPIO
I2C bus clock SCL I2C bus data SDA

Fig. 5 - VCNL4010 Application Circuit

APPLICATION NOTE

.

2

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

MECHANICAL DESIGN CONSIDERATIONS
The VCNL4010 is a fully integrated proximity and ambient light sensor. Some competing sensors use a discrete infrared emitter which leads to complex geometrical calculations to determine the position of the emitter. Competing sensors also require a mechanical barrier between the emitter and detectors to eliminate crosstalk; light reflecting off the inside of the window cover which can produce false proximity readings. The VCNL4010 does not require a mechanical barrier. The signal processor continuously compensates for the light reflected from windows ensuring a proper proximity reading. As a fully integrated sensor, the design process is greatly simplified.
The only dimensions that the design engineer needs to consider are the distance from the top surface of the sensor to the outside surface of the window and the size of the window. These dimensions will determine the size of the detection zone.
The angle of half intensity of the emitter and the angle of half sensitivity of the PIN photodiode are ± 55° as shown in Figure 6 and Figure 7.



20°

ϕ - Angular Displacement

Irel - Relative Radiant Intensity

1.0

0.9

40°

0.8

0.7 60°
0.6 80°

0.5 0.4 0.3 0.2 0.1 0
22306
Fig. 6 - Angle of the Half Intensity of the Emitter



20°

ϕ - Angular Displacement

Srel - Relative Sensitivity

1.0

0.9

40°

0.8

0.7 60°
0.6 80°

0.5 0.4 0.3 0.2 0.1 0
22308
Fig. 7 - Angle of the Half Sensitivity of the PIN Photodiode

α = ± 55°

2.47

Fig. 8 - Emitter and Detector Angle and Distance

The center of the sensor and center of the window should be aligned. Assuming the detection zone is a cone shaped region with an angle of ± 40°, the following are dimensions for the distance from the top surface of the sensor to the outside surface of the glass, d, and the width of the window, w. The distance from the center of the infrared emitter to the center of the PIN photodiode is 2.47 mm. The height of the sensor is 0.75 mm.

w

2.47

x

d α 0.75

tan (α) = x/d α = 40°

d (mm)
0.5 1.0 1.5 2.0 2.5 3.0

Fig. 9 - Window Dimensions

x (0.84 d)
0.42 0.84 1.26 1.68 2.10 2.52

w (2.47 + 2 x)
3.31 4.15 4.99 5.83 6.67 7.51

The results above represent the ideal width of the window. The mechanical design of the device may not allow for this size.

.

3

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

APPLICATION NOTE

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

PROXIMITY SENSOR
The main DC light sources found in the environment are sunlight and tungsten (incandescent) bulbs. These kinds of disturbance sources will cause a DC current in the detector inside the sensor, which in turn will produce noise in the receiver circuit. The negative influence of such DC light can be reduced by optical filtering. Light in the visible range, 400 nm to 700 nm, is completely removed by the use of an optical cut-off filter at 800 nm. With filtering, only longer wavelength radiation above 800 nm can be detected. The PIN photodiode therefore receives only a limited band from the original spectrum of these DC light sources as shown in Figure 10.

S(λ)rel - Relative Spectral Sensitivity

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0 400 500 600 700 800 900 1000 1100

22307

λ - Wavelength (nm)

Fig. 10 - Spectral Sensitivity of Proximity PIN Photodiode

As mentioned earlier, the proximity sensor uses a modulated carrier signal on one of four user selected frequencies. These frequencies are far from the ballast frequencies of fluorescent lights ensuring that the sensor is unaffected by them. The infrared emitter sends out a series of pulses, a burst, at the selected frequency and the PIN photodiode which features a band pass filter set to this same frequency, receives the reflected pulses, Figure 11.

100 mA

153 μs

22381

100 ms Fig. 11 - Emitter Pulses

In addition to DC light source noise, there is some reflection of the infrared emitted light off the surfaces of the components which surround the VCNL4010. The distance to the cover, proximity of surrounding components, the tolerances of the sensor, the defined infrared emitter current, the ambient temperature, and the type of window material used all contribute to this reflection. The result of

the reflection and DC noise produces an output current on the proximity and light sensing photodiode. This current is converted in to a count called the offset count.
In addition to the offset, there is also a small noise floor during the proximity measurement which comes from the DC_light suppression circuitry. This noise is in the range from ± 5 counts to ± 20 counts. The application should “ignore” this offset and small noise floor by subtracting them from the total proximity readings. The application specific offset is easily determined during the development of the end product.

Reflected signal

-

Offset

- Noise floor

= Proximity count

Offset • distance to the cover • proximity of surrounding
components • tolerances of the sensor • defined IRED current • ambient temperature • type of cover material used • ambient light

22382

Fig. 12 - Proximity Calculation

Results typically do not need to be averaged. If an object with very low reflectivity or at longer range needs to be detected, the sensor provides a register where the customer can define the number of consecutive measurements above a user-defined threshold before producing an interrupt. This provides stable results without requiring averaging.

PROXIMITY CURRENT COSUMPTION
The standby current of the VCNL4010 is 1.5 μA. In this mode, only the I2C interface is active. In most consumer electronic applications the sensor will spend the majority of time in standby mode. For proximity sensing, the current consumption of the VCNL4010 is primarily a function of the infrared emitter current and, secondarily, signal processing done by the ASIC. Example current consumption calculations are shown below for the range of IRED current and measurement rates. The current between burst pulse frames is equivalent to the standby mode. The duty cycle of the emitter is 50 %.

10 measurement per second, emitter current = 100 mA

ASIC: 2.71 mA x 164 μs x 10/1 s =

4.45 μA

IRED: 100 mA x 153 μs/1 s x 0.5 x 10/1 s = 76.50 μA

total: 80.95 μA

250 measurement per second, emitter current = 200 mA ASIC: 2.71 mA x 164 μs x 250/1 s = 111.0 μA
IRED: 200 mA x 153 μs x 0.5 x 250/1 s = 3.825 mA total: 3.936 mA

.

4

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

APPLICATION NOTE

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

PROXIMITY INITIALIZATION
The VCNL4010 contains seventeen 8-bit registers for operation control, parameter setup and result buffering. All registers are accessible via I2C communication. The built in I2C interface is compatible with all I2C modes: standard, fast and high speed. I2C H-Level voltage range is from 1.7 V to 5.0 V.
1. IRED Current = 10 mA… 200 mA IR LED Current Register #3 [83h]
2. Proximity Measurement Rate = 1.95 to 250 meas/s Proximity Rate Register #2 [82h]
3. Proximity and Light Sensor: Number of consecutive measurements above/below threshold:
- int_count_exceed = 1 to 128 defines number of consecutive measurements above threshold
- int_thres_en = 1 enables interrupt when threshold is exceeded
- int_thres_sel = 0 definines thresholds for proximity
Interrupt Control Register # 9 [89h].
For ambient light sensing, the default averaging value is 32 measurements. If this value needs to be changed or if “Continuous conversion” mode is desired, a fourth register may be defined:
4. ALS Measurement Rate, auto offset = on, averaging Ambient Light Parameter Register # 4 [84h]
To define the infrared emitter current, evaluation tsets should be performed using the least reflective material at the maximum distance specified.

Figure 13 shows the typical digital counts output versus distance for three different emitter currents. The reflective reference medium is the Kodak Gray card. This card shows approximately 18 % reflectivity at 890 nm.

100 000 10 000

LED current 200 mA

The proximity measurement rate determines how fast the application reacts when an object appears in, or is removed from, the proximity zone. Reaction time is also determined by the number of counts that must be exceeded before an interrupt is set.
To define these register values, evaluation test should be performed. The SensorXplorerTM allows you to perform evaluation tests and properly set the registers for your application. The SensorXplorer is available from any of Vishay’s distributors. A VCNL4010 sensor board is not available but evaluation can be done with the VCNL4020 sensor board as this VCNL4020 is function- and feature wise identical to VCNL4010, just package is different. This sensor board is available from any of Vishay’s listed distributors: www.vishay.com/optoelectronics/SensorXplorer.

Timing
For an I2C bus operating at 100 kHz, an 8-bit write or read command which includes the start, stop and acknowledge bits takes 100 μs. When the device is powered on, the initialization with just these 3 registers needs 3 write commands, each requiring 3 bytes: slave address, register and data.

Power Up

The release of internal reset, the start of the oscillator and

signal processor needs

2.5 ms

Initialize Registers

Write to 3 registers

900 μs

- IR LED current

- Proximity rate

- Interrupt control

Once the device is powered on and the VCNL4010 initialized, a proximity measurement can be taken. Before the first read out of the proximity count, a wait time is required. Subsequent reads do not require this wait time.

Proximity Value (cts)

1000 100 10

LED current 100 mA LED current 20 mA

Start measurement Measurement being made Wait time prior to first read Read out of the proximity data

Total:

300 μs 170 μs 400 μs 600 μs 1470 μs

Media: Kodak gray card

1

0.1

1

10

100

Distance to Reflecting Card (mm) Fig. 13 - Proximity Value vs. Distance

.

5

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

APPLICATION NOTE

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

AMBIENT LIGHT SENSING
Ambient light sensors are used to detect light or brightness in a manner similar to the human eye. They allow settings to be adjusted automatically in response to changing ambient light conditions. By turning on, turning off, or adjusting features, ambient light sensors can conserve battery power or provide extra safety while eliminating the need for manual adjustments.
Illuminance is the measure of the intensity of light incident on a surface and can be correlated to the brightness perceived by the human eye. In the visible range, it is measured in units called “lux.” Light sources with the same lux measurement appear to be equally bright. In Figure 14, the incandescent light and sunlight have been scaled to have the same lux measurement. In the infrared region, the intensity of the incandescent light is significantly higher. A standard silicon photodiode is much more sensitive to infrared light than visible light. Using it to measure ambient light will result in serious deviations between the lux measurements of different light sources and human-eye perception. Using Vishay’s ambient light sensors will solve this problem because they are most sensitive to the visible part of the spectrum.

1.0

0.8 Human eye
0.6

Ambient

0.4

light sensor

Visible infrared

Incandescent light

Silicon photodiode

0.2

0.0 0

500

700

1000

Wavelength (nm)

1500

22389

Photopic peak 550 nm

Fig. 14 - Relative Spectral Sensitivity vs. Wavelength

The human eye can see light with wavelengths from 400 nm to 700 nm. The ambient light sensor in the VCNL4010 closely matches this range of sensitivity and provides a digital output based on a 16-bit signal.

AMBIENT LIGHT MEASUREMENT, RESOLUTION AND OFFSET
The ambient light sensors measurement resolution is 0.25 lux/count. The 16-bit digital resolution is equivalent to 65 536 counts. This yields a measurement range from 0.25 lux to 16 383 lux.

100 000

Ambient Light Signal (cts)

10 000

1000

100

10

1 0.1

1

10

100 1000 10 000

EV - Illuminance (lx)

Fig. 15 - Ambient Light Values vs. Illuminance

In most applications a cosmetic window or cover is placed in front of the sensor. These covers reduce the amount of light reaching the sensor. It is not uncommon for only 10 % of the ambient light to pass through the window. The resulting sensor resolution in relation to cover transparency is shown in Table 11.

TABLE 11 - RESOLUTION VS. TRANSPARENCY

COVER VISIBLE LIGHT TRANSPARENCY (%)

RESULTING SENSOR RESOLUTION (LUX/COUNT)

100

0.25

50

0.5

20

1.25

10

2.5

Similar to the proximity measurements, there is a digital offset deviation of - 3 counts which has to be considered when setting up the application thresholds. This offset comes from tolerances within the digital compensation process. In single-digit lux ambient lighting where the transparency of the window is 10 % or less these 3 counts should be added to the actual ambient light value.

AMBIENT LIGHT SENSOR CURRENT CONSUMPTION
The ambient light sensor can operate in single or continuous mode. In single mode operation, an ambient light measurement consists of up to 128 individual measurement cycles which are averaged. The timing diagram for an individual measurement cycle is shown in Figure 16.

.

6

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

APPLICATION NOTE

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

Standard Deviation (cts)

Start of Cycle
40 μs
22392

Offset Compensation Measurement
225 μs

Ambient Light Measurement
225 μs time

Fig. 16 - Timing Diagram for Individual Measurement Cycle
In single-mode operation, an ambient light measurement takes 100 ms. The single measurement cycles are evenly spread inside this 100 ms frame. Figure 17 shows an example where 8 individual measurement cycles are averaged. The maximum number of single measurement cycles that can be used to calculate an average is 128. The maximum number of times this average can be calculated in one second is 10.

Start

22393

12.5 ms

100 ms

Fig. 17 - Ambient Light Measurement with Averaging = 8

A higher number of measurement cycles increases the accuracy of the reading and reduces the influence of modulated light sources. However, a higher number of cycles also consume more power. During an individual measurement cycle, the ASIC consumes approximately 2.7 mA. Between the individual measurements, the current consumption is 9 μA. Example current consumption calculations are shown below.
Current Calculations for Ambient Light Measurements: 1 measurement per second, AVG = 32 2.7 mA x 450 μs/1 cycle x 32 cycles x 1 = 39 μA
10 measurement per second, AVG = 128 2.7 mA x 450 μs/1 cycle x 128 cycles x 10 = 1.55 mA

The current consumption for the ambient light sensor is strongly dependent on the number of measurements taken. In single-mode operation, the highest average current is 1.55 mA. Figure 18 shows that increasing the number of cycles averaged reduces the standard deviationof the measurement.

10

8

6

4

2

0

1

2

4

8

16 32 64 128

22394

Average

Fig. 18 - Ambient Light Noise vs. Averaging
In continuous conversion mode, the ambient light sensor measurement time can be reduced. A timing example of continuous mode where 8 measurements are averaged is shown in Figure 19.

Start 450 μs 22395

5.7 ms

Fig. 19 - Ambient Light Measurement with Averaging = 8 Using Continuous Conversion Mode

The individual measurements are done sequentially. Recall that one individual measurement cycle, including offset compensation, takes approximately 450 μs. The gap time is 180 μs. As shown in Figure 19, the result of the 8 cycles is already accessible after about 6 ms. However, fluorescent light suppression is less effective in this mode.
There will be no influence on the ambient measurement from the infrared emitter used for proximity because the proximity measurements are made between the ambient light measurements. They are not performed at the same time.

AMBIENT LIGHT INITIALIZATION For ambient light sensing, only register #4 parameters need to be initialized • Continuous conversion ON/OFF (register #4b7) • Offset compensation ON/OFF (register #4b3) • Number of average measurements (register #4b0 to 4b2) The default settings are: • Continuous conversion = OFF • Offset compensation = ON • Number of average measurements = 32

.

7

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

APPLICATION NOTE

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

INTERRUPT
The VCNL4010 features an interrupt function. The interrupt function enables the sensor to work independently until a predefined proximity or ambient light event or threshold occurs. It then sets an interrupt which requires the microcontroller to awaken. This helps customers reduce their software effort, and reduces power consumption by eliminating polling communication traffic between the sensor and microcontroller. The interrupt pin, Pin 6 of the VCNL4010, should be connected to a dedicated GPIO of the controller. A pull-up resistor is added to the same power supply to which the controller is connected. This INT pull-up resistor may be in the range of 1 kΩ to 100 kΩ. Its current sinking capability is greater than 8 mA, typically 10 mA, and less than 20 mA.
The events that can generate an interrupt include:
1. A lower and an upper threshold for the proximity value can be defined. If the proximity value falls below the lower limit or exceeds the upper limit, an interrupt event will be generated. In this case, an interrupt flag bit in one of the registers of the device will be set and the interrupt pad of the ASIC will be pulled to low by an open drain pull-down circuit. In order to eliminate false triggering of the interrupt by noise or disturbances, it is possible to define the number of consecutive measurements that have to occur before the interrupt is triggered.
2. A lower and an upper threshold for the ambient light value can be defined. If the ambient light value falls below the lower limit or exceeds the upper limit, an interrupt event will be generated. There is only one set of high and low threshold registers. You will have to decide if the thresholds will be defined for proximity or ambient light.
3. An interrupt can be generated when a proximity measurement is ready.
4. An interrupt can be generated when an ambient light measurement is ready.

For each of these conditions a separate bit can activate or deactivate the interrupt. This means that a combination of different conditions can occur simultaneously. Only condition 1 and 2 cannot be activated at the same time. For them, one bit indicates that the threshold interrupt is on or off, a second bit indicates if it for proximity or ambient light.
When an interrupt is generated, the information about the condition that has generated the interrupt will be stored and is available for the user in an interrupt status register which can be read out via I2C. Each condition that can generate an interrupt has a dedicated result flag. This allows independent handling of the different conditions. For example, if the interrupt is generated by the upper threshold condition and a measurement ready condition, both flags are set.
To clear the interrupt line, the user has to clear the enabled interrupt flag in the interrupt status register, Register 14. Resetting the interrupt status register is done with an I2C write command. One interrupt bit can be cleared without affecting another. If there was a second interrupt source, it would have to be cleared separately. With a write command where all four interrupt bits are set to “1” all these bits and the interrupt line is cleared or reset.

APPLICATION NOTE

.

8

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

REGISTER FUNCTIONS Register #0 Command Register Register address = 80h Register #0 is for starting ambient light or proximity measurements. The register contains 2 flag bits for data indication.

TABLE 1 - COMMAND REGISTER #0

BIT 7

BIT 6

BIT 5

BIT 4

BIT 3

BIT 2

BIT 1

BIT 0

config_lock

als_data_ rdy prox_data_ rdy

als_od

prox_od

als_en

prox_en

selftimed_ en

DESCRIPTION

Config_lock

Read only bit. Value = 1

als_data_rdy

Read only bit. Value = 1 when ambient light measurement data is available in the result registers. This bit will be reset when one of the corresponding result registers (reg #5, reg #6) is read.

prox_data_rdy

Read only bit. Value = 1 when proximity measurement data is available in the result registers. This bit will be reset when one of the corresponding result registers (reg #7, reg #8) is read.

als_od

R/W bit. Starts a single on-demand measurement for ambient light. If averaging is enabled, starts a sequence of readings and stores the averaged result. Result is available at the end of conversion for reading in the registers #5 (HB) and #6 (LB).

prox_od

R/W bit. Starts a single on-demand measurement for proximity. Result is available at the end of conversion for reading in the registers #7 (HB) and #8 (LB).

als_en

R/W bit. Enables periodic als measurement

prox_en

R/W bit. Enables periodic proximity measurement

selftimed_en

R/W bit. Enables state machine and LP oscillator for selftimed measurements; no measurement is performed until the corresponding bit is set.

When single on demand measurements are made bit 3 and bit 4 are set with the same write command, ambient light and proximity measurements will both occur. For periodic measurements, the selftimed_en bit must be set first, then the als_en and/or prox_en bit(s) can be set. On-demand measurement modes are disabled when the selftimed_en bit is set.
To avoid synchronization problems and undefined states between the clock domains, changes to the proximity or ambient light measurement rates in register #2 and register #4 respectively can be made only when there are no selftimed measurements being made, b0 (selftimed_en bit) = 0.

Register #1 Product ID Revision Register
Register address = 81h. This register contains information about product ID and product revision. Register data value of current revision = 21h.

TABLE 2 - PRODUCT ID REVISION REGISTER #1

BIT 7

BIT 6

BIT 5

BIT 4

PRODUCT ID

DESCRIPTION

Product ID

Read only bits. Value = 2

Revision ID

Read only bits. Value = 1

BIT 3

BIT 2

BIT 1

REVISION ID

BIT 0

APPLICATION NOTE

.

9

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

www.vishay.com

Application Note
Vishay Semiconductors

Designing VCNL4010 Into an Application

Register #2 Rate of Proximity Measurement Register address = 82h. This register contains the rate of proximity measurements to be carried out within 1 second.

TABLE 3 - PROXIMITY RATE REGISTER #2

BIT 7

BIT 6

BIT 5

BIT 4

BIT 3

n/a

DESCRIPTION Proximity rate

R/W bits. 000 - 1.95 measurements/s (default setting) 001 - 3.90625 measurements/s 010 - 7.8125 measurements/s 011 - 16.625 measurements/s 100 - 31.25 measurements/s 101 - 62.5 measurements/s 110 - 125 measurements/s 111 - 250 measurements/s

BIT 2

BIT 1

BIT 0

Rate of proximity measurement (no. of measurements per second)

Again, if selftimed measurements are being made, any new measurement rate written to this register will not be made until selftimed_en measurement is stopped.

Register #3 LED Current Setting for Proximity Mode
Register address = 83h. This register is to set the current of the infrared emitter for proximity measurements. The value is adjustable from 0 mA to 200 mA in 10 mA steps. This register also contains information about the used device fuse program ID.

TABLE 4 - IR LED CURRENT REGISTER #3

BIT 7

BIT 6

BIT 5

BIT 4

BIT 3

BIT 2

BIT 1

BIT 0

Fuse prog ID

Infrared emitter current

DESCRIPTION

Fuse prog ID

Read only bits. Information about fuse program revision used for initial setup/calibration of the device.

R/W bits. IR LED current = Value (dec.) x 10 mA. Valid Range = 0 - 20d (00 - 14 h)

0 = 0 mA

1 = 10 mA

2 = 20 mA (default setting)

Infrared emitter current value

.

.

20 = 200 mA,

LED Current is limited to 200 mA. If higher values than 20 (20d) are written, the current will be set to 200 mA.

APPLICATION NOTE

.

10

Document Number: 84138

For technical questions, contact: [email protected]

THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000
EmitterSubjectDocumentLightSensor