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

How to Use Time of Flight Distance Ranging Sensor: Examples, Pinouts, and Specs

Image of Time of Flight Distance Ranging Sensor
Cirkit Designer LogoDesign with Time of Flight Distance Ranging Sensor in Cirkit Designer

Introduction

The Adafruit VL6180X Time of Flight (ToF) Distance Ranging Sensor is a compact and highly accurate sensor designed to measure the distance to an object by calculating the time it takes for a light pulse to travel to the object and back. This sensor uses infrared light and features an integrated proximity sensor and ambient light sensor, making it versatile for a wide range of applications.

Explore Projects Built with Time of Flight Distance Ranging 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 Time of Flight Distance Ranging 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
A-Star 32U4 Mini Controlled Servo with VL53L8CX Time-of-Flight Distance Sensing
Image of Servo con distance sensor: A project utilizing Time of Flight Distance Ranging 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
ESP32-Based Battery-Powered RFID Reader with OLED Display and Distance Sensor
Image of Depthtron Project: A project utilizing Time of Flight Distance Ranging Sensor in a practical application
This circuit features an ESP32 microcontroller interfaced with a UHF RFID module, an Adafruit VL6180X Time of Flight Distance Sensor, an OLED display, and a pushbutton. The ESP32 reads distance data from the VL6180X sensor and displays it on the OLED, while also monitoring the state of the pushbutton and communicating with the RFID module via UART.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Ultrasonic Distance Sensor with OLED Display and SIM900A Communication
Image of SENSOR: A project utilizing Time of Flight Distance Ranging Sensor in a practical application
This circuit is a distance measurement and communication system using an Arduino UNO, an ultrasonic sensor, an OLED display, and a SIM900A module. The ultrasonic sensor measures the distance to an object, which is then displayed on the OLED screen and transmitted via the SIM900A module. The system is powered by a 18650 Li-ion battery.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Time of Flight Distance Ranging 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 Time of Flight Distance Ranging 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 Servo con distance sensor: A project utilizing Time of Flight Distance Ranging 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 Depthtron Project: A project utilizing Time of Flight Distance Ranging Sensor in a practical application
ESP32-Based Battery-Powered RFID Reader with OLED Display and Distance Sensor
This circuit features an ESP32 microcontroller interfaced with a UHF RFID module, an Adafruit VL6180X Time of Flight Distance Sensor, an OLED display, and a pushbutton. The ESP32 reads distance data from the VL6180X sensor and displays it on the OLED, while also monitoring the state of the pushbutton and communicating with the RFID module via UART.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SENSOR: A project utilizing Time of Flight Distance Ranging Sensor in a practical application
Arduino UNO-Based Ultrasonic Distance Sensor with OLED Display and SIM900A Communication
This circuit is a distance measurement and communication system using an Arduino UNO, an ultrasonic sensor, an OLED display, and a SIM900A module. The ultrasonic sensor measures the distance to an object, which is then displayed on the OLED screen and transmitted via the SIM900A module. The system is powered by a 18650 Li-ion battery.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Proximity sensing: Detecting objects in robotics and automation systems.
  • Gesture recognition: Enabling touchless control in consumer electronics.
  • Obstacle detection: Used in drones, robots, and autonomous vehicles.
  • Ambient light sensing: Adjusting screen brightness in smartphones and other devices.
  • Industrial automation: Monitoring object presence or distance in manufacturing lines.

Technical Specifications

The VL6180X sensor is designed for low-power, high-accuracy distance measurements. Below are its key technical details:

Key Technical Details

  • Operating Voltage: 2.8V to 5V (via onboard voltage regulator)
  • Communication Interface: I²C (7-bit address: 0x29 by default)
  • Distance Measurement Range: 5mm to 100mm (optimal performance)
  • Ambient Light Sensor Range: 0 to 100k lux
  • Measurement Accuracy: ±3mm (typical)
  • Operating Temperature Range: -20°C to +70°C
  • Current Consumption: ~1.7mA during ranging, ~0.5mA in standby
  • Dimensions: 20mm x 18mm x 3mm (Adafruit breakout board)

Pin Configuration and Descriptions

The Adafruit VL6180X breakout board has the following pin layout:

