Using Proximity Detection and Ambient Light Sensing to Save IoT Device Power

Colaboración de Editores de Digi-Key de América del Norte

Many portable electronic devices combine an ambient light sensor (ALS) and a proximity detector to both improve the user experience and minimize power consumption. Until recently, these combo sensors have been limited in range to a few millimeters for the proximity sensor, thus limiting their applications to smartphones.

However, many IoT applications including thermostats, home appliances, office equipment, lighting control, and others could also benefit from the board space and power savings of an integrated device with longer detection range. This was the impetus behind the design of the newly introduced VCNL4100CT from Vishay Intertechnology.

This article will explore the application of ALS and proximity sensing as it pertains to mobile and IoT devices. It will then introduce the VCNL4100CT, describe how it operates, and show how to get the most out of it for your next design.

ALS and proximity sensors save power

In displays for portable devices, the ALS is used to determine the screen display intensity needed under varying light conditions. This aids screen readability and the overall user experience, while conditionally reducing power consumed by the display. Some devices, such as smartphones, also use an optical proximity detector. The sensor output can be used to disable the touchscreen function and turn off the display. This reduces the odds that a user’s ear or cheek could hang up the call, mute the speaker, or engage some other unwanted function. 

Turning off the display while close to your face also extends battery life. If a user brings the device away from their ear to perform another task such as picking up another call, the proximity sensor will detect that action and the screen and the touch function can be re-enabled, ready for input.

Combining proximity and ambient light sensors into a single package has been common practice in the handheld market for several years. The integration takes advantage of the fact that photo detectors are used for both functions. For ambient light detection, the photo diode output is processed and filtered to mimic the response of the human eye. This information is then used to appropriately dim the screen. For proximity detection, an infrared emitting diode (IRED) sends out pulsed energy and a photo detector tuned to the IRED wavelength looks for that reflected energy. The combination saves valuable board space by using a single package that shares power and communication with the outside world.

Another advantage of co-packaging is avoidance of interference between the two functions. The proximity sensor uses pulsed infrared (IR) energy to determine distance. An IRED sends an IR signal into the environment and a similarly tuned IR receiver looks for reflected energy coming back from an object as it moves into the space. The ALS sensor can be saturated with the IR signal during this time unless it has good IR band rejection or a sensor blanking time is imposed when the IR pulse is present.

IoT applications

These combo sensors have been limited in range to a few millimeters for the proximity sensor, but many IoT applications could also benefit from the board space and power savings of an integrated device with a greater sensing distance. These applications include thermostats, home appliances, office equipment, and lighting control.

The new VCNL4100CT from Vishay expands the range of applications by introducing a high-power IR emitter that allows proximity detection up to one meter (Figure 1).

Diagram of Vishay VCNL4100 proximity and ambient light sensor

Figure 1: The VCNL4100 proximity and ambient light sensor from Vishay includes a matched IR emitter and photodetector for range measurements up to 1 meter (Source: Vishay Intertechnology)

The VCNL4100 combines a matched 940 nm IR emitter and photodiode for proximity measurement and an ambient light sensor. Both functions offer programmable measurement through on-board signal processing, allowing tailoring of operations to varying environments. Microcontroller (MCU) communication is via standard I2C, where the host can set measurement parameters and request results. If desired, programmable thresholds allow the VCNL4100 to interrupt the host once threshold values are crossed, thereby minimizing device polling.

A built-in temperature sensor is used by the signal processing circuitry to provide stable outputs across the temperature range -40°C to +85°C. Intelligent cancellation in the proximity sensor portion of the device eliminates background light issues that could interfere with the measurement. The ALS employs Filtron™ technology to match the ambient light spectral sensitivity to human eye response and is immune to fluorescent light flicker. The maximum detection range is selectable (655/1311/2621/5243 lux) with the highest sensitivity of 0.01 lux/step. The device is packaged in a miniature 8.0 x 3.0 x 1.8 mm surface-mount package with integrated lenses (Figure 2).

Image of Vishay VCNL4100 light sensor in surface-mount plastic package

Figure 2: The VCNL4100 comes in an 8.0 x 3.0 x 1.8 mm surface-mount plastic package with integrated lenses for easy mechanical integration into the end application. (Source: Vishay Intertechnology)

