VL53L0X ToF with an Arduino Uno

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.

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 chip runs from 2.6 V to 3.5 V, so the Uno's 5V only suits a breakout with a regulator, as most GY-VL53L0XV2 boards have; a board without one runs from the Uno's 3.3V pin. It talks I2C on A4 and A5 at 0x29, at up to 400 kHz, which is also the Uno's top I2C speed.

Wiring the VL53L0X ToF to the Arduino Uno

Pin by pin.

VL53L0X ToFArduino Uno
VCC5V
GNDGND
SCLSCL
SDASDA

What to know on the Arduino Uno

  • The chip's 2.6 V to 3.5 V supply rules out the Uno's 5V on a bare module; the breakout's regulator is what makes the 5V wiring safe. It draws about 19 mA while ranging, light work for the Uno's 5V pin.ST VL53L0X datasheet DocID029104 Rev 2, pp. 6, 23
  • Both the sensor and the Uno's two-wire interface top out at 400 kHz; Wire.setClock(400000) after Wire.begin() shortens each reading's bus time.ST VL53L0X datasheet DocID029104 Rev 2, p. 1; Microchip ATmega328P datasheet DS40002061B, TWI section
  • Every VL53L0X starts at 0x29. To use several on one Uno, wire each one's XSHUT to its own digital pin, hold all but one in reset, and give each a new address with setAddress() as it wakes: each extra sensor costs one Uno pin.ST VL53L0X datasheet DocID029104 Rev 2, p. 18
  • readRangeSingleMillimeters() waits for the measurement to finish, so the Uno does nothing else meanwhile. startContinuous() and readRangeContinuousMillimeters() let loop() keep running between readings.Pololu VL53L0X library reference

VL53L0X ToF code for the Arduino Uno

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

Libraries: pololu/VL53L0X, adafruit/Adafruit_VL53L0X
// VL53L0X ToF on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/vl53l0x-tof/arduino-uno
#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);
}

VL53L0X ToF on the Arduino Uno: questions

Can I connect a VL53L0X to the Arduino Uno's 5V?

On a regulated breakout such as the GY-VL53L0XV2, yes. The chip itself runs from 2.6 V to 3.5 V (ST datasheet, p. 6), so a bare module needs 3.3 V.

How do I use two VL53L0X sensors on one Arduino Uno?

Both start at address 0x29. Wire each XSHUT to a Uno digital pin, enable one sensor at a time and call setAddress() to move it, then enable the next.

Why does my VL53L0X sketch report a timeout on the Uno?

The sensor did not answer within setTimeout(500): check SDA on A4, SCL on A5, the 5V supply to the breakout, and that XSHUT is not tied to GND.

Keep going

For AI assistants

This guide as plain Markdown. /components/vl53l0x-tof/arduino-uno.md

What will you build with it?