> Source: https://www.tinkered.ai/components/vl53l0x-tof (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/vl53l0x-tof. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# VL53L0X ToF

A laser time-of-flight distance sensor that measures absolute range up to 2 m over I2C, independent of the target's color or reflectance.

Source page: https://www.tinkered.ai/components/vl53l0x-tof
Datasheet: https://www.st.com/resource/en/datasheet/vl53l0x.pdf

## In short

The VL53L0X is ST's laser time-of-flight distance sensor: it times 940 nm laser pulses to measure absolute range up to 2 m, reports millimeters over I2C at up to 400 kHz, and draws 19 mA on average while ranging (ST VL53L0X datasheet DocID029104 Rev 2, p.1, p.6 and p.23). On a GY-VL53L0XV2 breakout, wire VCC to 3.3V or 5V, GND to GND, and SDA and SCL to the board's I2C pins; libraries talk to it at the 7-bit address 0x29 (0x52 in the datasheet's 8-bit form, p.18). The chip itself runs from 2.6 to 3.5V (p.6), so only a regulated breakout takes 5V.

The VL53L0X is ST's second-generation FlightSense time-of-flight (ToF) ranging module. Instead of estimating distance from reflected light intensity like an IR proximity sensor, it emits invisible 940 nm laser pulses from a VCSEL and times how long the photons take to return to an on-chip array of Single Photon Avalanche Diodes (SPADs). Because it measures elapsed time rather than brightness, it gives an absolute distance whatever the target's reflectance, though darker targets shorten the maximum range.

An embedded microcontroller runs the whole ranging pipeline and exposes results over I2C, so the host only reads a distance in millimeters. The device measures absolute range up to 2 m with a 25 degree field of view, and it is a Class 1 laser product under IEC 60825-1:2014. Ranging behavior is set through a timing budget and four profiles: default (30 ms, 1.2 m), high speed (20 ms, 1.2 m), high accuracy (200 ms, 1.2 m within ±3%), and long range (33 ms, 2 m in the dark).

On this GY/CJMCU-style breakout the bare ST chip sits behind an onboard voltage regulator and I2C pull-ups, so the board runs from a 3.3-5V supply. Two extra pins expose the sensor's control lines: XSHUT, an active-low shutdown input, and GPIO1, an open-drain interrupt output for data-ready or threshold events.

## Agent rules

Follow these when you wire this part or write code for it.

- Do: Wire to the board-agnostic SDA/SCL pins, never the raw analog pins.
- Do: The GY / CJMCU breakout has on-board SDA/SCL pull-ups (registered on the part): do not add external pull-up resistors.
- Do: Fixed default I2C address 0x29. begin() needs no address argument.
- Do: GPIO1 (interrupt) and XSHUT (shutdown) are OPTIONAL: the library polls status over I2C, so a basic distance sketch needs only VCC/GND/SCL/SDA. Leave GPIO1 unconnected; leave XSHUT unconnected (the breakout pulls it up).
- Do: On ESP32 with a second I2C device, DAISY-CHAIN the bus through the VL53L0X's own pins: do not fan each net out from the ESP32 pins.
- Never: No external I2C pull-up resistors: the module already has them on-board.
- Never: No tying XSHUT to GND (holds the sensor in reset → it won't answer on I2C).

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| VCC | VCC (3-5V) · 3.3 V (max 5 V) | power in |
| GND | GND | power in |
| SCL | I2C SCL | bidirectional |
| SDA | I2C SDA | bidirectional |
| GPIO1 | Digital | output |
| XSHUT | Digital | input |

## Wiring

### Arduino Uno

| VL53L0X ToF | Arduino Uno | Note |
| --- | --- | --- |
| VCC | 5V |  |
| GND | GND |  |
| SCL | SCL |  |
| SDA | SDA |  |

### ESP32 DevKit V1

| VL53L0X ToF | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VCC | 3V3 |  |
| GND | GND |  |
| SCL | GPIO22 (D22) |  |
| SDA | GPIO21 (D21) |  |

### Raspberry Pi Pico

| VL53L0X ToF | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VCC | 3V3 |  |
| GND | GND |  |
| SCL | GP5 |  |
| SDA | GP4 |  |

## Code

### Arduino Uno

Libraries: pololu/VL53L0X, adafruit/Adafruit_VL53L0X

```cpp
// VL53L0X ToF on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/vl53l0x-tof
#include <Wire.h>
#include <VL53L0X.h>

VL53L0X sensor;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  if (!sensor.init()) {                 // reads model id 0xEE at 0x29
    Serial.println("VL53L0X not found");
    while (1) {}
  }
  sensor.setTimeout(500);
}

void loop() {
  uint16_t mm = sensor.readRangeSingleMillimeters();
  if (sensor.timeoutOccurred()) {
    Serial.println("VL53L0X timeout");  // no answer in 500 ms: wiring or power
  } else if (mm >= 8190) {
    Serial.println("out of range");     // no target within range
  } else {
    Serial.print(mm);
    Serial.println(" mm");
  }
  delay(200);
}
```

Compiled for arduino:avr:uno on 2026-10-30.

### ESP32 DevKit V1

Libraries: pololu/VL53L0X, adafruit/Adafruit_VL53L0X

```cpp
// VL53L0X ToF on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/vl53l0x-tof
#include <Wire.h>
#include <VL53L0X.h>

VL53L0X sensor;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  if (!sensor.init()) {                 // reads model id 0xEE at 0x29
    Serial.println("VL53L0X not found");
    while (1) {}
  }
  sensor.setTimeout(500);
}

void loop() {
  uint16_t mm = sensor.readRangeSingleMillimeters();
  if (sensor.timeoutOccurred()) {
    Serial.println("VL53L0X timeout");  // no answer in 500 ms: wiring or power
  } else if (mm >= 8190) {
    Serial.println("out of range");     // no target within range
  } else {
    Serial.print(mm);
    Serial.println(" mm");
  }
  delay(200);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

### Raspberry Pi Pico

Libraries: pololu/VL53L0X, adafruit/Adafruit_VL53L0X

```cpp
// VL53L0X ToF on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/vl53l0x-tof
#include <Wire.h>
#include <VL53L0X.h>

VL53L0X sensor;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  if (!sensor.init()) {                 // reads model id 0xEE at 0x29
    Serial.println("VL53L0X not found");
    while (1) {}
  }
  sensor.setTimeout(500);
}

void loop() {
  uint16_t mm = sensor.readRangeSingleMillimeters();
  if (sensor.timeoutOccurred()) {
    Serial.println("VL53L0X timeout");  // no answer in 500 ms: wiring or power
  } else if (mm >= 8190) {
    Serial.println("out of range");     // no target within range
  } else {
    Serial.print(mm);
    Serial.println(" mm");
  }
  delay(200);
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Supply voltage | 3.3 V | Tinkered component registry |
| Maximum supply voltage | 5 V | Tinkered component registry |
| Interface | I2C | Tinkered component registry |
| I2C address | 0x29 | Tinkered component registry |
| On-board I2C pull-ups | Yes | Tinkered component registry |
| Dimensions | 25.2 × 10.6 × 5 mm | Tinkered component registry |
| Weight | 2 g | Tinkered component registry |

## Circuit notes

- Power the breakout's VCC from 3.3-5V; the onboard regulator feeds the sensor. The bare VL53L0X operates from 2.6-3.5V with a 3.6V absolute maximum on its supply and on SDA, SCL, XSHUT and GPIO1, so never wire 5V straight to a bare chip.
- Connect SDA and SCL to the host's I2C bus (up to 400 kHz). The GY breakout already carries I2C pull-up resistors, so do not add your own on the same bus.
- The default 7-bit I2C address is 0x29 (written as 0x52 in the datasheet's 8-bit form). Every VL53L0X ships with this same address, and a new address set in software is lost at every power cycle.
- To run more than one VL53L0X on a single bus, hold each sensor's XSHUT low at boot, then bring the sensors up one at a time and assign a unique address before enabling the next.
- XSHUT must be driven or pulled up, never left floating; ST recommends 10k pull-ups on XSHUT and GPIO1, and the breakout fits a pull-up on XSHUT so a single sensor works with it unconnected. Holding XSHUT low keeps the sensor in hardware standby.
- GPIO1 is an open-drain interrupt output. Use it for data-ready or window/threshold interrupts instead of polling, or leave it unconnected and poll over I2C.
- The sensor boots in 1.2 ms at most, and the typical timing budget per measurement is 33 ms. A longer timing budget yields longer range and better accuracy at a lower sample rate.

## Common mistakes

- **Feeding 5V to a bare VL53L0X chip.** The 3.3-5V rating belongs to the breakout's regulator, not the sensor. The VL53L0X operates at 2.6-3.5V and its pins are rated to 3.6V absolute maximum. Only the regulated breakout accepts 5V on VCC.
- **Putting two sensors on one bus at 0x29.** All VL53L0X units power up at address 0x29, so a second one causes an address clash. Use XSHUT to enable them one at a time and reprogram addresses, and repeat that after every power-up because the new address is not stored.
- **Mixing up the 7-bit and 8-bit address.** The datasheet lists 0x52 (8-bit), while most Arduino and Python libraries expect the 7-bit form 0x29. Passing the wrong one means the sensor never ACKs and scans come up empty.
- **Expecting a full 2 m in the default profile.** The default ranging profile is specified to 1.2 m. Reaching 2 m requires the long-range profile, no infrared interference (indoors, away from sunlight), and a bright target: ST's table gives 80 cm typical on a 17% grey target.
- **Tying XSHUT to GND.** XSHUT is active LOW: holding it at ground keeps the sensor in hardware standby, so it never answers on I2C. Leave it to the breakout's pull-up for a single sensor, or drive it from a GPIO when you need shutdown control or multi-sensor addressing.

## Questions

### Can I use the VL53L0X with a 5V Arduino?

Yes, on a breakout with a regulator such as the GY-VL53L0XV2: power VCC from 5V or 3.3V and wire SDA and SCL directly. The bare chip is a 2.6-3.5V part with a 3.6V absolute maximum on its pins (ST VL53L0X datasheet, p.6 and p.22), so a raw chip on a custom board must stay on a 2.8V or 3.3V rail.

### What is the real range of the VL53L0X?

Up to 2 m in the long-range profile, indoors, on a white target; ST's table gives 120 cm minimum and 200 cm+ typical on 88% white, and 80 cm typical on 17% grey, falling to 50-80 cm outdoors on an overcast day (p.26). The default profile is specified to 1.2 m (p.28).

### How fast can the VL53L0X measure?

The typical timing budget is 33 ms per range, the high-speed profile uses 20 ms, and the minimum range measurement period is 8 ms (p.15 and p.28). Longer budgets, such as 200 ms in the high-accuracy profile, trade speed for accuracy within ±3% (p.28).

### How do I use two VL53L0X sensors on one I2C bus?

Every sensor starts at 0x29. Wire each XSHUT to its own GPIO, hold them all LOW, then release one at a time and give it a new address with your library's setAddress(). The address is not permanent, so the sequence runs at every power-up (Adafruit VL53L0X guide).

### Why does my VL53L0X give out-of-range or no readings?

An out-of-range result usually means no target within reach or strong infrared light such as sunlight; the long-range figures assume no infrared (p.26). If the I2C scan finds nothing, check that XSHUT is not held LOW, that SDA and SCL are not swapped, and that no other device sits at 0x29.

### VL53L0X vs HC-SR04: which distance sensor is better?

The VL53L0X is a laser sensor with a 25 degree field of view, millimeter output over I2C and a 2 m maximum (p.1 and p.27), suited to small robots and gesture sensing. The HC-SR04 ultrasonic sensor reaches about 4 m within a 15 degree measuring angle (ElecFreaks HC-SR04 datasheet), needs 5V and uses two GPIO pins for its trigger and echo timing.

## Related parts

- [HC-SR04](https://www.tinkered.ai/components/hc-sr04.md): same job: measures distance, pulse timing
- [JSN-SR04T](https://www.tinkered.ai/components/jsn-sr04t.md): same job: measures distance, pulse timing
- [Arduino Uno](https://www.tinkered.ai/components/arduino-uno.md): the board its circuit is wired to

## Try it

Tinkered simulates the VL53L0X ToF in the browser: wire it on a 3D breadboard, run your real code on the board, and measure it. Free to start at https://www.tinkered.ai.
