Application Examples
Last updated
Was this helpful?
Last updated
Was this helpful?
While the REV 2m Distance Sensor produces a significantly more accurate and reliable measurement than other types of ranging sensors, the following tips will help minimize errors.
A major benefit to time-of-flight measurements is that the target’s surface reflectance does not significantly impact the calculated distance. However, the smallest errors and farthest measurements are achieved with more reflective targets. Similarly, larger targets are easier to detect because they fill more of the sensors 25° field of view.
Ambient infrared (IR) interference can also affect the measurement distance and quality. The sensor can produce accurate measurements in sunlit environments, but the maximum distance will be reduced. The following table outlines the typical ranging capabilities of the sensor:
Target Reflectance
Indoor
Outdoor (overcast)
White (88%)
200 cm †
80 cm
Grey (17%)
80 cm
50 cm
† Using long range API profile; default profile range is 120cm.
Configure the 2m Distance Sensor as "REV 2M Distance Sensor," shown in the image below.
In this example, the 2m Distance Sensor is configured on I2C bus 1. The 2m Distance Sensor can be configured on any of the I2C busses as long as a Color Sensor V3 is not configured to the same bus.
This program moves a motor if there is an object less than 10 centimeters from the distance sensor, and stops it if there is no object within that range.
Example Code
Additional information about the VL53L0X, its capabilities, and the ST Application Programming Interface (API) can be found through the ST website:
For use with WPILib and the roboRIO the . Utilize the roboRIO's I2C port and a 4-pin JST PH to 4-pin roboRIO I2C Cable () to easily connect the sensor to the roboRIO.