Pin Name Description
VIN Power input (2.8V to 5V). Connect to the 5V or 3.3V pin of your microcontroller.
GND Ground. Connect to the ground of your circuit.
SCL I²C clock line. Connect to the SCL pin of your microcontroller.
SDA I²C data line. Connect to the SDA pin of your microcontroller.
GPIO General-purpose input/output pin. Can be used for interrupts or custom logic.
SHDN Shutdown pin. Pull low to put the sensor in low-power mode.

Usage Instructions

The VL6180X sensor is easy to integrate into your projects using the I²C interface. Below are the steps to use the sensor effectively:

Connecting the Sensor

  1. Power the Sensor: Connect the VIN pin to a 3.3V or 5V power source and GND to ground.
  2. I²C Communication: Connect the SDA and SCL pins to the corresponding I²C pins on your microcontroller.
  3. Optional Connections:
    • Use the GPIO pin for interrupt-based applications.
    • Use the SHDN pin to enable or disable the sensor as needed.

Using the Sensor with Arduino UNO

The Adafruit VL6180X library simplifies the use of this sensor with Arduino. Follow these steps:

  1. Install the Adafruit VL6180X library via the Arduino Library Manager.
  2. Connect the sensor to the Arduino UNO as follows:
    • VIN → 5V
    • GND → GND
    • SCL → A5 (I²C clock line)
    • SDA → A4 (I²C data line)
  3. Upload the following example code to read distance measurements:
#include <Wire.h>
#include "Adafruit_VL6180X.h"

// Create an instance of the VL6180X sensor
Adafruit_VL6180X vl = Adafruit_VL6180X();

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
  Serial.println("Adafruit VL6180X test");

  if (!vl.begin()) {
    Serial.println("Failed to find VL6180X chip");
    while (1); // Halt execution if the sensor is not detected
  }
  Serial.println("VL6180X sensor found!");
}

void loop() {
  // Read the range (distance) in millimeters
  uint8_t range = vl.readRange();
  uint8_t status = vl.readRangeStatus();

  if (status == VL6180X_ERROR_NONE) {
    Serial.print("Range: ");
    Serial.print(range);
    Serial.println(" mm");
  } else {
    Serial.print("Range error: ");
    Serial.println(status);
  }

  delay(500); // Wait 500ms before the next reading
}

Important Considerations and Best Practices

  • I²C Pull-Up Resistors: Ensure that your I²C bus has appropriate pull-up resistors (typically 4.7kΩ).
  • Ambient Light Interference: Avoid using the sensor in direct sunlight or near strong infrared sources to maintain accuracy.
  • Measurement Range: The sensor performs best within its specified range (5mm to 100mm). For distances beyond this range, accuracy may degrade.
  • Mounting: Ensure the sensor is mounted securely and aligned properly for accurate measurements.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor Not Detected:

    • Ensure the I²C connections (SDA, SCL) are correct and secure.
    • Verify the I²C address (default: 0x29). Use an I²C scanner sketch to confirm.
    • Check the power supply voltage (2.8V to 5V).
  2. Inaccurate Distance Measurements:

    • Ensure the sensor is within its optimal range (5mm to 100mm).
    • Avoid reflective or transparent surfaces, which may cause measurement errors.
    • Minimize ambient light interference by shielding the sensor.
  3. Intermittent Readings:

    • Check for loose connections or poor solder joints.
    • Ensure the I²C bus has proper pull-up resistors.

FAQs

Q: Can the VL6180X measure distances beyond 100mm?
A: While the sensor can detect objects slightly beyond 100mm, accuracy decreases significantly. For longer ranges, consider other ToF sensors like the VL53L0X.

Q: Can I use multiple VL6180X sensors on the same I²C bus?
A: Yes, but you must change the I²C address of each sensor. This can be done by configuring the sensor's address via software after initialization.

Q: How do I reduce power consumption?
A: Use the SHDN pin to put the sensor into low-power mode when not in use.

Q: Is the VL6180X suitable for outdoor use?
A: The sensor can be used outdoors but may be affected by strong sunlight or extreme temperatures. Consider additional shielding for better performance.

This concludes the documentation for the Adafruit VL6180X Time of Flight Distance Ranging Sensor.