Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use GY-VL53L0XV2 LASER TOF SENSOR: Examples, Pinouts, and Specs

Image of GY-VL53L0XV2 LASER TOF SENSOR
Cirkit Designer LogoDesign with GY-VL53L0XV2 LASER TOF SENSOR in Cirkit Designer

Introduction

The GY-VL53L0XV2 is a compact and highly accurate time-of-flight (ToF) sensor module that uses laser technology to measure distances. It operates by emitting a laser pulse and calculating the time it takes for the pulse to reflect back to the sensor, enabling precise distance measurements. This sensor is ideal for applications such as robotics, automation, obstacle detection, and proximity sensing. Its small size and low power consumption make it suitable for integration into a wide range of projects.

Explore Projects Built with GY-VL53L0XV2 LASER TOF SENSOR

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266 NodeMCU-Based Smart Eye Pressure Monitor with OLED Display and Wi-Fi Connectivity
Image of Copy of test 2 (7): A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
This circuit features an ESP8266 NodeMCU microcontroller interfaced with a VL53L0X time-of-flight distance sensor, a 0.96" OLED display, a piezo sensor, and a photodiode for light detection. The ESP8266 collects data from the sensors, displays readings on the OLED, and hosts a web server to present the information. It is likely designed for distance measurement, light intensity detection, and pressure sensing, with the capability to monitor and display these parameters in real-time over WiFi.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO R4 WiFi Laser Module with Distance Sensor
Image of KIT 1: SENSOR KIT: A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
This circuit features an Arduino UNO R4 WiFi connected to a VL53L0X distance sensor via I2C for distance measurement. Additionally, a tube laser module is powered by a battery case and controlled through a rocker switch, with a terminal block connector completing the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
A-Star 32U4 Mini Controlled Servo with VL53L8CX Time-of-Flight Distance Sensing
Image of Servo con distance sensor: A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
This circuit features an A-Star 32U4 Mini microcontroller connected to a VL53L8CX Time-of-Flight distance sensor and a servo motor. The microcontroller powers both the sensor and the servo, and it is configured to communicate with the sensor via I2C (using pins 2 and 3 for SDA and SCL, respectively) and to control the servo via a PWM signal on pin 10. The purpose of the circuit is likely to measure distances and respond with movements of the servo based on the sensor readings.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560-Based Multi-Sensor System with Distance, Magnetometer, and Camera Integration
Image of Junior Design - Sensors: A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
This circuit features an Arduino Mega 2560 microcontroller interfaced with multiple VL53L0X distance sensors, an OV7725 camera module, and an Adafruit LIS3MDL triple-axis magnetometer. The Arduino reads data from these sensors and the camera, likely for a robotics or environmental sensing application, and processes the data for further use or transmission.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with GY-VL53L0XV2 LASER TOF SENSOR

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Copy of test 2 (7): A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
ESP8266 NodeMCU-Based Smart Eye Pressure Monitor with OLED Display and Wi-Fi Connectivity
This circuit features an ESP8266 NodeMCU microcontroller interfaced with a VL53L0X time-of-flight distance sensor, a 0.96" OLED display, a piezo sensor, and a photodiode for light detection. The ESP8266 collects data from the sensors, displays readings on the OLED, and hosts a web server to present the information. It is likely designed for distance measurement, light intensity detection, and pressure sensing, with the capability to monitor and display these parameters in real-time over WiFi.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of KIT 1: SENSOR KIT: A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
Arduino UNO R4 WiFi Laser Module with Distance Sensor
This circuit features an Arduino UNO R4 WiFi connected to a VL53L0X distance sensor via I2C for distance measurement. Additionally, a tube laser module is powered by a battery case and controlled through a rocker switch, with a terminal block connector completing the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Servo con distance sensor: A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
A-Star 32U4 Mini Controlled Servo with VL53L8CX Time-of-Flight Distance Sensing
This circuit features an A-Star 32U4 Mini microcontroller connected to a VL53L8CX Time-of-Flight distance sensor and a servo motor. The microcontroller powers both the sensor and the servo, and it is configured to communicate with the sensor via I2C (using pins 2 and 3 for SDA and SCL, respectively) and to control the servo via a PWM signal on pin 10. The purpose of the circuit is likely to measure distances and respond with movements of the servo based on the sensor readings.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Junior Design - Sensors: A project utilizing GY-VL53L0XV2 LASER TOF SENSOR in a practical application
Arduino Mega 2560-Based Multi-Sensor System with Distance, Magnetometer, and Camera Integration
This circuit features an Arduino Mega 2560 microcontroller interfaced with multiple VL53L0X distance sensors, an OV7725 camera module, and an Adafruit LIS3MDL triple-axis magnetometer. The Arduino reads data from these sensors and the camera, likely for a robotics or environmental sensing application, and processes the data for further use or transmission.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

  • Model: GY-VL53L0XV2
  • Measurement Range: 30 mm to 2000 mm (2 meters)
  • Accuracy: ±3% under optimal conditions
  • Operating Voltage: 2.6V to 5.5V
  • Communication Interface: I²C (Inter-Integrated Circuit)
  • I²C Address: Default 0x29 (modifiable)
  • Current Consumption: 10 mA (typical)
  • Field of View (FoV): 25°
  • Operating Temperature: -20°C to +70°C
  • Dimensions: 10 mm x 13 mm

