Waking up VL53L1X from HW standby with XSHUT

Hi,
I'm trying to detect distance fro object using VL53L1X sensor.
Sensor is connected with 5 pins:
-VCC,GND,SDA,SCL,XSHUT
I'm using VL53L1X pololu library.
I am able to initialize sensor and start measuring distance.
I'm able to put it to SW standby with sensor.stopContinuous() and wake it up to sensor.startContinuous().
And eveyrthing works fine - results are correct.

However I would like to put it into HW standby by setting XSHUT to LOW.
But I'm unable to wake it up.
After waking up - sensor.read() returns only 0.

What am I doing wrong?

Please check my simple snippet:

#include <VL53L1X.h>
VL53L1X sensor;
#define XSHUT 4

void setup() {
  Serial.begin(9600);
  Wire.begin();
  Wire.setClock(400000);

  pinMode(XSHUT , OUTPUT);
  digitalWrite(XSHUT, LOW);
///INIT SENSOR
  delay(50);
  digitalWrite(XSHUT, HIGH);
  delay(50);

  sensor.setTimeout(500);
  if (!sensor.init())
  {
    Serial.print(XSHUT);
    Serial.println(F(" - is not responding!"));
  }
  else
  {
    sensor.setAddress(0x30);
    sensor.setDistanceMode(VL53L1X::Short);
    sensor.setMeasurementTimingBudget(50000);
    sensor.startContinuous(45);
  }
  delay(50);
  Serial.println(sensor.read()); //CORRECT READOUTS
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  sensor.stopContinuous();
  delay(500);
  Serial.println("Stopped scanning");
  digitalWrite(XSHUT, LOW);
  delay(5000);
  digitalWrite(XSHUT, HIGH);
  delay(500);
  Serial.println("Scanning continues");
  sensor.startContinuous(45);
  delay(1000);
  Serial.println(sensor.read()); //STARTS RETURNING 0
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  Serial.println(sensor.read());
  delay(1000);
  sensor.stopContinuous();
}

void loop() {
}

XSHUT should work - I have a pair of Pololu VL53L1X TOF sensors connectd to the same I2C interface
I used XSHUT to shut down one of them when changing the I2C address of the other
if you have an oscilloscope or multimeter could you check the voltage on the XSHUT pin?
what VL53L1X board are you using?

I have android UNO copy. Unfortunately I don't have multimeter. But I belive that GPIO give solid 5V.
I am able to power VL53L1X from GPIO.
I also have no problem with connecting two sensors and setting I2C addresses.
Waking up from HW standby is my only problem.

SOLVED! I've did some more tests, also tried to connect multiple sensors and put them to sleep and wake up. And finally looked at the source:

To fix this,
When initializing/waking sensors up use:
pinMode(XSHUT, INPUT);
instead of:
digitalWrite(XSHUT, HIGH);

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.