Skip to content
My Account

Reference

VL53L0X / VL53L1X Time-of-Flight Distance Sensor Complete Guide

ST Microelectronics' VL53L0X and VL53L1X measure distance by timing a laser pulse's actual flight time, not by inferring it from an echo like an ultrasonic sensor. This guide covers both chips' real specs, wiring one to an ESP32, and which of the two to pick.

2 min read

No ratings yet, be the first.

The VL53L0X and VL53L1X are laser-ranging (Time-of-Flight, ToF) distance sensors from STMicroelectronics, sold on small breakout boards by Adafruit, Pololu and others. Unlike the ultrasonic HC-SR04, they measure distance by timing a laser pulse’s actual round-trip flight time, giving accurate, narrow-beam readings that work on small or soft targets an ultrasonic sensor can miss.

VL53L0X vs. VL53L1X: real differences

VL53L0XVL53L1X
Max range~1.2m (up to ~2m in long-range mode)~4m
Field of view25° fixed15°–27°, programmable
Ranging speedup to 50Hzup to 50Hz
I2C address (default)0x290x29

They are not interchangeable drop-ins, the VL53L1X’s library API differs from the VL53L0X’s. Pick the L1X if you need range beyond ~1.2m or a narrower, adjustable field of view, otherwise the cheaper, more common L0X is fine for most robotics/proximity projects.

Pinout and Wiring to an ESP32

PinFunctionESP32 Pin
VINPower, 3.3V–5V (breakout-regulated)3.3V
GNDGroundGND
SDAI2C dataGPIO21
SCLI2C clockGPIO22
XSHUTShutdown (active-low), used to assign a unique address when running multiple sensors on one busany free GPIO (optional)
GPIO1Interrupt output on new-data-ready (optional)any free GPIO (optional)

Both chips default to I2C address 0x29. Running more than one on the same bus requires holding all but one in reset via XSHUT, bringing that one up, changing its address in software, then releasing the next, a real, common gotcha for multi-sensor proximity arrays.

Arduino Code Example

VL53L0X (Adafruit_VL53L0X library)

#include <Wire.h>
#include "Adafruit_VL53L0X.h"

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22);
  if (!lox.begin()) {
    Serial.println("Failed to find VL53L0X");
    while (1) delay(10);
  }
}

void loop() {
  VL53L0X_RangingMeasurementData_t measure;
  lox.rangingTest(&measure, false);
  if (measure.RangeStatus != 4) {
    Serial.print("Distance (mm): ");
    Serial.println(measure.RangeMilliMeter);
  } else {
    Serial.println("Out of range");
  }
  delay(200);
}

Install “Adafruit VL53L0X” for the L0X, or “Adafruit VL53L1X” for the L1X, both via the Arduino Library Manager, their APIs differ so example code isn’t directly portable between the two chips.

Practical Applications

  • Robotics obstacle avoidance: narrower beam than ultrasonic, less prone to false readings off soft/angled surfaces.
  • Liquid level sensing: measuring distance down to a surface through open air.
  • Gesture/proximity detection: fast enough ranging rate for hand-wave detection.
  • Tank/bin fill-level monitoring: the VL53L1X’s longer range suits larger containers.

Conclusion

Both chips give you accurate, narrow-beam laser distance sensing over I2C with almost no external components needed. Pick the VL53L0X for short-range, low-cost projects, or the VL53L1X when you need real range beyond about a meter, and pair either with an ESP32 for a compact proximity sensor.

Advertisement

Related

All guides

More guides

Keep building.

From ESP32 HomeKit accessories to Arduino and ATtiny reference guides, there’s more where this came from.

All guides