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

How to Use TOF Sensor: Examples, Pinouts, and Specs

Image of TOF Sensor
Cirkit Designer LogoDesign with TOF Sensor in Cirkit Designer

Introduction

The Adafruit VL53L0XV2 is a Time-of-Flight (TOF) sensor that measures the distance to an object by calculating the time it takes for a light pulse to travel to the object and return. This sensor provides highly accurate distance measurements and is ideal for applications requiring precise proximity sensing.

Explore Projects Built with 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!
Arduino UNO-Based Eye Pressure Monitor with OLED Display and TOF Sensor
Image of test1: A project utilizing TOF Sensor in a practical application
This circuit is designed to measure eye pressure and display the status on a 0.96" OLED screen, using an Arduino UNO as the central processing unit. It includes a TOF10120 sensor for distance measurement and a TCRT 5000 IR sensor for detecting surface changes, both interfacing with the Arduino. A 9V battery powers the system, with a rocker switch to control power flow, and the Arduino manages sensor data processing and OLED display output to indicate eye pressure as high, normal, or low.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 Biometric Security System with Wi-Fi Connectivity
Image of Health Monitoring Device (Collab): A project utilizing TOF Sensor in a practical application
This is a multi-functional sensor system controlled by an Arduino Mega 2560, designed to read biometric data from a pulse oximeter and an infrared thermometer, authenticate using a fingerprint scanner, display information on an OLED screen, and transmit data wirelessly via an ESP8266 module. User inputs can be received through two pushbuttons, and the system's power distribution is managed through common ground and voltage supply nets.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Health Monitoring System with Nucleo WB55RG and OLED Display
Image of Pulsefex: A project utilizing TOF Sensor in a practical application
This circuit is a multi-sensor data acquisition system that uses a Nucleo WB55RG microcontroller to interface with a digital temperature sensor (TMP102), a pulse oximeter and heart-rate sensor (MAX30102), and a 0.96" OLED display via I2C. Additionally, it includes a Sim800l module for GSM communication, powered by a 3.7V LiPo battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU-Based Smart Eye Pressure Monitor with OLED Display and Wi-Fi Connectivity
Image of Copy of test 2 (7): A project utilizing 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

Explore Projects Built with 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 test1: A project utilizing TOF Sensor in a practical application
Arduino UNO-Based Eye Pressure Monitor with OLED Display and TOF Sensor
This circuit is designed to measure eye pressure and display the status on a 0.96" OLED screen, using an Arduino UNO as the central processing unit. It includes a TOF10120 sensor for distance measurement and a TCRT 5000 IR sensor for detecting surface changes, both interfacing with the Arduino. A 9V battery powers the system, with a rocker switch to control power flow, and the Arduino manages sensor data processing and OLED display output to indicate eye pressure as high, normal, or low.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Health Monitoring Device (Collab): A project utilizing TOF Sensor in a practical application
Arduino Mega 2560 Biometric Security System with Wi-Fi Connectivity
This is a multi-functional sensor system controlled by an Arduino Mega 2560, designed to read biometric data from a pulse oximeter and an infrared thermometer, authenticate using a fingerprint scanner, display information on an OLED screen, and transmit data wirelessly via an ESP8266 module. User inputs can be received through two pushbuttons, and the system's power distribution is managed through common ground and voltage supply nets.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Pulsefex: A project utilizing TOF Sensor in a practical application
Battery-Powered Health Monitoring System with Nucleo WB55RG and OLED Display
This circuit is a multi-sensor data acquisition system that uses a Nucleo WB55RG microcontroller to interface with a digital temperature sensor (TMP102), a pulse oximeter and heart-rate sensor (MAX30102), and a 0.96" OLED display via I2C. Additionally, it includes a Sim800l module for GSM communication, powered by a 3.7V LiPo battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of test 2 (7): A project utilizing 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

Common Applications

  • Robotics for obstacle detection and navigation
  • Gesture recognition systems
  • 3D mapping and scanning
  • Object detection in industrial automation
  • Distance measurement in consumer electronics

