How to implement 2D LiDAR using Time-of-Flight Sensors
How to use ToF Sensor to make 2D LiDAR
The Time-of-Flight (ToF) sensor measures the distance by calculating the time taken by a light pulse to travel from the source to the observed target and then return to the detector. The following formula calculates the flight time:
Distance value = Photon travel time/2 x the speed of light
To learn more about ToF technology, please click here
ToF sensors can be used to make a Lidar, which stands for Light Detection and Ranging, this is a calculation technique whereby light is used to measure the distance to the closest object. A 2D LiDAR uses a moving light beam to scan an object in two dimensions to provide rotational movement and distance information. The ToF sensor used in a 2D LiDAR measures values in sequential order at an equal time interval between measurements. The sensor has a field of view (FoV) which defines the Region-Of-Interest (ROI) size on the receiving array. As illustrated in figure 1, several ToF sensors can be fixed in circular form, tilting every sensor at some angle and connecting in parallel to execute a surround 2D LiDAR scan.
Figure 1: 180° Scanning with Nine Sensor
A ToF sensor can be based on an interface such as I2C, UART, CAN, or any serial interface to be directly connected with a host controller like an ARDUINO or an STM32 board. It can also be connected to a host computer such as Raspberry Pi or a Windows based computer using a UART to USB or serial converter. Figure 2 shows a general block diagram to interface a ToF sensor with a controller board and a computer. To learn more about the serial interface, please click here.
Figure 2: Connection between Host Controller and Sensor
For example, nine VL53L1X long-distance-ranging ToF sensors can be parallel connected, creating a simple environment depth map with a 180° FoV. Each of the nine sensors has a 20° FoV to cover the total 180° FoV of the LiDAR, and the firmware is programmed to give 13 data points per sensor. So a complete 180° sweep would create a total of 117 data points. The timing budget is around 12mS per sensor ‘zone,’ which would equate to a total sweep time of approximately 160mS, giving a frame rate of a little more than 6 FPS. It is possible to develop an end application using the VL53L1X ULD API (ultra-lite driver application programming interface). It has a C function set controlling a single sensor or multiple sensors for initialization and ranging. This structured API can be compiled on any platform through a well-isolated platform layer mainly for low-level I²C access.
The hardware setup involves using the P-NUCLEO-53L1A1 combined with the X-NUCLEO-53L1A1 expansion board and the STM32F401RE NUCLEO, as shown in figure 3. The nine sensors attached to the VL53L1X breakout boards share identical I2C interface, ground, and power. Each sensor reset pin connects to an allocated host GPIO pin.