Mini laser afstandssensor voor nauwkeurige metingen, geschikt voor Arduino, ESP8266 en ESP32.
SKU: OT5863 Número do artigo: XR356 EAN: 8720618489425 Localização: AD07.05
Alternativa
Sensor de distância TOF400C-VL53L1X Time-Of-Flight 4-400cm
€ 18,15
Ver esta alternativa
Como ligar o TOF050C-VL6180X Sensor de distância Time-Of-Flight de alta precisão a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
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);
}
Bibliotecas necessárias: 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);
}
Bibliotecas necessárias: Adafruit_VL6180X 1.4.4
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Módulo mini sensor de distância a laser com uma precisão de 1mm e grande alcance.
Modelo: TOF050C-VL6180X
Tensão: 3V até 5 V
Consumo de corrente: 40 mA (máx)
Distância: 3cm até 50cm
Conexões:
- VIN
- GND
- SDA
- SCL
- INT
- SHUT
Comunicação: o protocolo de comunicação I2C (totalmente compatível com sistema de 3-5 v)
Adequado para Arduino, ESP8266 e ESP32. Funciona bem com a biblioteca Adafruit_VL6180X.
Vários sensores numa única linha I2C são possíveis porque os sensores podem receber um endereço I2C por software.
O sensor laser VL53L0X Time Of Flight é um sensor muito preciso e fiável que pode ser usado para uma ampla gama de aplicações, incluindo medição de distância, deteção de movimento e navegação.
Uma das principais vantagens deste sensor é a sua precisão. O sensor utiliza tecnologia laser para medir a distância até um objeto, proporcionando um resultado muito mais preciso do que, por exemplo, um sensor infravermelho. Isto torna o sensor adequado, por exemplo, para uso em drones, automação industrial e robôs.
Além disso, o sensor também é muito fácil de usar. É compatível com uma ampla gama de plataformas de microcontroladores, incluindo Arduino, Raspberry Pi e STM32, e existem muitos exemplos e bibliotecas disponíveis para o ajudar a integrar o sensor no seu projeto.
Por fim, o sensor também é muito pequeno e leve, o que facilita a sua integração numa ampla gama de aplicações. Os 2 furos para parafuso também tornam muito fácil fixar este sensor de forma firme.
Dimensões
Comprimento: 1,3cm
Largura: 1,04cm
Altura: 0,32cm
| Dimensões | 1,3 x 1,04 x 0,32 cm |
|---|---|
| Interface | I2C |
| Adequado para | Arduino, ESP8266 e ESP32 |
| Consumo de energia | 40 mA (máx) |
| Modelo | TOF050C-VL6180X |
| Distância | 3cm a 50cm |
Ainda sem avaliações.
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
TOF050C-VL6180X Sensor de distância Time-Of-Flight de alta precisão