Sensor with separate header pins

Using the VL53L1X Time-of-Flight Distance Sensor

This short tutorial introduces the VL53L1X Time-of-Flight (ToF ) distance sensor. For more tutorials on distance sensors, including various applications, look here. You can buy this sensor here.

If you bought it like this:

Sensor with separate header pins

You will first have to solder the header pins.

Connect the sensor

Because the sensor uses I2C its wiring is simple:

Sensor:     Arduino:    Wire color in diagram:
GND         GND         black
VCC         5V          red
SCL         A5 (SCL)    yellow
SDA         A4 (SDA)    blue

It’s operating voltage is 3.3V or 5V, so feel free to connect VCC to either of those.

Test with given example sketch from library

To use the sensor in the Arduino IDE you can install the library “VL53L1X” by Pololu:

After installation, select the example “Continuous” (via File > Examples):

Next, you may Upload this example, and start the Serial Monitor to see its output.

I made some minor changes to the code to have output less frequent and to store the distance value in a variable:

More information