Ordered on weekdays before 14:00 = shipped the same day and delivered the next day in 98% of cases. Free returns 30-day reflection period 1-year warranty

Wiring diagram and code example

How to connect the TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate to an Arduino UNO or ESP32, with an example sketch you can upload straight away.

VL6180X Distance Sensor Measurement

This project measures accurate short-range distance (up to ~200mm) using the VL6180X Time-of-Flight sensor over I2C. Connect the sensor to power and I2C pins, then open the Serial Monitor at 115200 baud to view real-time distance measurements in millimeters.

Wiring diagram: TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate on an Arduino UNO
Wiring diagram · Click to enlarge
Connection table: TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate on an Arduino UNO
Connection table · Click to enlarge
VL6180X_Distance_Sensor_Measurement.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : VL6180X Distance Sensor Measurement
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : TOF050C-VL6180X Distance Sensor Time-Of-Flight high precision
 *  Libraries : Adafruit_VL6180X 1.4.4
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Wire.h>
#include <Adafruit_VL6180X.h>

Adafruit_VL6180X vl = Adafruit_VL6180X();

void setup() {
  Serial.begin(115200);
  while (!Serial) { delay(1); }

  Serial.println(F("Initializing VL6180X sensor..."));
  if (!vl.begin()) {
    Serial.println(F("Failed to find VL6180X sensor! Check wiring."));
    while (1);
  }
  Serial.println(F("VL6180X sensor ready!"));
}

void loop() {
  uint8_t range = vl.readRange();
  uint8_t status = vl.readRangeStatus();

  if (status == VL6180X_ERROR_NONE) {
    Serial.print(F("Distance: "));
    Serial.print(range);
    Serial.println(F(" mm"));
  } else {
    if (status >= VL6180X_ERROR_SYSERR_1 && status <= VL6180X_ERROR_SYSERR_5) {
      Serial.println(F("System error"));
    } else if (status == VL6180X_ERROR_ECEFAIL) {
      Serial.println(F("ECE failure"));
    } else if (status == VL6180X_ERROR_NOCONVERGE) {
      Serial.println(F("No convergence"));
    } else if (status == VL6180X_ERROR_RANGEIGNORE) {
      Serial.println(F("Ignoring range"));
    } else if (status == VL6180X_ERROR_SNR) {
      Serial.println(F("Signal-to-Noise Ratio error"));
    } else if (status == VL6180X_ERROR_RAWUFLOW) {
      Serial.println(F("Raw reading underflow"));
    } else if (status == VL6180X_ERROR_RAWOFLOW) {
      Serial.println(F("Raw reading overflow"));
    } else if (status == VL6180X_ERROR_RANGEUFLOW) {
      Serial.println(F("Range reading underflow"));
    } else if (status == VL6180X_ERROR_RANGEOFLOW) {
      Serial.println(F("Out of range (>200mm)"));
    }
  }

  delay(200);
}

Required libraries: Adafruit_VL6180X 1.4.4

Wiring diagram and example code generated by Codey.online — https://www.codey.online

VL6180X Distance & Light Sensor with ESP32

This project measures close-range distance (0–100 mm) and ambient light levels using the TOF050C VL6180X Time-of-Flight sensor over I2C. Connect the sensor directly to the ESP32's 3.3V and default I2C pins (GPIO 21 and 22). Open the Serial Monitor at 115200 baud to view real-time distance and ambient lux measurements.

Wiring diagram: TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate on an ESP32 DevKit V1
Wiring diagram · Click to enlarge
Connection table: TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate on an ESP32 DevKit V1
Connection table · Click to enlarge
VL6180X_Distance_Light_Sensor_with_ESP32.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : VL6180X Distance & Light Sensor with ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : TOF050C-VL6180X Distance Sensor Time-Of-Flight high precision
 *  Libraries : Adafruit_VL6180X 1.4.4
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Wire.h>
#include <Adafruit_VL6180X.h>

Adafruit_VL6180X vl = Adafruit_VL6180X();

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10);

  Serial.println("VL6180X Distance & Light Sensor Demo");

  Wire.begin(21, 22);

  if (!vl.begin()) {
    Serial.println("Failed to find VL6180X sensor! Check wiring.");
    while (1) delay(100);
  }

  Serial.println("VL6180X found and initialized!");
}

void loop() {
  float lux = vl.readLux(VL6180X_ALS_GAIN_5);
  uint8_t range = vl.readRange();
  uint8_t status = vl.readRangeStatus();

  Serial.print("Ambient Light: ");
  Serial.print(lux);
  Serial.print(" Lux | ");

  if (status == VL6180X_ERROR_NONE) {
    Serial.print("Distance: ");
    Serial.print(range);
    Serial.println(" mm");
  } else {
    Serial.print("Range Status Error (Code: ");
    Serial.print(status);
    Serial.println(")");
  }

  delay(200);
}

Required libraries: Adafruit_VL6180X 1.4.4

Wiring diagram and example code generated by Codey.online — https://www.codey.online

TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate

Mini laser distance sensor module with an accuracy of 1mm and large range.

Model: TOF050C-VL6180X
Voltage: 3V to 5V
Current consumption: 40 mA (max)
Distance: 3cm to 50cm

Connections:
- VIN
- GND
- SDA
- SCL
- INT
- SHUT


Communication: the I2C communication protocol (fully compatible with 3-5V systems)

Suitable for Arduino, ESP8266, and ESP32. Works well with the Adafruit_VL6180X library.

Multiple sensors on one I2C line are possible because the sensors can be assigned an I2C address via software.

The VL53L0X Time Of Flight laser sensor is a very precise and reliable sensor that can be used for a wide range of applications, including distance measurement, motion detection, and navigation.

One of the main advantages of this sensor is its precision. The sensor uses laser technology to measure the distance to an object, resulting in much more accurate results than, for example, an infrared sensor. This makes the sensor suitable for use in drones, industrial automation, and robots.

In addition, the sensor is also very easy to use. It is compatible with a wide range of microcontroller platforms, including Arduino, Raspberry Pi, and STM32, and there are many examples and libraries available to help you integrate the sensor into your project.

Finally, the sensor is also very small and lightweight, making it easy to integrate into a wide range of applications. The 2 screw holes also make it very easy to mount this sensor securely.

Dimensions
Length: 1.3cm
Width: 1.04cm
Height: 0.32cm

  • Distance sensor
  • I2C address
  • Compact size
  • 2 screw holes
Playing loads the video from YouTube.

Why choose this product?

  • Very accurate – Measures with an accuracy of up to 1 mm.
  • Wide range – Measures distances from 3 to 50 cm.
  • Compatible with I2C – Works with 3-5V systems via I2C.
  • Suitable for makers – Fits Arduino, ESP8266 and ESP32.
  • Compact size – Easy to integrate thanks to its small dimensions.
  • Easy to mount – Can be mounted with two screw holes.
Specifications
Dimensions1,3 x 1,04 x 0,32 cm
InterfaceI2C
Suitable forArduino, ESP8266 and ESP32
Power consumption40 mA (max)
ModelTOF050C-VL6180X
Distance3cm to 50cm

Reviews

No reviews yet.

Write a review
Your rating

Shipping & returns

Shipping

  • Parcel with track & trace€ 7,70Within 24 hours
  • Pick up at PostNL location€ 7,40Within 24 hours
  • Letterbox parcel€ 3,70Within 2 business days
  • Letterbox parcel 24 hours€ 4,55Within 24 hours
  • Pick up in storeFree
All about shipping

Returns

Not satisfied? You have 30 days after delivery to return the product.

All about returns

Recently viewed