Qwiic Proximity Sensor (VCNL4040) Hookup Guide

Contributors: Santa Claus Impersonator, Englandsaurus
Favorited Favorite 2


The Qwiic Proximity Sensor is a simple IR presence and ambient light sensor utilizing the VCNL4040. This sensor is excellent for detecting if something has appeared in front of the sensor; detecting objects qualitatively up to 20cm away. This means you can detect if something is there, and if it is closer or further away since the last reading, but it’s difficult to say it is 7.2cm away. If you need quantitative distance readings for exact distances, check out the SparkFun 2 meter and 4 meter Time of Flight (ToF) sensors with mm accuracy.

SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic)

SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic)


We often see this type of sensor on automatic towel dispensers, automatic faucets, etc. However, the VCNL4040 has no dead zone and can read all the way up to the face of the sensor. The SparkFun Proximity VCNL4040 sensor is a great digital alternative to the popular analog PIR sensors. The Qwiic Proximity Sensor also has an ambient light sensor built it which is excellent if you need a digital light sensor for your next glitter cannon.

This board is one of our many Qwiic compatible boards! Simply plug and go. No soldering, no figuring out which is SDA or SCL, and no voltage regulation or translation required!

Required Materials

The Qwiic Proximity Sensor does need a few additional items for you to get started. You may already have a few of these items, so feel free to modify your cart as necessary.

SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

SparkFun RedBoard Qwiic

SparkFun RedBoard Qwiic


Suggested Reading

If you're unfamiliar with jumper pads or I2C be sure to checkout some of these foundational tutorials.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.


An introduction to I2C, one of the main embedded communications protocols in use today.

How to Work with Jumper Pads and PCB Traces

Handling PCB jumper pads and traces is an essential skill. Learn how to cut a PCB trace, add a solder jumper between pads to reroute connections, and repair a trace with the green wire method if a trace is damaged.

Qwiic Connect System

The Qwiic Proximity Sensor utilizes the Qwiic connect system. We recommend familiarizing yourself with the Logic Levels and I2C tutorials (above) before using it. Click on the banner above to learn more about our Qwiic products.