2021-11-17 05:59 AM
Hello. I have problems with VL53L0X sensor. I will list my observations here.
First, I carry out the calibration procedure. The sensor passes all initialization steps correctly (Data Init(), Static Init() and so on). Then calibration is performed. For example, the following values were found:
spad_refSpadCount = 3,
spad_isApertureSpads = 1,
temperature_VhvSettings = 27,
temperature_PhaseCal = 1,
offset = 10000,
xtalk = 127.
Then, when starting the sensor, I first apply 0 to XSHUT for 1 second, then 1 for 1 second and then start initialization procedure, load calibration parameters to the sensor and then start reading values from the sensor. The problem is that at first launch it outputs 8191 (with a period of 200 milliseconds OR 30 milliseconds). I stop the program, start it again and the sensor outputs the correct values.
An example of this situation is in the log file. It shows that at first (correct) launch sigma value is 1.5 and signal return value is 16. But at second (wrong) launch sigma value is 655.53 and signal return is 0. That is, the sensor sees the signal well at one start, and at the second it does not see the signal at all, how is this possible? I don't see any difference between the first and second launch conditions/ambient light/distance. Calibration parameters written to sensor are the same.
What can I do to solve this problem? Stable rangefinder operation is very crucial part of our project.
2021-11-24 09:51 AM
I use this code for Raspberry: https://github.com/cassou/VL53L0X_rasp
The Datasheet describes that if the sensor is powered and the XSHUT is active, then the sensor is in HW Standby mode. It seems that in my case, the sensor does not always work correctly after exiting XSHUT mode. It can give errors RangeStatus = 2, RangeStatus = 4, and RangeStatus = 255. With a certain probability, after resetting the sensor using XSHUT, the sensor starts working correctly.
I use Dupont 20 cm wires, it looks like a 1 kOhm resistor between the XSHUT pin and the host stabilizes the sensor, that is, after resetting the sensor with XSHUT, it works stably without errors. This resistor is not on the circuit from the Datasheet, but it is in a number of circuits from the Internet. Is this resistor necessary and how can it affect the operation of the sensor?
Thank you.