Page 1 of 1

unable to find headers

Posted: Mon Jul 17, 2023 1:58 am
by tuftron
Hi,

I'm new to ESP32s and am working with Arduino IDE 2.1.1 and a WROVER ESP32.
I want to get the VL53L5CX-SATEL to work with it. I've connected it to the I2C pins but am struggling with getting the code working.
I connected
SCL to pin 22, SDA to pin 21, PWREN, AVDD & IOVDD to 3.3V and GND to GND
I tried the following code:

Code: Select all

#include <Wire.h>
#include <Adafruit_VL53L0X.h>

#define SDA_PIN 21
#define SCL_PIN 22

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
  Wire.begin(SDA_PIN, SCL_PIN);
  Serial.begin(115200);

  if (!lox.begin()) {
    Serial.println("Failed to initialize sensor!");
    while (1);
  }

  // Optional: Change the measurement timing budget if needed
  // lox.setMeasurementTimingBudget(20000);
}

void loop() {
  VL53L0X_RangingMeasurementData_t measurement;
  Serial.print("test");
  if (lox.rangingTest(&measurement, false)) {
    if (measurement.RangeStatus != 4) {
      Serial.print("Distance: ");
      Serial.print(measurement.RangeMilliMeter);
      Serial.println(" mm");
    } else {
      Serial.println("Out of range");
    }
  } else {
    Serial.println("Failed to perform ranging measurement!");
  }

  delay(100);
}
but keep seeing "Failed to initialize sensor!" on the Serial Monitor. What could be the problem here? :?:

Thank you!

Re: unable to find headers

Posted: Mon Jul 17, 2023 2:09 am
by ESP_Sprite
How *exactly* did you connect it? If you're using the soldered headers on the bottom, the documentation seems to hint that AVDD (and only that signal) needs to be 5V, not 3.3V. (Note that that board is not our product and the documentation for it is pretty bad, so I can't guarantee that my interpretation is correct.)