Qwiic Proximity Sensor (VCNL4040) Hookup Guide
There is a power status LED to help make sure that your Qwiic Joystick is getting power. You can power the board either through the polarized Qwiic connector system or the breakout pins (PWR and GND) provided. This Qwiic system is meant to use 3.3V, be sure that you are NOT using another voltage when using the Qwiic system.
The VCNL4040 is a proximity sensor (PS), ambient light sensor (ALS), and a high power IR emitter (IRED) integrated into a single package. The ambient light sensor and proximity sensor operate in a parallel structure. The combination of the two sensors along with the IR emitter form the proximity detector.
The sensor has an operating voltage range from 2.5V to 3.6V. It is recommended that you use this board with the intended 3.3V of the Qwiic connect system. The VCNL4040 also includes excellent temperature compensation. For any details not covered in this guide, please refer to the datasheet.
The IR emmiter is immune to red glow with a 940 nm wavelength (for those discrete applications) and the sink current is programmable (200 mA default). For more details on the IR emitter, please refer to the datasheet.
Ambient Light Sensor (ALS)
The VCNL4040 offers a 16-bit high resolution ALS with ±10 % accuracy and is immune to fluorescent light flicker. With an ambient light sensing capability down to 0.01 lux/step, the VCNL4040 works well under a low transmittance lens design (dark lens). In addition, the patented FiltronTM technology offers great background light cancellation capability (including sunlight) without utilizing microcontroller resources.
Proximity Sensor (PS)
The proximity sensor features smart persistence, which prevents the misjudgment of proximity sensing but also keeps a fast response time. In active force mode, a single measurement can be requested for more design flexibility and/or power saving.
Qwiic or I2C
The sensor has a single slave address 0x60 (HEX) of 7-bit addressing, following I2C protocol.
The simplest way to use the Qwiic Proximity Sensor is through the Qwiic connect system. The connectors are polarized for the I2C connection and power. (*They are tied to their corresponding breakout pins.)
However, the board also provides five labeled breakout pins. You can connect these lines to the I2C bus of your microcontroller and power pins (3.3V and GND), if it doesn't have a Qwiic connector. The interrupt pin is broken out to use for triggered events.
Interrupt PinHigh and low interrupt thresholds can be programmed for both the ambient light sensor and proximity sensor, allowing the component to use a minimal amount of the microcontrollers resources. Adjustable persistence sets up the amount of consecutive hits required before an interrupt event occurs, to prevent false triggers.
The VCNL4040 also supports an easy to use proximity detection logic mode, that triggers when the PS high threshold is exceeded and automatically resets the interrupt pin when the proximity reading falls beneath the PS low threshold.
An interrupt can be cleared by reading data out from the INT_Flag register (resetting it to "0") and the INT pin is then reset to high. For more details on the interrupt, please refer to the datasheet.
Interrupt JumperCutting the INT jumper will remove the 10 kΩ pull-up resistor from the INT pin.
I2C Pull-up Jumper
Cutting the I2C jumper will remove the 2.2 kΩ pull-up resistors from the I2C bus. If you have many devices on your I2C bus you may want to remove these jumpers. Not sure how to cut a jumper? Read here!