Technical Specifications

The following table outlines the key technical details of the Adafruit VL53L0XV2 TOF sensor:

Parameter Value
Manufacturer Adafruit
Part ID VL53L0XV2
Measurement Range 30 mm to 2000 mm (2 meters)
Measurement Accuracy ±3%
Operating Voltage 2.6V to 3.5V
Communication Interface I2C
I2C Address (Default) 0x29
Power Consumption 20 mW (typical)
Operating Temperature -20°C to +70°C
Dimensions 21 mm x 18 mm x 3 mm

Pin Configuration

The VL53L0XV2 sensor has the following pinout:

Pin Name Description
VIN Power input (2.6V to 5V)
GND Ground
SDA I2C data line
SCL I2C clock line
XSHUT Shutdown pin (active low)
GPIO1 Interrupt output (optional)

Usage Instructions

Connecting the VL53L0XV2 to an Arduino UNO

To use the VL53L0XV2 with an Arduino UNO, follow these steps:

  1. Connect the VIN pin of the sensor to the 5V pin on the Arduino.
  2. Connect the GND pin of the sensor to the GND pin on the Arduino.
  3. Connect the SDA pin of the sensor to the A4 pin on the Arduino (I2C data line).
  4. Connect the SCL pin of the sensor to the A5 pin on the Arduino (I2C clock line).
  5. Optionally, connect the XSHUT pin to a digital pin on the Arduino for enabling/disabling the sensor.

Arduino Code Example

Below is an example Arduino sketch to read distance data from the VL53L0XV2 sensor using the Adafruit VL53L0X library:

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

// Create an instance of the VL53L0X sensor
Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    delay(10); // Wait for Serial Monitor to open
  }

  Serial.println("Adafruit VL53L0X Test");

  // Initialize the sensor
  if (!lox.begin()) {
    Serial.println("Failed to initialize VL53L0X. Check wiring!");
    while (1);
  }
  Serial.println("VL53L0X initialized successfully.");
}

void loop() {
  VL53L0X_RangingMeasurementData_t measure;

  // Perform a ranging measurement
  lox.rangingTest(&measure, false);

  // Check if the measurement is valid
  if (measure.RangeStatus != 4) { // 4 means "no object detected"
    Serial.print("Distance (mm): ");
    Serial.println(measure.RangeMilliMeter);
  } else {
    Serial.println("Out of range");
  }

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

Important Considerations

  • Ensure the sensor is not exposed to direct sunlight, as it may interfere with the light pulse.
  • Use pull-up resistors (4.7kΩ recommended) on the SDA and SCL lines if not already present.
  • The default I2C address is 0x29. If using multiple sensors, you must change the address of each sensor programmatically.

Troubleshooting and FAQs

Common Issues

  1. Sensor not detected by the Arduino:

    • Verify the wiring connections, especially the SDA and SCL lines.
    • Ensure the I2C address matches the default (0x29) or the address you configured.
  2. Incorrect or fluctuating distance readings:

    • Check for reflective or transparent surfaces in the sensor's field of view.
    • Ensure the sensor is mounted securely to avoid vibrations.
  3. "Out of range" error:

    • Ensure the object is within the sensor's measurement range (30 mm to 2000 mm).
    • Avoid using the sensor in environments with excessive ambient light.

FAQs

Q: Can I use the VL53L0XV2 with a 5V microcontroller?
A: Yes, the sensor has a built-in voltage regulator and level shifters, allowing it to work with 5V logic.

Q: How do I change the I2C address of the sensor?
A: Use the lox.setAddress(newAddress) function in the Adafruit VL53L0X library to assign a new I2C address.

Q: Can the sensor detect multiple objects simultaneously?
A: No, the VL53L0XV2 measures the distance to the nearest object in its line of sight.

Q: What is the maximum update rate of the sensor?
A: The sensor can achieve a maximum update rate of approximately 50 Hz, depending on the measurement mode.

By following this documentation, you can effectively integrate the Adafruit VL53L0XV2 TOF sensor into your projects for accurate distance measurement and proximity sensing.