mjbogusz/vl53l0x-linux

¿max sensors amount?

kikomayorga opened this issue · 8 comments

Hi! Thanks for your great contribution!

I was wondering if your library would work with 96 sensors.

Do you think it would?

And what could be the max reading frequency it could handle?

Or, what do you think would be the limit in amount of sensors and frequency? (if trying to connect the most sensors possible)

Thank you so much for your reply : )

Kiko from Perú

Theoretically it should work.

You're limited by the amount of GPIOs you have (you can use shift registers or I2C expanders for that) and to the number of I2C slaves on the same bus.
I believe the VL53L0X uses the standard, 7-bit address space, so you should be within the bus limit of 128 devices (including the master).

The maximum I've tested was with 6 sensors on the same bus, all set to 20ms measurement budget and it managed to read with 50Hz or even slightly above.
However, with almost 100 sensors it might be difficult to achieve that. Also, 20ms budget is quite low and hinders the measurement accuracy - I'd advise for 25ms (~40Hz) for much better measurements.

I'd say 127 sensors with about 40Hz should be possible, but it might require some fine-tuning and can very well be limited by specific system's I2C implementation and handling (e.g. i2cdev, as used by this library, vs DMA access).

Dear mjbugusz,

Thank you so much for your kind reply.
It sounds fantastic if we can achieve 127 sensors at 40 Hz. That would be amazing!
We will start our tests and let you know. : )
BTW: would you advice something regarding the length and type of the i2c cables?

Thanks!

I'm not sure if that's achievable, but with fine-tuning the range reading sequence on the host side etc it shouldn't be impossible.

I'd recommend 40Hz (as opposed to 50Hz) for much better accuracy at the cost of just slightly slower reads, but it shouldn't really matter that much for that many sensors.

I've only used short (10-15 cm) ribbon cables, but a quick web search suggests measuring the capacitance of the whole circuit.

Also, if reading everything on one bus fails due to whatever reasons, you can always use few Attinys (or similar MCU) as "relays", acting as a master for 5-10 sensors on one bus and as a slave returning few readings at a time for the real master on a second one.

Ok! i see : ) we were thinking of a similar "i2c to rs485" interface based on an "arduino pro mini" and so to do sub-buses ... ok we will try. thanks!

and thanks for the link!!!!

If your host supports RS485 then that's an option too of course.
Let me know how it works out for you - it sounds like an interesting project!

@kikomayorga any updates on your project? Did it work or did you have to take the sub-buses route? I'm curious how did it go ;)

Also, if you can disclose that information, what did you plan to use 96 of these sensors for?

Closing this as it's not really an issue.

Feel free to post any updates on your project though!