VL53L0X Ir range problem

Hello.

I just got the mentioned sensor. I connected it to Wemos d1 pro. But the problem is that the sensor only works for about a minute. Then it is not detected anymore. I also tried with I2C scanner, it is detected only for a few minutes. Then I need to disconnect the board from power for some time, and it works again for a few minutes. Just reseting it doesn’t help, it needs to be without power for some time.

Connections are:
VIN — 3V3 - also tried 5V
GND — G
SCL ---- D1
SDA — D2

#include "Adafruit_VL53L0X.h"

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
  Serial.begin(115200);

  // wait until serial port opens for native USB devices
  while (! Serial) {
    delay(1);
  }
  
  Serial.println("Adafruit VL53L0X test");
  if (!lox.begin()) {
    Serial.println(F("Failed to boot VL53L0X"));
    while(1);
  }
  // power 
  Serial.println(F("VL53L0X API Simple Ranging example\n\n")); 
}


void loop() {
  VL53L0X_RangingMeasurementData_t measure;
    
  Serial.print("Reading a measurement... ");
  lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!

  if (measure.RangeStatus != 4) {  // phase failures have incorrect data
    Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter);
  } else {
    Serial.println(" out of range ");
  }
    
  delay(100);
}

prenos.jpg

Could be a thermal problem. Try putting it in front of a fan while using or spray some circuit cleaner on it while running and see if it revives.

I think you are right.. There was something wrong with the wemos board. I tried with another, and it is working. And it has much lower temp...