Pin Configuration and Descriptions

The GY-VL53L0XV2 module typically has six pins. Below is the pinout and description:

Pin Name Description
1 VIN Power supply input (2.6V to 5.5V). Connect to the 5V or 3.3V pin of your microcontroller.
2 GND Ground. Connect to the ground of your circuit.
3 SDA I²C data line. Used for communication with the microcontroller.
4 SCL I²C clock line. Used for communication with the microcontroller.
5 XSHUT Shutdown pin. Pull low to put the sensor in shutdown mode.
6 GPIO1 Interrupt pin. Can be used for advanced configurations.

Usage Instructions

How to Use the GY-VL53L0XV2 in a Circuit

  1. Power the Sensor: Connect the VIN pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. I²C Communication: Connect the SDA and SCL pins to the corresponding I²C pins on your microcontroller. Use pull-up resistors (typically 4.7kΩ) if not already present on the module.
  3. Optional Pins:
    • Connect the XSHUT pin to a GPIO pin on your microcontroller if you need to control the sensor's power state.
    • Use the GPIO1 pin for interrupt-based applications if required.
  4. Install Libraries: If using an Arduino, install the VL53L0X library from the Arduino Library Manager for easy integration.

Important Considerations and Best Practices

  • Ensure the sensor is not exposed to direct sunlight or reflective surfaces, as these can interfere with measurements.
  • Avoid placing the sensor too close to the object being measured (minimum range is 30 mm).
  • Use short and properly shielded wires for I²C connections to minimize noise.
  • If multiple VL53L0X sensors are used on the same I²C bus, modify their I²C addresses to avoid conflicts.

Example Code for Arduino UNO

Below is an example of how to use the GY-VL53L0XV2 with an Arduino UNO:

#include <Wire.h>
#include <VL53L0X.h>

// Create an instance of the VL53L0X sensor
VL53L0X sensor;

void setup() {
  Serial.begin(9600); // Initialize serial communication for debugging
  Wire.begin();       // Initialize I²C communication

  // Initialize the sensor
  if (!sensor.init()) {
    Serial.println("Failed to initialize VL53L0X sensor!");
    while (1); // Halt execution if initialization fails
  }

  sensor.setTimeout(500); // Set a timeout for distance measurements
  Serial.println("VL53L0X sensor initialized successfully.");
}

void loop() {
  // Measure distance in millimeters
  uint16_t distance = sensor.readRangeSingleMillimeters();

  // Check for timeout errors
  if (sensor.timeoutOccurred()) {
    Serial.println("Sensor timeout occurred!");
  } else {
    // Print the measured distance
    Serial.print("Distance: ");
    Serial.print(distance);
    Serial.println(" mm");
  }

  delay(100); // Wait 100ms before the next measurement
}

Notes on the Code

  • The VL53L0X library simplifies communication with the sensor.
  • The setTimeout() function prevents the program from hanging if the sensor fails to respond.
  • Modify the delay() value in the loop() function to adjust the measurement frequency.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor Not Detected on I²C Bus:

    • Ensure the SDA and SCL connections are correct.
    • Check for proper pull-up resistors on the I²C lines.
    • Verify the sensor's I²C address (default is 0x29).
  2. Incorrect Distance Measurements:

    • Ensure the sensor is not too close to the object (minimum range is 30 mm).
    • Avoid reflective or transparent surfaces in the sensor's field of view.
    • Check for obstructions or dirt on the sensor's lens.
  3. Sensor Timeout Errors:

    • Increase the timeout value using the setTimeout() function.
    • Verify that the sensor is powered correctly and not in shutdown mode.
  4. Multiple Sensors on the Same I²C Bus:

    • Use the XSHUT pin to reset individual sensors and assign unique I²C addresses.

FAQs

Q: Can the GY-VL53L0XV2 measure distances beyond 2 meters?
A: No, the maximum range of the sensor is 2 meters under optimal conditions.

Q: Is the laser emitted by the sensor safe for human eyes?
A: Yes, the VL53L0X uses a Class 1 laser, which is safe for human eyes under normal operating conditions.

Q: Can I use this sensor with a 3.3V microcontroller?
A: Yes, the sensor is compatible with both 3.3V and 5V systems.

Q: How do I modify the I²C address of the sensor?
A: Use the XSHUT pin to reset the sensor, then configure a new address in your code before reinitializing it.

By following this documentation, you can effectively integrate the GY-VL53L0XV2 LASER ToF sensor into your projects for accurate distance measurement.