ESP32 TOF050C Time-of-Flight Sensor

TOF050C Time-of-Flight Sensor image

TOF050C

Protocol: I2C

Overview

The TOF050C is a short-range laser-ranging sensor using the VL6180 chip, offering highly accurate distance measurements up to 50 cm. It is optimized for applications such as gesture recognition, proximity detection, and short-distance object tracking.

About TOF050C Time-of-Flight Sensor

📏 TOF050C Sensor Overview

  • Range: 0cm to 50cm (Max)
  • Interface: I²C digital communication
  • Resolution: 1mm accuracy
  • Field of View: 25°
  • Operating Voltage: 3.0V to 5.0V
  • Typical Current: ~40mA
  • Infrared Wavelength: 850nm

Check Other sensors modules based on VL6180X Time of Flight Sensor:

Where to Buy

TOF050C Time-of-Flight Sensor

Starting from

2.10$ 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.

Technical Specifications

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

Pinout Configuration

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 (3.0V – 5.0V)
  • GND: Ground
  • SDA: I²C Data
  • SCL: I²C Clock
  • INT: Interrupt output
  • SHUT: Shutdown (active low)

Wiring with ESP32

Connect the TOF050C sensor to an ESP32 using I²C:

  • VIN → 3.3V or 5V
  • GND → GND
  • SDA → GPIO21
  • SCL → GPIO22
  • INT → Optional
  • SHUT → Optional

Troubleshooting Guide

Common Issues

📉 Stuck at Zero Distance

🚫 Sensor Not Detected

⚡ Power Issues

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🏠

ESPHome Example

YAML
🐍

MicroPython Example

Python

Conclusion

The ESP32 TOF050C 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.