Now that we know a little bit about the device, let’s dig into the details of the electrical, mechanical and parameter adjustments for tailoring the sensor to an application.

Applications circuit

A component-level schematic for a typical application is shown in Figure 3.

Diagram of typical application circuit for Vishay VCNL4100

Figure 3: Typical application circuit for VCNL4100. Separate supplies are used for Vdd and Vbb and an external P-channel MOSFET are used to keep the pulsed IR emitter current from interfering with internal measuring circuits. (Diagram drawn using Digi-Key Scheme-it)

The VCNL4100 input voltage (Vdd) is 2.5 to 3.6 V, which is compatible with many of today’s microcontrollers. A separate Vbb supply is used to supply the source for the IR emitter pulses through a small external P-channel MOSFET, Q1. This moves the power dissipation of the IRED drive off chip and isolates the high-current drive pulses from the sensitive internal circuits biased to Vdd. The gate drive of Q1 comes from pin 2, which needs a pull-up resistor to ensure turnoff to Vbb (3.5 to 5 V).

If separate supplies are used, Vdd can be decoupled with a small 0.1 µF cap placed close to pin 3, but a bigger, 2.2 µF capacitor tied to Q1’s source is needed to supply the turn-on energy for the IR emitter. The maximum IR emitter current is 800 mA, which is set by a 2.7 Ω resistor.

The MCU communications pins are open drain, so they require pull-up resistors to the MCU voltage. In this case, 2.2 kΩ pull-ups are used for the 400 kHz I2C signals, but a weaker 8.2 kΩ pull-up suffices for the INT pin.

Figure 4 is a suggested layout for the VCNL4100 schematic described in Figure 3.

Diagram of suggested layout for Vishay VCNL4100 block using two board layers

Figure 4: Suggested layout for VCNL4100 block using two board layers. Wide traces are used for the current path through the IR emitter. (Source: Vishay Intertechnology)

Mechanical design

Since the device integrates both the IR emitter and detector, the distance between them is fixed, thus simplifying the details of the mechanical design. The angle of half intensity of the emitter is about + 15° and the sensitivity of the photodiodes is approximately + 30° (Figure 5).

Diagram of Vishay VCNL4100 emitter and detector half angles

Figure 5: VCNL4100 emitter and detector half angles determine the mechanical layout needed for good detection. (Source: Vishay Intertechnology)

The size of the detection zone is set by the distance from the top of the sensor to the outside surface of the cover glass and the size of the transparent hole in the glass. If the cover glass is resting on top of the sensor, then an emitter hole diameter of >1.7 mm and a detector hole of >2 mm is needed. If the glass is above the sensor, the window diameters must increase per simple geometric calculations. Vishay provides a table of required diameters with increasing glass distance.

The gray bar between the glass and sensor shown in Figure 5 is a light barrier. This must be installed between the IR emitter and the detector to avoid crosstalk interference.

Tuning the proximity sensor

The PS parameters need to be tuned to the application requirements. Detection distance is one critical parameter. Thermostats may require a detection range of up to a meter, while kitchen appliances may need only half that range. Soap dispensers typically require only 10 centimeters. In other applications such as industrial safety applications, response times can be important. In all cases, there is a tradeoff between detection range, speed and power dissipation.

Emitter pulse length, duty cycle, high and low threshold levels, and number of consecutive measurements above/below threshold can be set to provide the detection needed. Emitter pulse length can be set in discrete steps between 80 µs to 1.1 ms, and the duty cycle between 5 and 0.02 percent. As the pulse length increases, the pulse repetition rate stays constant to hold the set duty cycle. Thus, the fastest pulse train will be one every 1.5 ms (80 µs x 20) and the longest will be ~5.6 seconds (1.1 ms x 5120).

Longer pulses increase the detection range of dark objects, but result in the detector saturating for lighter objects at closer distances. The proper settings for each application need to be determined through evaluation testing with known detection objects or standard references, such as Kodak Gray Cards. The easiest way to do this is by purchasing Vishay’s VCNL4000 sensor starter kit and then requesting a VCNL4100 sensor board from This will allow you to quickly evaluate parameter changes through an easy to use GUI while making your measurements.

