VL53L0X Arduino Interfacing and Programming

(Last Updated On: October 24, 2021)

VL53L0X Sensor, Descriptions:

VL53L0X Arduino Interfacing and Programming- Unlike the other Ultrasonic Sensors and ToF10120 Laser Rangefinder, the VL53L0X can also be used for the object or obstacle detection. This sensor can measure distances of up to 2 meters with a resolution of one millimeter and it can be operated from 2.6 to 3.5 volts. Which makes it an ideal sensor and can be used with 3.3V compatible controller boards “STM32, ESP32, ESP8266, etc” and can also be used with 5V controller boards like Arduino, etc. It uses a 940 nanometer infrared emitter which is invisible to the human eye and it is also eye safe meaning that it will not cause any damage to your vision. You will see a couple of components which take care of the voltage level conversion this means that we can directly powered the sensor using 3.3 volts or 5 volts and that we can also interface it to a microcontroller that works on either 3.3 volts or 5 volts and this greatly simplifies things for us. On the top side, we have the sensor and the header pins that will be used for interfacing. It uses i2c for communication which means that we only need a total of four pins for operation. The XSHUT pin can be used to keep the sensor in the reset state, it is active low which means that you will need to connect it to ground to reset the sensor. GPIO1 is an interrupt pin that can be used to send the signal to the microcontroller to notify when the measurement is complete. Please check to see if there is any protective film over the sensor and if so then you will need to remove it in order to get the correct readings.


Ranging measurements are available through the sensors I²C (TWI) interface, which is also used to configure sensor settings,and the sensor provides two additional pins: a shutdown input and an interrupt output. The VL53L0X is a great IC, but its small, leadless, LGA package makes it difficult for the typical student or hobbyist to use. It also operates at a recommended voltage of 2.8 V, which can make interfacing difficult for microcontrollers operating at 3.3 V or 5 V.
Our breakout board addresses these issues, making it easier to get started using the sensor, while keeping the overall size as small as possible.

Amazon Links:

VL53L0X Sensor

12v Adaptor:

Arduino Uno

Arduino Nano

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!




VL53L0X PIN Description:

VDD Regulated 2.8 V output. Almost 150 mA is available to power external components. (If you want to bypass the internal regulator,you can instead use this pin as a 2.8 V input with VIN disconnected.)
VIN: This is the main 2.6 V to 5.5 V power supply connection. The SCL and SDA level shifters pull the I²C lines high to this level.
GND: The ground (0 V) connection for your power supply. Your I²C control source must also share a common ground with this board.
SDA Level-shifted I²C data line: HIGH is VIN, LOW is 0 V
SCL Level-shifted I²C clock line: HIGH is VIN, LOW is 0 V
XSHUT This pin is an active-low shutdown input; the board pulls it up to VDD to enable the sensor by default. Driving this pin lowputs the sensor into hardware standby. This input is not level-shifted.

VL53LOX VS Ultrasonic sensor:

We have used the ultrasonic sensor before which is also used to measure distance the principle is the same for the two sensors. They both emit a signal and determine the time it takes for this signal to bounce back and get received, by knowing the time it takes for this signal to complete a round-trip. You can determine the distance between the sensor and any object that’s placed in front of it.


The ultrasonic sensor uses sound we that are in the 40 kilohertz frequency range while the Lidar sensor emits light that has a wavelength of about 940 nanometers one thing to keep a note off is that since we are using light the measurement cone is going to be much narrow when compared to the ultrasonic sensor. A quick comparison between the two sensors is that the ultrasonic sensor can measure up to four meters while the Lidar sensor is limited to about 2 meters at the low end. The ultrasonic sensor starts at about two centimeters while the Lidar starts about three centimeters. The ultrasonic sensor module only works at five volts while the Lidar module can work at either 3.3 volts or 5 volts. The ultrasonic sensor also uses PWM for both control and the output signal while the Lidar uses i2c for communication which simplifies things a bit. Finally the ultrasonic sensor weighs about 8.5 grams while the Lidar sensor weighs about 1.15 grams and both these were measured with the header pins.

VL53L0X sensor interfacing with Arduino:


  • Connect the VCC of the VL53L0X sensor with 5V of the Arduino
  • Connect the ground of the VL53L0X sensor with the ground of the Arduino
  • Connect the SDA pin of the VL53L0X sensor with analog pin A4 of the Arduino which is I2C SDA pin
  • Connect SCL pin of the VL53L0X sensor with the analog pin A5 of the Arduino

VL53L0X Arduino Programming:

Now for coding first of all we will insert the VL53L0X library.

Download VL53L0X Library:

 Open the Arduino IDE and go to the sketch, now in sketch click on the add zip library and insert the zip library of VL53L0X.


Now after installing the library go to file menu and in file menu click on examples and in examples click on the VL53L0X and now click on Single code will open.


Now after uploading the code to the Arduino UNO, You will be able to see the output of the sensor on the Serial Monitor.

Ultrasonic Sensor Related Projects:

Obstacle detection with HC-SR04 Ultrasonic Sensor

Safe Distance maintaining Robot Car

Bi-directional visitors counter

Hand Washing Timer Project using Arduino and Ultrasonic Sensor

Ultrasonic Sensor with Raspberry Pi

Social distancing project

IoT based Flood Monitoring System using Ultrasonic Sensor and ESP8266

Smart Dustbin using Arduino and Ultrasonic Sensor

Water Level monitoring System

IoT based Water level Monitoring System

ToF10120 Related projects:

Distance measurement with ToF10120 Laser RangeFinder and Arduino

IoT Water Level Monitoring using ToF10120 and ESP8266

Car parking system using Arduino and ToF10120 Laser distance sensor

IoT water level monitoring using ESP32 and ToF10120 Sensor

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

%d bloggers like this: