Multiple VL6180X

i want to use two VL6180X for short distance measurement (horizontal and vertical measurement) the reading should be simultaneously…with arduino Mega.
i have already tried with VL53L0X and its working fine.but its not accurate for short distance measurement.
i need source for liabrary and code if possible for VL6180X…


You can find what code we have available for the VL6180X, namely an Arduino library, under the Resources tab of the VL6180X product page. This application note on ST’s product page gives an example of how to use multiple VL6180X on the same I²C bus. The process is basically to reset all VL6180X connected to a bus, then individually take each unit out of reset by making GPIO0/CE HIGH, and write a new I²C device address to each particular unit. Then, you should be able to send commands to each individual unit using their unique slave addresses. While we do not have an example sketch that does that, you can follow this thread on our forum, where the original poster uploaded a snippet of code that does that.

By the way, what short distances are you planning on measuring and what accuracy do you need?


maximum distance measurement is 10cms …in millimeter range…
surface is Steel/Aluminium

The material and maximum distance you plan to sense seem fine for the VL6180X, though accuracy in the millimeter range seems right at the threshold of what the sensor can do. You can see what information is available for the accuracy of the sensor under the “Performance specification” section of the VL6180X datasheet, which you can find under the Resources tab of its product page.


does the accuracy affects on usage in day or night?
in day light will be bright…will it effect the measurements?
my application is outdoor…

The sun emits light across a variety of wavelengths, including those in the IR range that this sensor uses. So, we expect the performance of this time of flight sensor to be worse during the day. Incorporating some kind of physical shielding to limit exposure to sunlight might help.


Thanks jon…

Which gives more accuracy Single Mode or Continuous mode?

We suspect the accuracy of both of those modes to be about the same.