

The VL53L0X is a time-of-flight (ToF) distance sensor that uses laser technology to measure distances with high accuracy and speed. It operates by emitting an infrared laser and calculating the time it takes for the light to reflect back to the sensor. This compact and efficient sensor can measure distances ranging from 30 mm to 2 meters, making it ideal for a variety of applications.








The VL53L0X is a highly integrated sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 2.6V to 3.5V |
| Communication Interface | I²C |
| Measurement Range | 30 mm to 2000 mm |
| Accuracy | ±3% |
| Field of View (FoV) | 25° |
| Operating Temperature | -20°C to +70°C |
| Power Consumption (Active) | ~20 mW |
| Dimensions | 4.4 mm x 2.4 mm x 1.0 mm |
The VL53L0X has six pins, as described in the table below:
| Pin Name | Pin Number | Description |
|---|---|---|
| VIN | 1 | Power supply input (2.6V to 5.5V) |
| GND | 2 | Ground |
| SDA | 3 | I²C data line |
| SCL | 4 | I²C clock line |
| XSHUT | 5 | Shutdown pin (active low) |
| GPIO1 | 6 | Interrupt output or programmable GPIO |
0x29. If using multiple sensors, you must change their addresses by toggling the XSHUT pin and reprogramming the address.Below is an example of how to use the VL53L0X with an Arduino UNO. This code uses the Adafruit VL53L0X library, which can be installed via the Arduino Library Manager.
#include <Wire.h>
#include <Adafruit_VL53L0X.h>
// Create an instance of the VL53L0X sensor
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
void setup() {
Serial.begin(9600); // Initialize serial communication
while (!Serial) {
delay(10); // Wait for the serial monitor to open
}
Serial.println("VL53L0X Test");
// Initialize the sensor
if (!lox.begin()) {
Serial.println("Failed to initialize VL53L0X! Check connections.");
while (1); // Halt execution if initialization fails
}
}
void loop() {
VL53L0X_RangingMeasurementData_t measure;
// Perform a distance measurement
lox.rangingTest(&measure, false);
// Check if the measurement is valid
if (measure.RangeStatus != 4) { // 4 indicates an out-of-range error
Serial.print("Distance (mm): ");
Serial.println(measure.RangeMilliMeter);
} else {
Serial.println("Out of range");
}
delay(100); // Wait 100 ms before the next measurement
}
Sensor Not Detected on I²C Bus
Inaccurate Distance Measurements
Out-of-Range Errors
Sensor Initialization Fails
Can I use multiple VL53L0X sensors on the same I²C bus? Yes, but you must assign a unique I²C address to each sensor by toggling the XSHUT pin during initialization.
What is the maximum measurement frequency? The VL53L0X can perform up to 50 measurements per second, depending on the configuration.
Does the sensor work in complete darkness? Yes, the VL53L0X uses an infrared laser, so it does not rely on ambient light for measurements.
Is the laser eye-safe? Yes, the VL53L0X uses a Class 1 laser, which is safe for human eyes under normal operating conditions.