Time of Flight (Z data)
Distance to the ground is measured after the scanner moves, which is added to the Lidar measurements (XY) as the Z coordinate for points. Multiple different sensors / devboards were evaluated; looking at their accuracy, repeatability, maximum range, and software compatibility.
| Sensor | Protocol | Library | Purchase |
|---|---|---|---|
| VL53L5CX | I2C | AliExpress | |
| VL53L3CX | I2C | AliExpress | |
| VL53L1X | I2C | AliExpress | |
| VL53L0X | I2C | AliExpress | |
| VB10A | UART | AliExpress | |
| TOFSense-F2 Mini | AliExpress | ||
| TWTOF240UI | UART | AliExpress | |
| M01 | UART | AliExpress |
Working Principle
All these modules have a light emitter, combined with a light detector for the same frequency. By timing how long it takes for emitted light to reflect back and hit the detector, the distance to the reflector can be measured by multiplying the time by the speed of light, divided by two.
”Basic time-of-flight principles applied to laser range-finding” by RCraig09
licensed CC-BY-SA-4.0 .Sensor Selection
STMicroelectronics Catalog
ST has a lot of different options in the VL53 series, which are all fully integrated modules with IR laser emitters and detection arrays. How to choose a Time-of-Flight sensor has a good overview of their differentiating criteria.
Others
A handful of additional sensors were selected by browsing AliExpress for options under 20 euros.
Field of View Testing
If the module’s FoV is wide enough, reflections might be picked up from the sides of the blade. Because of the angle of incidence this reflection is expected to be much weaker than the reflection from a (white) ground surface. On modules that report multiple distance to multiple targets, or distance for multiple zones, these might show up. To test this, each module is mounted on a tripod, aimed horizontally at a white surface 2 meters away. By lowering the mounting height, we can see at which point the “side” (ground) reflection is detected.
VL53L5CX
Multizone ranging sensor from STMicroelectronics, simultaneously measures distances on either an 8x8 or 4x4 grid of points.
65° diagonal FOV (square), max range (datasheet): up to 400cm. datasheet
Identification
I2C at 1MHz, address 0x52
- Write
0x7fff 0x00- Read
0x00: Device ID should be0xF0 - Read
0x01: Revision ID should be0x02
- Read
Drivers
Tested using https://github.com/stm32duino/VL53L5CX , easy to get working based on example code in repo. Control over grid size (4x4, 8x8), sensor integration time. Can also return distance for up to 4 targets per zone (grid item), similar to VL53L3CX. Grid distance readings can be averaged (possibly center-weighted), or maybe used to detect ground plane orientation.
VL53L3CX
‘Multi target’ ranging sensor from STMicroelectronics, can return distances to multiple targets.
25° FOV, max range (datasheet): up to 300cm. datasheet
Identification
I2C at 1MHz, address 0x52
- Read
0x010F: Model ID should be0xEA. - Read
0x0110: Module Type should be0xAA.
Drivers
Using https://github.com/stm32duino/VL53L3CX , difficult to get working at first, as it seems to rely on using the additional interrupt pin.
By setting the interrupt GPIO to 0, its ignored, and new readings can be polled using the .VL53LX_GetMeasurementDataReady() method.
There’s an alternative driver for ESP-IDF, https://github.com/mssaleh/ST_VL53LX , which also mentions a ‘critically neccessary’ calibration procedure for crosstalk compensation. This will likely improve accuracy with the other library as well, but the process/code for this is not documented.
VL53L1X
Single target ranging sensor from STMicroelectronics.
27° FOV, max range (datasheet): up to 400cm. datasheet
Identification
I2C at 400kHz, address 0x52
- Read
0x010F: Model ID should be0xEA. - Read
0x0110: Module Type should be0xCC. - Read
0x0111: Mask revision should be0x10.
Drivers
Lots of options, by Pololu , stm32duino , SparkFun , and Adafruit , as they all make their own breakout modules for this sensor. The SparkFun and Arduino libraries are direct forks/wrappers around the stm32duino library, while Pololu made their own simplified implementation.
VL53L0X
Single target ranging sensor from STMicroelectronics.
25° FOV, max range (datasheet): up to 200cm. datasheet
Identification
I2C at 400kHz, address 0x52
- Read
0xC0: Model ID should be0xEE. - Read
0xC2: Revision ID should be0x10.
Drivers
This is the most common ToF sensor, with many module-manufacturers publishing their own library (derivatives). However, 2m range can only be achieved in ideal conditions, and most libraries only support ‘normal’ operation mode, which is limited at around 1m range. As such, this sensor is not recommended.
VB10A
TOFSense-F2 Mini
TWTOF240UI
M01
Single point 650nm laser ranging module, available with max ranges from 5m to 50m.
Advertised as 0.001m ranging resolution, ±2mm accuracy. Communicates over UART with 9600 baudrate.
Drivers
Example code by Andres-ros , linked from Aliexpress product description. I have reassembled the UART protocol documentation from images in the listing description into a datasheet PDF.