The VCNL4040 is a handy two-in-one sensor, with a proximity sensor that works from 0 to 200mm (about 7.5 inches) and light sensor with range of 0.0125 to 6553 lux./VCNL4040是一款方便的二合一感測器,具有工作範圍為0至200mm(約7.5英寸)的接近感測器和範圍為0.0125至6553 lux的光感測器
We've all been there. That thing is close but how close? When you need to measure a small distance with reasonable accuracy, such as the rough height of particularly calm bumble bee, the VCNL4040 Proximity Sensor from Vishay can do that for you. If perchance you also needed to measure the amount of light at the same time, perhaps to let the bee to know if it's time for bed, you're in luck! The VCNL4040 can do that too (bumble bee not included, we tried putting it in the anti-static bag but it started buzzing in a threatening manner)
"OK, finally I can get started on my bee measuring and light sensing project, but how do I use it?" you say. To make life easier so you can focus on your important work, we've taken the VCNL4040 and put it onto a breakout PCB along with support circuitry to let you use this little wonder with 3.3V (Feather/Raspberry Pi) or 5V (Arduino/ Metro328) logic levels. Additionally since it speaks I2C you can easily connect it up with two wires (plus power and ground!). We've even included SparkFun qwiic compatible STEMMA QT connectors for the I2C bus so you don't even need to solder! Just wire up to your favorite micro and you can use our CircuitPython/Python or Arduino drivers to easily interface with the VCNL4040 and make approximate approximations of proximity in no time! QT Cable is not included, but we have a variety in the shop.
To give you some ability to tune your measurements for your situation, the VCNL4040 lets you adjust the integration time (how long light is being measured) to set the sensitivity of your measurements depending on the lighting conditions. With an integration time of 80ms, since the sensor is only collecting measurements for a short period of time, each measured bit of light represents a larger amount of light. For this reason, the maximum range in lux for the 80ms integration time is 6553.5 lux./為了使您能夠根據自己的情況調整測量值,VCNL4040 允許您調整積分時間(測量光的時間),以根據照明條件設置測量的靈敏度。積分時間為80ms,由於感測器僅在短時間內收集測量值,因此每個測量的光位代表更大的光量。因此,80ms積分時間的最大勒克斯範圍為6553.5勒克斯。
If you use a longer integration time and get the same amount of light measurements "events", you know that there is comparatively less light because we're waiting around longer for light to show up and getting the same number, meaning the rate of light events is lower. For this reason, at the maximum integration time of 640ms the VCNL4040 will only measure up to 819.2 lux./如果您使用更長的積分時間並獲得相同數量的光測量"事件",您就會知道光相對較少,因為我們等待更長的時間才能顯示光並獲得相同的數位,這意味著光事件的速率較低。因此,在640ms的最大積分時間下,VCNL4040的測量能力最高可達819.2勒克斯。
It is also worth keeping in mind that as you increase the integration time you are also increasing the sensitivity and resolution within the measurement range./還值得記住的是,隨著積分時間的增加,您也會在測量範圍內提高靈敏度和解析度。
In addition to adjusting the sensitivity of light measurements, you can change the current and duty cycle of the IR LED that powers the proximity detection to adjust how sensitive proximity measurements are./除了調整光測量的靈敏度外,您還可以更改為接近檢測供電的 IR LED 的電流和佔空比,以調整接近測量的敏感度。