2024-12-04 11:41 AM
Hi ST,
Using the vl53l1x in our devices we are finding some cases of unexplained sensor distance changes. Large changes.
We use the sensor in a contained/controlled environment. A bin -- the sensor is used to measure distance to items contained in the bin.
We have seen some cases where the sensor behaves normally and then, unexplained, it spikes way up. From 100mm to 2meters measurements for instance.
Powering off and powering on brings it back to normal.
We are unsure where to start looking here so wanted to ask first here. What might be possible causes of this?
Thanks,
Will
2024-12-04 12:10 PM
Look at the RangeStatus - this is not the status from the function call, but the status the sensor returns. It tells you what might have gone wrong.
When you get the distance, you also get a signal return, along with the status and a Sigma.
Did your signal strength change a lot?
If your sensor partially rebooted (which can happen) the distance and signal strength stay exactly the same.
If you see this, then check that you are not starving the sensor of power. It uses quite a bit in very small bursts, so you might look there. Also check there is no noise on the XShut line. That can also cause a partial reboot.
2M is a strange number. Generally, when something goes completely wrong, you get an 8192 minus the error.
So typically, 8191 or 8190.
The VL53L1X averages all the photon times it gets back. So, if you have a target at 100mm and another at 3M, and both are in the field of view, you can get an average of 2M.
There is a Sigma return, that give you the standard deviation of your result. It should be small, but with two widely different targets it could be large indeed.
What about ambient light? Sunlight really screws up the sensor. But if you were getting ambient issues, a reboot would not fix it. The amount of ambient is also returned.
- john
2024-12-04 03:37 PM
John,
We use the reading method that returns:
typedef struct {
uint8_t Status; /*!< ResultStatus */
uint16_t Distance; /*!< ResultDistance */
uint16_t Ambient; /*!< ResultAmbient */
uint16_t SigPerSPAD;/*!< ResultSignalPerSPAD */
uint16_t NumSPADs; /*!< ResultNumSPADs */
} VL53L1X_Result_t;
Right now we do not capture all of this to our production telemetry but we are adding it today. We have not been capturing Ambient, SigPerSPAD or NumSPADs.
No Sigma in the result however? We do not set thresholds using the ST API and instead take care of this in our business logic.
For our large example I can say we got a 0 (zero) for the result status.
As usual John thank you so much,
Will
P.S. Looking into XShut -- I'm not even sure right now what that is :)