Mini laser distance sensor for precise measurements, suitable for Arduino, ESP8266 and ESP32.
SKU: OT5863 Article number: XR356 EAN: 8720618489425 Location: AD07.05
Alternative
TOF400C-VL53L1X Distance Sensor Time-Of-Flight 4-400cm
€ 18,15
View this alternative
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.
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.
/*
* ==================================================================
* 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
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.
/*
* ==================================================================
* 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
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
| Dimensions | 1,3 x 1,04 x 0,32 cm |
|---|---|
| Interface | I2C |
| Suitable for | Arduino, ESP8266 and ESP32 |
| Power consumption | 40 mA (max) |
| Model | TOF050C-VL6180X |
| Distance | 3cm to 50cm |
No reviews yet.
TOF050C-VL6180X Distance Sensor Time-Of-Flight very accurate