Παραγγελία έως τις 14:00 τις εργάσιμες = αποστολή την ίδια ημέρα 30 ημέρες δικαίωμα υπαναχώρησης Εγγύηση 1 έτους
← Πίσω στην επισκόπηση

Με την αναπαραγωγή φορτώνεται το βίντεο από το YouTube.

Διάγραμμα σύνδεσης και παράδειγμα κώδικα

Έτσι συνδέεις το TOF200C VL53L0X Αισθητήρας απόστασης Time-Of-Flight πολύ ακριβής σε ένα Arduino UNO ή ESP32, με ένα παράδειγμα sketch που μπορείς να ανεβάσεις αμέσως.

Demo αισθητήρα απόστασης ToF VL53L0X

Αυτό το project δείχνει μετρήσεις απόστασης σε πραγματικό χρόνο με τον αισθητήρα Time-of-Flight VL53L0X, συνδεδεμένο μέσω I2C. Το Arduino Uno διαβάζει δεδομένα απόστασης σε χιλιοστά από τον αισθητήρα και τα εμφανίζει στο Serial Monitor κάθε 200 ms.

Διάγραμμα σύνδεσης: TOF200C VL53L0X Αισθητήρας απόστασης Time-Of-Flight πολύ ακριβής σε ένα Arduino UNO
Διάγραμμα σύνδεσης · Κάνε κλικ για μεγέθυνση
Πίνακας σύνδεσης: TOF200C VL53L0X Αισθητήρας απόστασης Time-Of-Flight πολύ ακριβής σε ένα Arduino UNO
Πίνακας σύνδεσης · Κάνε κλικ για μεγέθυνση
VL53L0X_ToF_Distance_Sensor_Demo.ino · μεταγλωττισμένο και δοκιμασμένο
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : VL53L0X ToF Distance Sensor Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : TOF200C VL53L0X Distance Sensor Time-Of-Flight high precision
 *  Libraries : Adafruit_VL53L0X 1.2.5
 *
 *  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_VL53L0X.h>

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

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

  Serial.println(F("VL53L0X Distance Sensor Test"));

  if (!lox.begin()) {
    Serial.println(F("Failed to initialize VL53L0X sensor! Check wiring."));
    while (1) {
      delay(10);
    }
  }

  Serial.println(F("Sensor initialized successfully. Reading distance..."));
}

void loop() {
  VL53L0X_RangingMeasurementData_t measure;

  lox.rangingTest(&measure, false); // Pass true to enable debug output

  if (measure.RangeStatus != 4) { // Phase failures are status 4
    Serial.print(F("Distance: "));
    Serial.print(measure.RangeMilliMeter);
    Serial.println(F(" mm"));
  } else {
    Serial.println(F("Target out of range"));
  }

  delay(200);
}

Απαραίτητες βιβλιοθήκες: Adafruit_VL53L0X 1.2.5

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

Αισθητήρας απόστασης VL53L0X με ESP32

Αυτό το έργο μετρά απόσταση σε χιλιοστά χρησιμοποιώντας τον αισθητήρα Time-of-Flight VL53L0X που είναι συνδεδεμένος μέσω I2C. Ανοίξτε το Serial Monitor στα 115200 baud για να δείτε τις μετρήσεις απόστασης σε πραγματικό χρόνο.

Διάγραμμα σύνδεσης: TOF200C VL53L0X Αισθητήρας απόστασης Time-Of-Flight πολύ ακριβής σε ένα ESP32 DevKit V1
Διάγραμμα σύνδεσης · Κάνε κλικ για μεγέθυνση
Πίνακας σύνδεσης: TOF200C VL53L0X Αισθητήρας απόστασης Time-Of-Flight πολύ ακριβής σε ένα ESP32 DevKit V1
Πίνακας σύνδεσης · Κάνε κλικ για μεγέθυνση
VL53L0X_Distance_Sensor_with_ESP32.ino · μεταγλωττισμένο και δοκιμασμένο
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : VL53L0X Distance Sensor with ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : TOF200C VL53L0X Distance Sensor Time-Of-Flight high precision
 *  Libraries : Adafruit_VL53L0X 1.2.5
 *
 *  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_VL53L0X.h"

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

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

  Serial.println("VL53L0X Distance Sensor Test");

  // Initialize I2C communication (ESP32 default: SDA=21, SCL=22)
  Wire.begin(21, 22);

  if (!lox.begin()) {
    Serial.println(F("Failed to boot VL53L0X. Check wiring!"));
    while (1);
  }

  Serial.println(F("Sensor initialized successfully."));
}

void loop() {
  VL53L0X_RangingMeasurementData_t measure;

  lox.rangingTest(&measure, false); // Pass true to get debug data printout

  if (measure.RangeStatus != 4) {  // Phase failures have status 4
    Serial.print("Distance (mm): ");
    Serial.println(measure.RangeMilliMeter);
  } else {
    Serial.println("Out of range");
  }

  delay(250);
}

Απαραίτητες βιβλιοθήκες: Adafruit_VL53L0X 1.2.5

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

Πρόσφατα προβεβλημένα

Μονωμένος θηλυκός ακροδέκτης καλωδίου 6,3 mm – Κίτρινο

Μονωμένος θηλυκός ακροδέκτης καλωδίου 6,3 mm – Κίτρινο

€ 0,25
Μονωμένος θηλυκός ακροδέκτης καλωδίου 6,3 mm – Κόκκινο

Μονωμένος θηλυκός ακροδέκτης καλωδίου 6,3 mm – Κόκκινο

€ 0,25