--- ---

LiDAR

04 Jul 2020 - Courtney McBeth

LiDAR (which stands for Light Detection and Ranging) is used to measure distance values for searching or obstacle detection. Our LiDAR is a Lightware Optoelectronics SF11 Laser Altimeter. It has a range of up to 120 meters, but it is limited in usefulness since it is locked in position and can only sense what is directly in front of it. For this reason, I recommend using computer vision instead of LiDAR detection wherever possible.

Hardware Configuration

The LiDAR model that we use requires a 5V input. This must be taken into special consideration when using a microcontroller with a logic level of 3.3V. In this case, you will need to create a 5V line from the battery output. The pinout when using I2C protocol is as follows:

LiDAR Microcontroller
Red 5V Power
Black Ground
Green SCL
White SDA
Yellow Unconnected
Orange Unconnected
Blue Unconnected

It is also possible to use UART to communicate with the LiDAR, but I would not recommend this since UART pins are typically limited and the I2C bus is already in use by the IMU, so adding another peripheral does not take up any additional pins.

Software Configuration

The specifics of configuring I2C depend on the microcontroller used. The LiDAR has the 7-bit I2C address 0x66 (this should be left shifted if using the PIC32 to create the byte address) and can support clock speeds up to 400kHz. To read data from the LiDAR, first write the read distance command (0x00), then read 2 bytes. The two bytes, A and B, can be used to form the float distance reading as distance (in meters) = (A * 256 + B)/100.

Additional Notes

You can also connect the LiDAR to your computer to view its readings. To do this, download Lightware Terminal (Windows only).