unable to find headers

tuftron
Posts: 1
Joined: Mon Jul 17, 2023 1:39 am

unable to find headers

Postby tuftron » Mon Jul 17, 2023 1:58 am

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!

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: unable to find headers

Postby ESP_Sprite » Mon Jul 17, 2023 2:09 am

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.)

Who is online

Users browsing this forum: No registered users and 103 guests