Overview

The VL53L0X is a second-generation Time-of-Flight (ToF) laser-ranging module manufactured by STMicroelectronics under their FlightSense trademark. Unlike traditional IR triangulation sensors or ultrasonic rangefinders, the VL53L0X measures the precise time taken by emitted photons to bounce off an object and return to an array of Single Photon Avalanche Diodes (SPADs).

Equipped with an invisible 940 nm Vertical-Cavity Surface-Emitting Laser (VCSEL) emitter, the VL53L0X measures absolute distances up to 2.0 meters (2000 mm2000\text{ mm}) with millimeter precision, completely independent of target color, surface reflectivity, or ambient lighting conditions. It is the go-to distance sensor for mini sumo robots, drone altitude sensing, gesture recognition, and obstacle avoidance.

Quick reference

Operating voltage (VCC)3.3 V to 5.0 V DC (breakout with onboard LDO)
IC supply voltage (VDD)2.6 V to 3.5 V DC (2.8 V nominal)
InterfaceI2CI^2C (Fast Mode up to 400 kHz)
Default I2CI^2C address0x29 (Software programmable at runtime)
Ranging distance30 mm to 2000 mm (up to 1200 mm in standard mode)
Emitter wavelength940 nm VCSEL (Class 1 Eye-Safe Laser)
Current consumption20 mA active ranging / 5 μA5\ \mu\text{A} standby
Field of View (FoV)25° conical FOV

Pinout

Standard 6-pin 0.1" (2.54 mm) breakout module header:

PinNameTypeDescription
1VCCPowerSupply input (+3.3 V to +5.0 V DC)
2GNDPowerGround (0 V)
3SCLDigital InputI2CI^2C Serial Clock
4SDADigital Input / OutputI2CI^2C Serial Data
5GPIO1 / INTDigital OutputProgrammable interrupt output pin (1.8V to 2.8V logic)
6XSHUT / SHDNDigital InputActive-Low shutdown input (pull low to disable IC)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply Voltage (Module)VCCV_{CC}3.33.3 / 5.05.5VPower input with LDO
Active Supply CurrentICCI_{CC}101940mAActive ranging state
Standby CurrentIsbI_{sb}510µAXSHUT held Low
Ranging Distance (Indoor)DinD_{in}302000mmWhite target 88% reflectance
Ranging Distance (Outdoor)DoutD_{out}30800mmHigh ambient sunlight (20 kLux20\text{ kLux})
Ranging AccuracyDaccD_{acc}-3%±3%\pm 3\%+3%In dark / indoor environment
VCSEL Emitter Peakλpeak\lambda_{peak}930940950nmInvisible Class 1 laser
Measurement Timing Budgettbudgett_{budget}2033200msConfigurable trade-off

I2CI^2C Address Configuration for Multiple Sensors

The VL53L0X uses a fixed hardware I2CI^2C power-on address of 0x29. To connect multiple VL53L0X sensors to a single I2CI^2C bus:

  1. Connect the XSHUT pin of every VL53L0X sensor to a separate GPIO pin on the microcontroller.
  2. Hold all XSHUT pins Low at startup to place all sensors in hardware shutdown.
  3. Bring the XSHUT pin of Sensor #1 High to boot it up.
  4. Send an I2CI^2C software command to reassign Sensor #1's address (e.g. to 0x30).
  5. Bring Sensor #2's XSHUT pin High and reassign its address to 0x31. Repeat for each sensor.

Wiring

VL53L0X PinArduino UnoESP32Notes
VCC5V3.3VOnboard regulator converts to 2.8V
GNDGNDGNDSystem ground
SCLA5GPIO 22I2CI^2C Clock
SDAA4GPIO 21I2CI^2C Data
XSHUTDigital Pin D4GPIO 16Internal pull-up to 2.8V; drive Low for shutdown
GPIO1UnusedUnusedInterrupt output (optional)
Warning

Protective liner notice:

  • New VL53L0X breakout modules ship with an orange or yellow protective plastic film stuck over the optical aperture window.
  • Leaving this protective film attached results in constant false readings of 0–50 mm caused by laser light scattering back into the SPAD array. Remove the film before testing!

Example

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

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
  Serial.begin(115200);
  while (!Serial) { delay(1); }

  Serial.println("Initializing VL53L0X ToF sensor...");
  if (!lox.begin()) {
    Serial.println("Failed to boot VL53L0X! Check wiring/protective film.");
    while (1);
  }
  Serial.println("VL53L0X online.");
}

void loop() {
  VL53L0X_RangingMeasurementData_t measure;
  
  lox.rangingTest(&measure, false); // Pass 'true' to get debug data

  if (measure.RangeStatus != 4) {  // Phase 4 = Out of range
    Serial.print("Distance: ");
    Serial.print(measure.RangeMilliMeter);
    Serial.println(" mm");
  } else {
    Serial.println("Out of range (>2000 mm)");
  }

  delay(100);
}

Common mistakes

  • Leaving the optical protective cover film on: Results in permanent 20–50 mm readings due to internal reflection.
  • Forgetting XSHUT state handling when using multiple sensors: Restarting the MCU resets all VL53L0X sensors back to the default 0x29 address, breaking I2CI^2C communication until re-initialized sequentially.
  • Over-ranging in high ambient sunlight: Direct sunlight contains intense 940 nm infrared radiation that floods the SPAD detector, reducing maximum range down to ~800 mm.

Notes

  • VL53L0X vs HC-SR04: Unlike ultrasonic sensors, the VL53L0X has no minimum blind spot (reads from 30 mm down to 0 mm), is completely silent, and is unaffected by soft acoustic-absorbing fabrics or tilted surfaces.

Assets & downloads