

The VL6180X is a time-of-flight (ToF) distance sensor capable of measuring distances up to 100 mm with high accuracy. It integrates an infrared emitter and a photodetector, enabling it to measure proximity and ambient light levels. This compact sensor is widely used in robotics, automation, and consumer electronics for applications such as obstacle detection, gesture recognition, and ambient light sensing.








The VL6180X is a highly integrated sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 2.6 V to 3.3 V |
| Communication Interface | I²C |
| Distance Measurement Range | 0 mm to 100 mm |
| Ambient Light Sensing Range | 0.01 lux to 1000 lux |
| Current Consumption | 1.7 mA (typical during operation) |
| Infrared Wavelength | 850 nm |
| Operating Temperature Range | -20°C to +70°C |
| Package Dimensions | 4.8 mm × 2.8 mm × 1.0 mm |
The VL6180X has a simple pinout, as shown in the table below:
| Pin Name | Description |
|---|---|
| VDD | Power supply (2.6 V to 3.3 V) |
| GND | Ground |
| SDA | I²C data line |
| SCL | I²C clock line |
| GPIO0 | Interrupt output (optional, configurable) |
| GPIO1 | Additional interrupt or shutdown control (optional) |
Below is an example of how to use the VL6180X with an Arduino UNO to measure distance:
#include <Wire.h>
#include <Adafruit_VL6180X.h>
// Create an instance of the VL6180X sensor
Adafruit_VL6180X vl = Adafruit_VL6180X();
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Wire.begin(); // Initialize I²C communication
// Initialize the VL6180X sensor
if (!vl.begin()) {
Serial.println("Failed to find VL6180X sensor! Check connections.");
while (1); // Halt execution if sensor initialization fails
}
Serial.println("VL6180X sensor initialized successfully.");
}
void loop() {
// Read the distance in millimeters
uint8_t distance = vl.readRange();
// Check for errors in the measurement
if (vl.readRangeStatus() != VL6180X_ERROR_NONE) {
Serial.println("Error reading range!");
} else {
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" mm");
}
delay(500); // Wait for 500 ms before the next reading
}
Sensor Not Detected on I²C Bus
Inaccurate Distance Measurements
Intermittent Readings
Q: What is the default I²C address of the VL6180X?
A: The default I²C address is 0x29. It can be changed in software if needed.
Q: Can the VL6180X measure distances beyond 100 mm?
A: No, the VL6180X is designed for accurate measurements up to 100 mm. For longer ranges, consider other sensors like the VL53L0X.
Q: Is the VL6180X suitable for outdoor use?
A: The sensor can be used outdoors, but its performance may degrade in direct sunlight or extreme environmental conditions.
Q: How do I handle multiple VL6180X sensors on the same I²C bus?
A: Use the GPIO1 pin to reset individual sensors and assign unique I²C addresses during initialization.
By following this documentation, you can effectively integrate the VL6180X into your projects and troubleshoot common issues.