The VL53L1X can perform laser-ranging up to a distance of 4 metres. Breakout boards are available from Pimoroni, Pololu, SparkFun, etc. I’ve created a XOD library for this device by wrapping https://github.com/pololu/vl53l1x-arduino. More information on the device can be found in the datasheet.
Thank you for the contribution! Very valuable. And the library design is nice
Thank so much for your work!! Is there any chance you are working on a library for the shorter range VL53L0X. If you are, thank you in advance!
Hi Michael,
I’ve created a library for the VL53L0X:
https://xod.io/libs/wayland/vl53l0x-time-of-flight/
However, I don’t actually have the sensor, so testing has been limited to checking that the example patch compiles.
Thank you for the contribution. Is there any node in the package to change the
size of ROI?
Unfortunately the underlying Polulu library for the VL53L1X doesn’t provide a function to change the size of the ROI and so there wasn’t an easy way to add such a node. However, it would be a useful addition. I’m really busy at the moment, but in a week or two I should have some time to work on this.
Thanks Wayland!
Is there a easy way to change/ add analog input pin for VL53L1x?I want to use two sensors and I can’t see how to do that.
Thanks in advance
/Stefan
The sensors will need to have different I2C addresses. It’s possible to change the I2C address of the VL53L1X using the Polulu C++ library, but I didn’t create a node for this function in my XOD library. When I update my library I’ll add a set-address node. In the meantime, you could use a multiplexer (e.g. https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout) to work with multiple sensors.
Great, thanks for the information, I will try the multiplexer!
Thanks for your work! Please create an I2c address change node
I’ve updated my library for the VL53L1X and added the following action nodes:
- set-roi (set region of interest)
- get-roi (read dimensions of region of interest)
- set-address (set the I²C address of the device)
- get-address (get the I²C address of the device)
For an explanation of how to use set-address, please read comments on the example-set-address patch.
Thanks for your work!!!
I’ve also created a library for the VL6180X:
https://xod.io/libs/wayland/vl6180x-time-of-flight/
Hi Wayland!
I connect VL53L1 (TOF400) to XOD and boot your example-test-tof-sensor.
https://aliexpress.ru/item/1005002281628586.html?spm=a2g39.orderlist.0.0.772d4aa6XuWNJX&_ga=2.101455617.1815410729.1634318994-1694745398.1625796805
Unfortunately the result is crash.
What could be causing this failure ?
Regards, Yury
Hi Yury,
Sorry to hear that you’ve run into a problem. I’ve just tested my library to make sure that it is working with the latest version of XOD (0.38.0) and all seems to be well:
Like you, I’m using an Arduino Uno. However, I’m using a different breakout board:
I think the issue is that the TOF400F uses the VL53L1 chip, rather than the VL53L1X chip. Unfortunately XOD doesn’t currently have a library for the VL53L1.
It might be worth scanning the I2C bus using @cesars i2c-scanner. If the ranging chip is a VL53L1X, the I2C scanner should report an address of 29h:
If you have a VL53L1 chip, the reported address will be 52h.
Thanks, Wayland!
I have very strange results: scanner i2c show only zeros (. . 00h 00h 00h 00h 00h).
I set 2 resistors 10 kom and changed sensor, but … only zeros.
When I use ttl->usb module, I can see some data on monitor but now I dont understad how calculate distance from this data.
Regards,
Yury
The VL53L1 uses I2C to communicate, so if the i2c-scanner cannot find the device, then there must be a problem with the device, the Arduino or the way they have been wired together. Is the Arduino able to detect other I2C devices?
If you are able to resolve the hardware issue and successfully communicate with the VL53L1 using I2C, then you can potentially use the device with XOD. As XOD doesn’t have a library for the VL53L1, you will have to create your own. There are two options for doing this:
-
If you’ve got some experience with C++, you could wrap the Arduino library for the VL53L1. Official documentation for wrapping libraries can be found here. An unofficial guide can be found here.
-
Alternatively, if you want to avoid C++, you could build a library using the XOD I2C nodes.