Documentation

VL53L1X Pre-Soldered Time-of-Flight Laser Distance Sensor 400cm for Arduino, Raspberry Pi & ESP32 | ShillehTek Product Manual
Documentation / VL53L1X Pre-Soldered Time-of-Flight Laser Distance Sensor 400cm for Arduino, Raspberry Pi & ESP32 | ShillehTek Product Manual

VL53L1X Pre-Soldered Time-of-Flight Laser Distance Sensor 400cm for Arduino, Raspberry Pi & ESP32 | ShillehTek Product Manual

shillehtekvl53l1x-tof-sensor-4m-pre-soldered-esp32

Overview

The VL53L1X is a laser time-of-flight (ToF) distance sensor: it fires invisible, eye-safe 940 nm laser pulses from a Class 1 VCSEL emitter and times how long the photons take to bounce back. Because it measures light travel time rather than reflected brightness, it reports true distance in millimeters — up to 4 meters — largely independent of the target’s color or surface.

This pre-soldered CJMCU-531 breakout puts ST’s sensor on a board with a regulator and level shifting, so it runs from 3.3 V or 5 V and talks to any board over I2C at address 0x29. Beyond plain ranging it supports three distance modes (short, medium, long), programmable timing budgets up to a 50 Hz output rate, a configurable region-of-interest that narrows its 27° field of view, an interrupt output on GPIO1, and an XSHUT pin for shutdown and multi-sensor address assignment.

It is the natural upgrade from ultrasonic sensors when you need precision, speed, and a tight beam — robot obstacle detection, liquid level, gesture zones, people counting. This manual covers the pinout, wiring for Arduino, ESP32, Raspberry Pi, and Pico, working code for each, and answers on accuracy, multi-sensor setups, and the VL53L0X comparison.

At a Glance

Sensor
ST VL53L1X laser ToF
Range
~4 cm to 400 cm
Interface
I2C, address 0x29
Supply
3.3 – 5 V
Update Rate
Up to 50 Hz
Extras
GPIO1 interrupt · XSHUT

Specifications

Parameter Value
Sensor ST VL53L1X, 940 nm Class 1 VCSEL
Measuring range ~40 mm to 4000 mm (long mode, good conditions)
Distance modes Short (1.3 m) · Medium (3 m) · Long (4 m)
Typical accuracy ±20–25 mm
Field of view 27°, reducible via programmable ROI
Output rate Up to 50 Hz (timing budget dependent)
Interface I2C up to 400 kHz, address 0x29 (changeable)
Supply voltage 3.3 – 5 V (on-board regulator)
Interrupt GPIO1 — data-ready / threshold events
Shutdown XSHUT, active low (also for address setup)
Header 6-pin: VCC · GND · SCL · SDA · GPIO1 · XSHUT
Mounting 2 large tab holes

Pinout Diagram

Six pins along the edge: VCC and GND for power, SCL and SDA for I2C, GPIO1 (the interrupt output — optional), and XSHUT (drive low to shut the sensor down; leave unconnected for single-sensor use). The two large gold-ringed tabs are mounting holes.

VL53L1X time-of-flight distance sensor CJMCU-531 pinout diagram showing VCC, GND, SCL, SDA, GPIO1 and XSHUT pins

Wiring Guide

Arduino Uno Wiring

VL53L1X Pin Arduino Uno Pin Notes
VCC 5V Board regulates internally
GND GND Common ground
SCL A5 I2C clock
SDA A4 I2C data
GPIO1 / XSHUT Unconnected Optional interrupt / shutdown
Keep the window clean. The tiny amber windows are the laser exit and return optics. A fingerprint or dust film scatters light and shortens the usable range noticeably — a dry lens wipe restores it.

ESP32 Wiring

VL53L1X Pin ESP32 Pin Notes
VCC 3V3 3.3 V native
GND GND Common ground
SCL GPIO 22 Default Wire SCL
SDA GPIO 21 Default Wire SDA
GPIO1 Any input (optional) Data-ready interrupt saves polling
Fast ranging fits the ESP32. At a 20 ms timing budget the sensor streams 50 readings per second — comfortable for Wi-Fi dashboards or a fast obstacle-avoidance loop.

Raspberry Pi Wiring

VL53L1X Pin Raspberry Pi Pin Notes
VCC 3.3V (Pin 1) Power
GND GND (Pin 6) Common ground
SCL GPIO 3 (Pin 5) I2C1 clock
SDA GPIO 2 (Pin 3) I2C1 data
Enable I2C first. sudo raspi-config → Interface Options → I2C, then check the sensor appears with i2cdetect -y 1 — you should see 29 in the grid.

Raspberry Pi Pico Wiring

