LamaPLC: TOFnnnC STMicroelectronics Time-of-Flight (ToF) sensors with I²C communication

TOF400C The TOF050C, TOF200C, and TOF400C are a series of laser ranging sensor modules that use Time-of-Flight (ToF) technology to measure distances. They are designed for easy integration with microcontrollers such as Arduino and STM32 via the I²C interface.

These modules are based on different underlying STMicroelectronics chips, which determine their maximum measuring distances. They are commonly used in applications such as robot obstacle avoidance, altitude measurement for drones, and gesture recognition.

ModelRanging ChipMax. Measuring DistanceField of View (FoV)Infrared Wavelength
TOF050CVL618050 cm25°850 nm
TOF200CVL53L0X2 meters25°940 nm
TOF400CVL53L1X4 meters27°940 nm

Common Specifications:

  • Communication Mode: I²C digital interface, default address: 0x52
  • Operating Voltage: 3.0V to 5.0V DC
  • Typical Current Consumption: ~40mA (max)
  • Operating Temperature: -20°C to 70°C.
  • Key Features:
    • Measure absolute range independent of object color and reflectance
    • Equipped with a dedicated optical cover for dust protection and ambient light resistance
    • Feature M2 mounting holes for easy installation
    • Compatible with Arduino, STM32, ESP32, and other microcontroller platforms

If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.

Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.

2026/02/14 23:38

Pinout

Pin NameTypeDescription
VINPowerPower supply input, typically 3.0V to 5.0V
GNDPowerGround connection
SCLI²CSerial Clock line for I²C communication
SDAI²CSerial Data line for I²C communication
INTOutputInterrupt output; can signal the MCU when data is ready (often labeled GPIO1 on the chip)
SHUTInputShutdown control (Active Low); pull low to enter standby, high to enable (often labeled XSHUT)

Most TOF400C modules include an onboard voltage regulator that supports 3.3V or 5V.

Arduino Example Code

The Pololu VL53L1X library is recommended for its lightweight footprint and ease of use.

#include <Wire.h>
#include <VL53L1X.h>
 
VL53L1X sensor;
 
void setup() {
  Serial.begin(115200);
  Wire.begin();
  Wire.setClock(400000); // 400 kHz I2C for better performance
 
  sensor.setTimeout(500);
  if (!sensor.init()) {
    Serial.println("Failed to detect TOF400C sensor!");
    while (1);
  }
 
  // TOF400C supports three modes: Short (1.3m), Medium (3m), Long (4m)
  sensor.setDistanceMode(VL53L1X::Long);
 
  // Timing budget: more time = higher accuracy (min 20ms short, 33ms long)
  sensor.setMeasurementTimingBudget(50000); // 50ms
 
  // Start continuous readings every 50ms
  sensor.startContinuous(50);
}
 
void loop() {
  // Read distance in millimeters
  uint16_t distance = sensor.read();
 
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" mm");
 
  if (sensor.timeoutOccurred()) {
    Serial.print(" TIMEOUT!");
  }
}

I²C topics on lamaPLC

PageDateTags
2026/04/23 21:51, , , , , , ,
2025/09/23 21:25, , , , , ,
2026/03/22 03:14, , , , , , ,
2026/04/23 21:52, , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/03/28 23:50, , , , , , ,
2026/04/12 00:34, , , ,
2026/04/23 21:52, , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , ,
2026/03/22 00:08, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2025/05/31 23:32, , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , ,
2025/11/22 00:07, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2023/07/01 17:29, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2026/03/22 01:44, , , , , , , , ,
2026/04/23 21:52, , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , ,
2026/04/23 21:51, , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , , , , , , , ,
2026/04/11 19:54, , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/02/14 18:27, , , , , , , , , ,
2026/04/23 21:52, , , , , , ,
2026/04/23 21:52, , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/04/15 19:41, , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , ,
2026/02/14 23:47, , , ,
2026/02/14 23:51, , , , , ,
2026/02/14 18:26, , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2026/03/05 21:19, , , , , , , , , , , , , , , , ,
2026/02/14 18:27, , , , , , ,



This page has been accessed for: Today: 3, Until now: 4