cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L8CX Intermittent Stopping Issue

jaeho_rhinos
Associate II
 

Hello,

I am using the VL53L8CX ToF sensor (I2C) and have encountered an issue. Currently, I’m not using a coverglass, and I have set the sensor to an 8x8 resolution with a frequency of 15 Hz.

The problem is that when I run the sensor in an infinite loop, it stops collecting data after a while, usually within 10 minutes, without displaying any error messages.

Could you please help me identify the cause of this issue and suggest possible solutions?

Thank you in advance!

6 REPLIES 6
jaeho_rhinos
Associate II

I guess 15hz was too fast to continuously getting data. So I set 10hz and it runs well. Which frequency do you recommend for long time measurment like a few hours.

John E KVAM
ST Employee

That's not a very good solution. Whatever was killing your 15 frame solution will kill your 10 frame solution, it will just take longer. 

Most of the time, it's an I2C issue. Wires longer that 1foot are problematic. It's not just our sensor - it's an i2c issue. But this sensor has much more traffic. Shorten the wires if you can. Or twist a ground with the CLK line. (SDA line too if you have another ground available. 

Another issue is noise on the LPn pin. Pull that up robustly. 

Power can be another issue. This sensor draws a lot of power - in bursts. If you power supply is not up to the task you can cause a partial reboot on the ranging engine, and the only way to fix it is to re-initialize it. 

I'm going to bet on that last issue. Running at 10 frames is 1/3 more gentle on your power supply than is the 15 frames.

-john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
jaeho_rhinos
Associate II

Wires are alredy short enough.

I2C connection has no problem.

I think power is not the reason because we keep supplying power and my code (python) assigns 30% of CPU when running.

What do you think about adding defensive code to reinitialize the driver during execution?

 
 

Well clearly you can, but don't give up just yet. I'm going to postulate that the sensor uses more power than you might guess for short bursts. Try putting a scope on the power lines and looking for a voltage drop. It might just be that it takes a bit more power than you are supplying. 

One has to assume things are going to fail and so defensive code is always a good idea. If you are expecting a range result and don't get one, you can always drop the power, bring it back up and start over. 

But the fact that slowing the sensor causes it to be more stable, would lead me to guess some sort of power starvation. 

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
jaeho_rhinos
Associate II

Thanks! I am still troubleshooting.
Voltage was one of the problems, and I have more question.

I am using the Raspberry Pi 5 as the MCU, which has an internal 1.8k pull-up resistor. The VL53L8CX has a 2.2k pull-up, so I wonder if this could be too high for stable communication. What would be the ideal pull-up resistor value for I2C communication?

Also, I have another question: We are using I2C bus 0 (i2c_vc). Is it appropriate to use an I2C speed of 1 MHz?

I use a RPi 5 and connect the sensor no problem. But I use the VL53L8-Satel board. And it has lots of voltage regulators on it. 

1M is just fine. But you will be limited to about 1foot of I2C line unless you really tune it.

I'm not good at calculating the amount of pull-up required. But there are lots of documents on-line that can help.

Philips invented the bus years ago. And NXP bought Philips. I generally to there for tuning advice. But lots of people have written articles on the subject and they did a better job than I would have. 

 

 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.