VL53L1X Pin Pico Pin Notes
VCC 3V3(OUT) (Pin 36) Power
GND GND (Pin 38) Common ground
SCL GP5 (Pin 7) I2C0 clock
SDA GP4 (Pin 6) I2C0 data
Driver file needed. MicroPython has no built-in VL53L1X support — copy a vl53l1x.py community driver onto the board alongside your script (Thonny: File → Save As → Raspberry Pi Pico).

Code Examples

Arduino — Continuous Ranging (Pololu Library)

vl53l1x_read.ino
// Library Manager: install "VL53L1X" by Pololu
#include <Wire.h>
#include <VL53L1X.h>

VL53L1X sensor;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  sensor.setTimeout(500);
  if (!sensor.init()) {
    Serial.println("VL53L1X not found - check wiring");
    while (1);
  }
  sensor.setDistanceMode(VL53L1X::Long);      // up to ~4 m
  sensor.setMeasurementTimingBudget(50000);   // 50 ms per reading
  sensor.startContinuous(50);
}

void loop() {
  int mm = sensor.read();
  Serial.print("Distance: ");
  Serial.print(mm);
  Serial.println(" mm");
}

ESP32 — Fast 50 Hz Ranging

esp32_vl53l1x.ino
#include <Wire.h>
#include <VL53L1X.h>

VL53L1X sensor;

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22);          // SDA, SCL
  sensor.setTimeout(500);
  if (!sensor.init()) {
    Serial.println("VL53L1X not found");
    while (1);
  }
  sensor.setDistanceMode(VL53L1X::Short);     // fastest, ~1.3 m
  sensor.setMeasurementTimingBudget(20000);   // 20 ms -> 50 Hz
  sensor.startContinuous(20);
}

void loop() {
  Serial.printf("Distance: %d mm\n", sensor.read());
}

Raspberry Pi — Python

vl53l1x_read.py
import time
import VL53L1X

# pip3 install vl53l1x

tof = VL53L1X.VL53L1X(i2c_bus=1, i2c_address=0x29)
tof.open()
tof.start_ranging(3)   # 1=short, 2=medium, 3=long

try:
    while True:
        mm = tof.get_distance()
        print(f"Distance: {mm} mm ({mm / 10:.1f} cm)")
        time.sleep(0.1)
except KeyboardInterrupt:
    tof.stop_ranging()

Raspberry Pi Pico — MicroPython

pico_vl53l1x.py
from machine import I2C, Pin
import time
from vl53l1x import VL53L1X   # copy vl53l1x.py driver to the board

i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=400000)
print("I2C scan:", [hex(a) for a in i2c.scan()])  # expect 0x29

tof = VL53L1X(i2c)

while True:
    mm = tof.read()
    print("Distance:", mm, "mm")
    time.sleep(0.1)

Frequently Asked Questions

How is the VL53L1X better than the VL53L0X?
Double the range (4 m vs 2 m), faster output (50 Hz vs ~30 Hz), and a programmable region-of-interest that the L0X lacks. Code is similar but not identical — the two chips use different libraries. If your project only ever measures under a meter, the L0X still does the job; for anything longer or faster, the L1X is worth it.
How accurate is it really?
Plan on ±20–25 mm. Accuracy is best on matte, reasonably reflective targets indoors; dark targets (black fabric absorbs 940 nm light) and strong sunlight cut both accuracy and maximum range. A longer timing budget (100–200 ms) noticeably steadies the readings.
Can I use several VL53L1X sensors on one bus?
Yes — that is what XSHUT is for. Wire each sensor’s XSHUT to its own GPIO, hold all sensors in shutdown at boot, then release them one at a time and assign each a new I2C address before releasing the next. Most libraries (Pololu’s included) provide a setAddress call for exactly this dance.
Does it work outdoors or behind glass?
Sunlight is the enemy: its infrared content floods the return signal, so outdoor range drops sharply — short mode is the most sunlight-resistant. Cover glass is possible but must be clean, thin, and ideally mounted per ST’s cover-window guidelines; a dirty or thick window creates false short readings from internal reflections.
What does the 27° field of view mean in practice?
The sensor reports the nearest strong reflection inside a ~27° cone — at 2 m that cone is nearly a meter wide, so a chair edge inside it can “shorten” your wall measurement. Narrow the programmable ROI (down to 4×4 SPADs) to tighten the beam at the cost of some maximum range.
Is the laser safe?
Yes — it is a Class 1 device: the 940 nm VCSEL is eye-safe under all conditions of normal use, emitting pulses at power levels far below the damage threshold. It is invisible to the eye but shows up as a faint dot to most phone cameras, which is a handy way to confirm it is running.
Why do I get 0 or timeout readings?
Check the I2C scan first (0x29 must appear); a missing sensor is wiring or power. If the scan is fine but readings time out, the target may be out of range for the selected distance mode, or the timing budget is shorter than the mode supports — long mode needs at least a 33 ms budget. Very close targets (under ~4 cm) also read unreliably.

Related Tutorials