2024-02-02 01:52 AM
I use a VL53l1X looking trough a oil layer of ca. 20 mm. When getting measured distance 3 times with GetResult(), it returns (example):
Status = 0, dist = 11, Ambient = 16, Signal = 20936, #ofSpads = 6
Status = 0, dist = 19, Ambient = 8, Signal = 18104, #ofSpads = 6
Status = 0, dist = 38, Ambient = 16, Signal = 15864, #ofSpads = 19
--> some 'magic' automatic changed the NrOfSpads from 6 to 19, which also affects the measured distance. When I set the NrOfSpads with VL53L1X_Status_t VL53L1X_SetROI(uint16_t X, uint16_t Y);, this only limits the maximal used NrOfSpads, but it's further possible that the sensor switches to a lower NrOfSpads autonomous.
How can I force the sensor to use a defined NrOfSpads?
Solved! Go to Solution.
2024-02-14 09:54 AM
Alas you cannot.
The sensor does a Dynamic Spad Select (DSS) at the start of ranging. Ideally the senor wants a signal of 20M. So it adds SPADs if the signal is low and it turns some off it the signal is high.
(It takes energy to reset or 'quench' a SPAD, so the object is to pick just the right amount. And despite the #ofSpads being an integer, there are some that are occluded and if you really dig into the code you can see a float.)
Try your experiment again changing from a black bit of paper to a piece of aluminum foil. You will see the # of SPAD fluctuate to the extremes.
I'm not sure what caused your SPAD count to change so much. But I'd have to guess it was a change of target reflectivity. And the reflectivity extremes lead to most of the error we see in the sensor.
2024-02-14 09:54 AM
Alas you cannot.
The sensor does a Dynamic Spad Select (DSS) at the start of ranging. Ideally the senor wants a signal of 20M. So it adds SPADs if the signal is low and it turns some off it the signal is high.
(It takes energy to reset or 'quench' a SPAD, so the object is to pick just the right amount. And despite the #ofSpads being an integer, there are some that are occluded and if you really dig into the code you can see a float.)
Try your experiment again changing from a black bit of paper to a piece of aluminum foil. You will see the # of SPAD fluctuate to the extremes.
I'm not sure what caused your SPAD count to change so much. But I'd have to guess it was a change of target reflectivity. And the reflectivity extremes lead to most of the error we see in the sensor.