ESP32 VL6180X Time-of-Flight Sensor Pinout, Wiring, ESP32 and more

VL6180X

Protocol: I2C

Overview

The VL6180X is a short-range proximity and ambient light sensor that combines a 3-in-1 system: IR emitter, sensor, and ranging processor. It is ideal for gesture recognition, presence detection, and compact robotics applications.

About VL6180X Time-of-Flight Sensor

📏 VL6180X Sensor Overview

  • Range: 0cm to 50cm (Max)
  • Interface: I²C digital communication
  • Resolution: 1mm precision
  • Field of View: 25°
  • Operating Voltage: 2.8V to 5V (via onboard regulator)
  • Typical Current: ~20–30mA
  • Wavelength: 850nm IR
  • Integrated Ambient Light Sensor

Where to Buy VL6180X Time-of-Flight Sensor

Starting from

1.15$ per unit

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

VL6180X Datasheet and Technical Specifications

Operating Range 0cm to 50cm
Blind Zone 0–2cm
Resolution 1mm
Voltage Range 2.8V to 5V
Current Consumption ~20–30mA
Interface I²C
Wavelength 850nm
Field of View 25°

VL6180X Pinout Diagram

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

  • VIN: Power supply input (3.3V–5V)
  • GND: Ground
  • SHDN: Shutdown (active low)
  • SDA: I²C Data
  • SCL: I²C Clock
  • GPIO: Interrupt or general I/O
  • 2v8: Regulated 2.8V output

VL6180X Wiring with ESP32

To connect the VL6180X to an ESP32 (I²C):

  • VIN → 3.3V or 5V
  • GND → GND
  • SDA → GPIO21
  • SCL → GPIO22
  • SHDN → Optional (tie high to enable)
  • GPIO → Optional (interrupts or alerts)

VL6180X Troubleshooting Guide

Common Issues

❌ No Output or Initialization Failure

📉 Distance Stuck at Zero or Max

⚡ Unstable Power Supply

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

VL6180X Code Examples

Arduino Example

C++
🏠

ESPHome Example

YAML
🐍

MicroPython Example

Python

Conclusion

The ESP32 VL6180X Time-of-Flight Sensor is a powerful distance sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.