# Adafruit VL53L4CX Time of Flight Distance Sensor

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/122/987/medium800/adafruit_products_5425-02.jpg?1690378738)

The&nbsp; **Adafruit VL53L4CX Time of Flight Sensor** &nbsp;is another great&nbsp;[_Time of Flight_](https://en.wikipedia.org/wiki/Time_of_flight) distance sensor from ST in the VL5 series of chips. This one is great for&nbsp; **long distances -&nbsp;** it goes up to 6 meters compared with 4 meter max of the VL53L1X.

The sensor contains a very tiny invisible laser source&nbsp;and a matching sensor. The VL53L4CX can detect the "time of flight", or how long the light has taken to bounce back to the sensor. Since it uses a very narrow light source, it is good for determining distance of only the surface directly in front of it.

Unlike sonars that bounce ultrasonic waves, the 'cone' of sensing is very narrow. Unlike IR distance sensors that try to measure the amount of light bounced, the VL53 is much more precise and doesn't have linearity problems or 'double imaging' where you can't tell if an object is very far or very close.

![](https://cdn-learn.adafruit.com/assets/assets/000/122/988/medium800/adafruit_products_5425-03.jpg?1690378761)

Info: 

This is a 'big sister' of the&nbsp;[VL53L4CD ToF sensor](https://www.adafruit.com/product/5396)&nbsp;and can handle about **&nbsp;~1 to 6000mm** &nbsp;of range distance, it also has some ability to do 'multi object detection'. Basically it can identify when more than one object is in view and tell you the two distances.

**Please note, the Arduino driver for this chip does not support 'small memory' boards like the ATmega328** &nbsp;- you'll need a SAMD21, SAMD51, ESP, etc chip with 50K of flash memory available!

![](https://cdn-learn.adafruit.com/assets/assets/000/122/989/medium800/adafruit_products_5425-01.jpg?1690378784)

The sensor is small and easy to use in any robotics or interactive project. Since it needs 2.8V power and logic we put the little fellow on a breakout board with a regulator and level shifting. You can use it with any 3-5V power or logic microcontroller with no worries. Works great with the&nbsp; **3.3V logic level of a Feather, or the 5v level of a Arduino Mega** , this breakout is ready to work with most common microcontrollers or SBCs. and since&nbsp;it speaks I2C, you can easily connect it up with two data wires plus power and ground.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/122/991/medium800/adafruit_products_5425-04.jpg?1690378820)

As if that weren't enough, we've also added[&nbsp;SparkFun qwiic](https://www.sparkfun.com/qwiic)&nbsp;compatible&nbsp;**[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt)**&nbsp;connectors for the I2C bus&nbsp; **so you don't even need to solder.** &nbsp;Just wire up to your favorite micro with a plug-and-play cable to get ToF data ASAP. For a no-solder experience,&nbsp;[just wire up to your favorite micro, like the STM32F405 Feather](https://www.adafruit.com/product/4382)&nbsp;using a&nbsp;[STEMMA QT adapter cable.](https://www.adafruit.com/?q=stemma%20qt%20cable)&nbsp;The Stemma QT connectors also mean the VL53L4CX can be used with our&nbsp;[various associated accessories.](https://www.adafruit.com/?q=JST%20SH%204)&nbsp;[QT Cable is not included, but we have a variety in the shop](https://www.adafruit.com/?q=stemma+qt+cable&sort=BestMatch)

Communicating to the sensor is done over I2C with an API written by ST,&nbsp;[they have an Arduino library with an example for communication here](https://github.com/stm32duino/VL53L4CX).

## Removing the Protective Tape
Warning: 

Using tweezers (or some other appropriate tool), CAREFULLY remove the protective tape over the sensor, as seen in the image below. There is a small tab on the side of the tape that you can use to remove it.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/218/medium800/adafruit_products_cropped_P1330260.png?1651243151)

# Adafruit VL53L4CX Time of Flight Distance Sensor

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/111/216/medium800/adafruit_products_doubleView.png?1651242246)

Info: 

## Power Pins

- **VIN** &nbsp;- This is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 3V microcontroller like a Feather M4, use 3V, or for a 5V microcontroller like Arduino, use 5V.
- **GND** &nbsp;- This is common ground for power and logic.

## I2C Logic Pins

The default I2C address for the VL53L4CX is&nbsp; **0x29**.

- **SCL&nbsp;** - I2C clock pin, connect to your microcontroller I2C clock line. There's a&nbsp; **10K pullup** &nbsp;on this pin.
- **SDA&nbsp;** - I2C data pin, connect to your microcontroller I2C data line. There's a&nbsp; **10K pullup** &nbsp;on this pin.
- [**STEMMA QT**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) **&nbsp;-&nbsp;** These connectors allow you to connect to development boards with&nbsp; **STEMMA QT** &nbsp;connectors or to other things with&nbsp;[various associated accessories](https://www.adafruit.com/category/619).

## Other Pins

- **GPIO** &nbsp;- This is the interrupt output pin, it is 2.8V logic level output - it can be read by 3.3V and most 5V logic microcontrollers.
- **XSHUT** &nbsp;- This is the shutdown pin. It is active low, and is logic-level shifted so you can use 3V or 5V logic.

## Power LED and Jumper

- **Power LED -** This LED is a green LED located on the front of the board. It is labeled&nbsp; **on**.
- **LED jumper** &nbsp;- This jumper is located on the back of the board. Cut the trace on this jumper to cut power to the "on" LED.

# Adafruit VL53L4CX Time of Flight Distance Sensor

## Arduino

Using the VL53L4CX&nbsp;with Arduino involves wiring up the sensor to your Arduino-compatible microcontroller, installing the&nbsp;[STM32duino VL53L4CX](https://github.com/stm32duino/VL53L4CX)&nbsp;library and running the provided example code.

Warning: 

## Wiring

Wire as shown for a&nbsp; **5V** &nbsp;board. If you are using a **&nbsp;3V** &nbsp;board, like an Adafruit Feather, wire the board's **3V** pin to the VL53L4CX **VIN**.

Here is an Adafruit Metro Express wired up to the VL53L4CX using the STEMMA QT connector:

- **Board 5V** &nbsp;to&nbsp; **sensor&nbsp;**** VIN (red wire)**  
- **Board GND** &nbsp;to&nbsp; **sensor** &nbsp;**GND (black wire)**  
- **Board SCL** &nbsp;to&nbsp; **sensor** &nbsp;**SCL (yellow wire)**  
- **Board SDA** &nbsp;to&nbsp; **sensor** &nbsp;**SDA (blue wire)**

![adafruit_products_arduinoStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/111/705/medium640/adafruit_products_arduinoStemma_bb.png?1652453745)

Here is an Adafruit Metro Express wired up using a solderless breadboard:

- **Board 5V** &nbsp;to&nbsp; **sensor&nbsp;**** VIN (red wire)**  
- **Board GND** &nbsp;to&nbsp; **sensor** &nbsp;**GND (black wire)**  
- **Board SCL** &nbsp;to&nbsp; **sensor** &nbsp;**SCL (yellow wire)**  
- **Board SDA** &nbsp;to&nbsp; **sensor** &nbsp;**SDA (blue wire)**

![adafruit_products_metroExpressBB_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/111/706/medium640/adafruit_products_metroExpressBB_bb.png?1652453764)

## Library Installation

You can install the&nbsp; **VL53L4CX** &nbsp;library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/222/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1651245364)

Click the&nbsp; **Manage Libraries ...** &nbsp;menu item, search for&nbsp; **VL53L4CX** ,&nbsp;and select the&nbsp; **STM32duino VL53L4CX** &nbsp;library:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/224/medium800/adafruit_products_libSearch.png?1651246720)

## Load Example

Open up&nbsp; **File** &nbsp; **-\> Examples -\> STM32duino VL53L4CX -\> VL53L4CX\_Sat\_HelloWorld&nbsp;** and upload to your Arduino wired to the sensor.

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/111/223/medium800/adafruit_products_theLoopArduino.png?1651245481)

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You should see the values from the sensor being printed out. The values read in the example are:

- `Count` - number of readings sent to the Serial Monitor
- `Objs` - Number of objects in front of the sensor
- `status` - Range status of the sensor
- `D` - Measurement of distance of an object from the sensor in millimeters
- `Signal` - Rate of the signal from the sensor
- `Ambient` - Ambient noise around the sensor

![](https://cdn-learn.adafruit.com/assets/assets/000/111/225/medium800/adafruit_products_serialArduino.png?1651247965)

# Adafruit VL53L4CX Time of Flight Distance Sensor

## Arduino Docs

# Adafruit VL53L4CX Time of Flight Distance Sensor

## WipperSnapper

![](https://cdn-learn.adafruit.com/assets/assets/000/132/869/medium800/adafruit_products_01_DeviceList.png?1727952029)

## What is WipperSnapper

WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to [Adafruit IO](https://io.adafruit.com/), a web&nbsp;platform designed ([by Adafruit!](https://www.adafruit.com/about)) to&nbsp;_display_,&nbsp;_respond_, and&nbsp;_interact_&nbsp;with your project's data.

Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add&nbsp;_components_&nbsp;to your board such as buttons, switches, potentiometers, sensors, and more! Components are&nbsp;_dynamically&nbsp;_added to hardware, so you can&nbsp;immediately start interacting, logging, and streaming the data your projects produce without writing code.

If you've never used WipperSnapper, click below to read through the quick start guide before continuing.

[Quickstart: Adafruit IO WipperSnapper](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)
## Wiring
First, wire up a VL53L4CX to your board exactly as follows. Here is an example of the VL53L4CX wired to an&nbsp;[Adafruit ESP32 Feather V2](https://www.adafruit.com/product/5400)&nbsp;using I2C&nbsp;[with a STEMMA QT cable (no soldering required)](https://www.adafruit.com/product/4210)

- **Board 3V** &nbsp;to&nbsp;**sensor VIN (red wire on STEMMA QT)**  
- **Board GND** &nbsp;to&nbsp;**sensor GND (black wire on STEMMA QT)**  
- **Board SCL** &nbsp;to&nbsp;**sensor SCL (yellow wire on STEMMA QT)**  
- **Board SDA** &nbsp;to&nbsp;**sensor SDA (blue wire on STEMMA QT)**

![adafruit_products_featherV2_VL53L4CX_STEMMAQT_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/129/958/medium640/adafruit_products_featherV2_VL53L4CX_STEMMAQT_bb.png?1715373906)

![adafruit_products_featherV2_VL53L4CX_Breadboard_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/129/959/medium640/adafruit_products_featherV2_VL53L4CX_Breadboard_bb.png?1715373953)

## Usage

Connect your board to Adafruit IO Wippersnapper and **[navigate to the WipperSnapper board list](https://io.adafruit.com/wippersnapper).**

On this page, **select the WipperSnapper board you're using** to be brought to the board's interface page.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/870/medium800/adafruit_products_02_DeviceSelection.png?1727961889)

If you do not see your board listed here - you need [to connect your board to Adafruit IO](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper) first.

On the device page, quickly&nbsp; **check that you're running the latest version of the WipperSnapper firmware**.

The device tile on the left indicates the version number of the firmware running on the connected board.

- **If the firmware version is green with a checkmark -** &nbsp;continue with this guide.
- **If the firmware version is red with an "X" -** &nbsp;[update to the latest WipperSnapper firmware](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)&nbsp;on your board before continuing.

![adafruit_products_04_LatestVersion.png](https://cdn-learn.adafruit.com/assets/assets/000/132/871/medium640/adafruit_products_04_LatestVersion.png?1727961963)

![adafruit_products_04_UpdateRequired.png](https://cdn-learn.adafruit.com/assets/assets/000/132/872/medium640/adafruit_products_04_UpdateRequired.png?1727961986)

Next, make sure the sensor is plugged into your board and click the **&nbsp;I2C Scan&nbsp;** button.

![](https://cdn-learn.adafruit.com/assets/assets/000/113/177/medium800/sensor_page_crop_scan.png?1657724520)

You should see the VL53L4CX's default I2C address of&nbsp;`0x14`&nbsp;pop-up in the I2C scan list.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/873/medium800/adafruit_products_Screenshot_2024-10-03_at_14.28.57.png?1727962189)

###  I don't see the sensor's I2C address listed! 


First, double-check the connection and/or wiring between the sensor and the board.

Then, reset the board and let it re-connect to Adafruit IO WipperSnapper.

With the sensor detected in an I2C scan, you're ready to add the sensor to your board.

**Click the New Component button or the + button** to bring up the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/931/medium800/sensor_page_temperature___humidity_06_AddComponent.png?1708631009)

Adafruit IO supports a large amount of components. To quickly find your sensor, type&nbsp;`VL53L4CX`&nbsp;into the search bar, then select the&nbsp; **VL53L4CX** &nbsp;component.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/867/medium800/adafruit_products_lvQpeoFFx6.png?1727903759)

On the component configuration page, the VL53L4CX's sensor address should be listed along with the sensor's settings.

The&nbsp; **Send Every** &nbsp;option is specific to each sensor's measurements. This option will tell the Feather how often it should read from the VL53L4CX sensor and send the data to Adafruit IO. Measurements can range from every 30 seconds to every 24 hours.

For this example, set the&nbsp; **Send Every&nbsp;** interval to every 30 seconds.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/868/medium800/adafruit_products_utTvSpQd5J.png?1727903835)

Your device interface should now show the sensor components you created. After the interval you configured elapses, WipperSnapper will automatically read values from the sensor(s) and send them to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/876/medium800/adafruit_products_7vdtZTeZ6v.png?1727962967)

To view the data that has been logged from the sensor, click on the graph next to the sensor name.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/875/medium800/adafruit_products_d3qIBhOlpt.png?1727962609)

Here you can see the feed history and edit things about the feed such as the name, privacy, webhooks associated with the feed and more. If you want to learn more about how feeds work, [check out this page](https://learn.adafruit.com/all-the-internet-of-things-episode-four-adafruit-io/advanced-feeds).

![](https://cdn-learn.adafruit.com/assets/assets/000/132/877/medium800/adafruit_products_5l5ObBDQJf.png?1727962987)

# Adafruit VL53L4CX Time of Flight Distance Sensor

## Downloads

## Files

- [VL53L4CX Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/111/219/original/vl53l4cx.pdf?1651243306)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-VL53L4CX-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20VL53L4CX.fzpz)

# Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/111/221/medium800/adafruit_products_schem.png?1651244155)

![](https://cdn-learn.adafruit.com/assets/assets/000/111/220/medium800/adafruit_products_boardFile.png?1651244119)


## Primary Products

### Adafruit VL53L4CX Time of Flight Distance Sensor - ~1 to 6000mm

[Adafruit VL53L4CX Time of Flight Distance Sensor - ~1 to 6000mm](https://www.adafruit.com/product/5425)
The&nbsp; **Adafruit VL53L4CX Time of Flight Sensor** &nbsp;is another great&nbsp;_Time of Flight_&nbsp;distance sensor from ST in the VL5 series of chips, this one is great for **long distances -** it goes up to 6 meters compared with 4 meter max of the...

In Stock
[Buy Now](https://www.adafruit.com/product/5425)
[Related Guides to the Product](https://learn.adafruit.com/products/5425/guides)

## Featured Products

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic

[JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic](https://www.adafruit.com/product/4398)
This cable will make it super easy to use our plug-and-play STEMMA QT boards with boards like Circuit Playground. On one end you get a Qwiic / STEMMA QT connector (technically known as a JST SH 4-pin plug)&nbsp; into 4 individual wires with grippy alligator clips. We're carrying these to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4398)
[Related Guides to the Product](https://learn.adafruit.com/products/4398/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long](https://www.adafruit.com/product/4401)
This 4-wire cable is a little over 200mm / 7.8" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4401)
[Related Guides to the Product](https://learn.adafruit.com/products/4401/guides)
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)

## Related Guides

- [Adafruit ESP32-S3 TFT Feather](https://learn.adafruit.com/adafruit-esp32-s3-tft-feather.md)
- [Adafruit Si5351 Clock Generator Breakout](https://learn.adafruit.com/adafruit-si5351-clock-generator-breakout.md)
- [Adafruit MCP9601 I2C Thermocouple Amplifier](https://learn.adafruit.com/adafruit-mcp9601.md)
- [Adafruit AW9523 GPIO Expander and LED Driver](https://learn.adafruit.com/adafruit-aw9523-gpio-expander-and-led-driver.md)
- [Adafruit NeoTrellis M4 Express](https://learn.adafruit.com/adafruit-neotrellis-m4.md)
- [Current Limiting Stepper Driver with DRV8871](https://learn.adafruit.com/current-limiting-stepper-driver-with-drv8871.md)
- [Adafruit RP2040 Prop-Maker Feather](https://learn.adafruit.com/adafruit-rp2040-prop-maker-feather.md)
- [Adafruit ENS161 MOX Gas Sensor](https://learn.adafruit.com/adafruit-ens161-mox-gas-sensor.md)
- [Adafruit I2C Quad Rotary Encoder Breakout](https://learn.adafruit.com/adafruit-i2c-quad-rotary-encoder-breakout.md)
- [Match3 Game on the Fruit Jam and  Adafruit Metro RP2350](https://learn.adafruit.com/match3-game-on-metro-rp2350.md)
- [Introducing ItsyBitsy M0 Express](https://learn.adafruit.com/introducing-itsy-bitsy-m0.md)
- [Adafruit TSSP77038 38KHz Infrared IR Demodulator Breakout](https://learn.adafruit.com/adafruit-tssp77038-38khz-infrared-ir-demodulator-breakout.md)
- [No-Code WipperSnapper Water Detection](https://learn.adafruit.com/water-detection-with-wippersnapper.md)
- [Adafruit ENS160 MOX Gas Sensor](https://learn.adafruit.com/adafruit-ens160-mox-gas-sensor.md)
- [Adafruit Hallowing M4](https://learn.adafruit.com/adafruit-hallowing-m4.md)