The output of the PS is an 8-bit value that can be polled by an MCU via the I2C interface. In addition, the VCNL4100 can be programmed with high and low thresholds, as well as the number of consecutive times the values exceed the thresholds to generate the interrupt. The latter reduces the communications and processing load on the MCU.

Tuning the ALS

Adjusting a display backlight or enabling/disabling features based on ambient lighting conditions can save power and improve display readability. To be effective, the ALS must be tuned to the visible spectrum and reject other light sources. The normalized spectral response of the VCNL4100 proximity sensor and ambient light sensor is shown in Figure 6.

Graph of Vishay VCNL4100 normalized spectral response

Figure 6: VCNL4100 normalized spectral response of the ambient light sensor and proximity sensor. The ambient light sensor mimics the spectral response of the human eye and the proximity detector is tuned to the infrared spectrum. (Source: Vishay Intertechnology)

The human eye is sensitive to wavelengths from 400 nm to 700 nm, with a peak sensitivity at 560 nm. The VCNL4100 ALS sensor closely matches this sensitivity range with excellent out-of-band rejection.

In the visible range, the illuminance measurement unit is the lux. Light sources with the same lux measurement appear to be equally bright. The lux value read by the sensor is available as a 16-bit value to the host MCU via I2C. The lux value encoded in the word depends on the integration time (sample accumulation time) selected. There are four possible integration times: 80, 160, 320, and 640 ms. Increasing the integration time results in a higher lux sensitivity and a smaller maximum detection range as shown in Figure 7. To determine the actual lux value, the MCU multiplies the 16-bit value by the selected lux/step. Offsets may need to be applied to account for cover glass and window size.

ALS Resolution and Maximum Detection Range
ALS_IT Sensitivity (lx/step) Maximum Detection Range (lx)
ALS_IT (7:6) Integration Time
(0, 0) (0, 1) (1, 0) (1, 1)
80 ms 160 ms 320 ms 640 ms
0.08 0.04 0.02 0.01
5243 2621 1311 655

Figure 7: VCNL4100 ambient light sensor resolution and maximum detection range. Longer integration (sample) time results in higher resolution, but smaller maximum detection range. (Source: Vishay Intertechnology)

The VCNL4100 also has high and low threshold settings, and the number of consecutive times above threshold can be used to automate the ALS detection process. If measurements exceed or fall below the thresholds for the programmed number of times, the interrupt line will be asserted.

Current and power considerations

Total supply current is important in many applications, especially those powered by batteries. The typical supply current of the VCNL4100 is 195 µA, excluding the current needed to drive the IR emitter. If an MCU will be used to periodically wake up the device for a measurement, a low-current shutdown mode is available that draws just 0.2 µA. A power savings alternative is to shut down the host MCU, enable the ALS and/or proximity sensor, and program one or both to wake up the MCU once a threshold is crossed.

An additional power consideration is pulsed IR emitter current. The maximum must be below 800 mA, but the average power dissipation in the IR emitter is a function of the duty cycle. Using a maximum pulse current and a 5% duty cycle, the average current draw will be 40 mA. A 0.02% duty cycle brings that down to 0.16 mA. Long pulse times with a fast duty cycle will result in die heating due the average power dissipation through the emitter. The maximum emitter current may need to be reduced in these cases to prevent running into package thermal limitations. Vishay provides a graph of forward current vs. pulse duration at various duty cycles at Tamb <50˚C to assist with that determination.

Ease of use

Packaging the IR emitter and detector together along with integrated lenses, the VCNL4100 greatly reduces the mechanical design task. Further, combining the signal processing and I2C communications in the device, along with an easy to use configuration tool, greatly reduces the applications tuning and software driver development tasks.


For designers of next-generation IoT devices and systems for the home, office, or factory floor, the VCNL4100 makes it possible to easily embed ambient light sensing and a long-range proximity sensor to minimize power consumption and greatly improve the user experience.

Descargo de responsabilidad: Las opiniones, creencias y puntos de vista expresados por los autores o participantes del foro de este sitio web no reflejan necesariamente las opiniones, las creencias y los puntos de vista de Digi-Key Electronics o de las políticas oficiales de Digi-Key Electronics.

Acerca de este editor

Editores de Digi-Key de América del Norte