Multiple VL53L1X sensors with 5x16 RoI arduino programming

Hello, I hope someone can help me with this.

I have 3 VL53l1x and i have connected and programmed all of the 3 sensors to a arduino nano and I am receiving data from all three at the same time.

I tried to perform 5x16 RoI for all three VL53L1X sensors with 200 ms timing budget , but am not really sure how to program it correctly cause m not getting the results I need.

Is there any sample code that I can follow, Thank you soo much

Hello.

There are a couple forum members who have posted their code for multiple sensors, such as oleglyan in this post (note that this code is for the VL53L0X, but the general idea is the same). However, we only recently released the ROI support for our VL53L1X library and do not yet have any specific examples showing how to use that. What have you gotten working so far and what part is giving you trouble? Could you post your sketch so far with a description of what happens when you run it?

Brandon

1 Like

Thank you so much
I have programmed all the 3 vl53l1x sensors with Region of Interest (5x16) and timing budget of 200 ms with short distance mode.

  1. I wanted the sensors to give me the measurements once every 200 ms with accuracy (That’s why I added the timing budget 200 ms) at the same time, but now that I have programmed it am getting data once every 600 ms .Is there any mistakes I might have made?

  2. I studied in the datasheet that the short distance mode gives a max distance of 1.5 m with full FoV and the long distance which is less accurate up to 4 m, but I got 2.4 m with 5x16 RoI in short mode. For my project accuracy is very important and I also wanted a distance of 4 meter(If the sensor permits) , Is the long distance mode less accurate with high standard deviation than the short.

Thanks for your help

  1. The timing budget is the longest time the sensor will wait before returning a value, but if it is able to compute a result sooner than that, it will return the reading before the full timing budget has passed. I am not sure why you are only getting readings every 600ms, but if you post a simplified but complete version of your code that demonstrates the problem, I would be glad to take a look.

  2. The datasheet lists the typical ranging error in short and long distance mode at around ±20-25mm in ambient light conditions. But please note that the sensing area will get much larger at longer distances (depending on the programmed FOV), so if your target does not cover the full area, you could get less accurate readings.

Brandon

1 Like

Thank you so much @BrandonM
we made some changes in the code and we are getting measurements once every 200 ms.
Really appreciate it. :grin:

Hey @BrandonM , I know I said I got it but I am working on it again and am facing the same issue.
// Set the timing budget. Keep in mind these can only be predefined values
// This is the time that a measurement will take.
// Allowed values: 15, 20, 33, 50, 100, 200, 500
sensor_1.SetTimingBudgetInMs(200);
sensor_2.SetTimingBudgetInMs(200);
sensor_3.SetTimingBudgetInMs(200);
This is how I kept timing budget for all the 3 sensors.
Expected Out put : 310mm-249mm-124mm (I want this data every 200 ms from individual sensors in the monitor, in the same string)
Output am getting : 310mm-249mm-124mm (I am getting data every 600 ms )
Thank you so much

Could you post a simplified but complete version of your code that demonstrates the problem?

Brandon