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.

  • Supply voltage3.3 V
  • Maximum supply voltage5 V
  • InterfaceI2C
  • I2C address0x29
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.
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.

VL53L0X ToF pinout

tinkered.ai/components/vl53l0x-tofVL53L0X ToFVCCPowerGNDGroundSCLI2C SCLSDAI2C SDAGPIO1DigitalXSHUTDigital
PinFunctionType
VCCVCC (3-5V)3.3 V (max 5 V)power in
GNDGNDpower in
SCLI2C SCLbidirectional
SDAI2C SDAbidirectional
GPIO1Digitaloutput
XSHUTDigitalinput

How to wire the VL53L0X ToF

Pin by pin, for the board you have.

VL53L0X ToFArduino UnoNote
VCC5V
GNDGND
SCLSCL
SDASDA
Open this circuit on an Arduino UnoThe full Arduino Uno guide

VL53L0X ToF code

Every example here compiles for its board.

Libraries: pololu/VL53L0X, adafruit/Adafruit_VL53L0X
// 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

Before you wire it

Do
  • Wire to the board-agnostic SDA/SCL pins, never the raw analog pins.
  • The GY / CJMCU breakout has on-board SDA/SCL pull-ups (registered on the part): do not add external pull-up resistors.
  • Fixed default I2C address 0x29. begin() needs no address argument.
  • 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).
  • 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.
Don’t
  • No external I2C pull-up resistors: the module already has them on-board.
  • No tying XSHUT to GND (holds the sensor in reset → it won't answer on I2C).
  • 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.

Specifications

Supply voltage
3.3 V
Maximum supply voltage
5 V
Interface
I2C
I2C address
0x29
On-board I2C pull-ups
Yes
Dimensions
25.2 × 10.6 × 5 mm
Weight
2 g

From the GY / CJMCU breakout (ST VL53L0X)'s datasheet, published by GY / CJMCU breakout (ST VL53L0X).

Common mistakes

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

VL53L0X ToF 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.

Build something with the VL53L0X ToF

  • Robot obstacle avoidance

    Mount one or several VL53L0X sensors as forward or side range finders for wall following and collision avoidance, using reflectance-independent readings that beat simple IR proximity modules.

    Build this
  • Touchless faucet or dispenser

    Detect a hand entering the sensor's cone and fire an interrupt on GPIO1 to trigger a pump or valve for a no-touch faucet or soap dispenser.

    Build this
  • 1D gesture control

    Read changing distance over time to recognize hand swipes and hover gestures for a contactless dimmer, volume knob, or menu scroller.

    Build this
  • Tank and bin level monitor

    Aim the sensor down into a container and convert measured distance to fill level for water tanks, feed hoppers, or waste bins, then log or alert over I2C.

    Build this
  • Presence and proximity wake

    Use the sensor to detect a user approaching a display or laptop and wake it, saving power while people are away.

    Build this
For AI assistants

This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/vl53l0x-tof.md

What will you build with it?