====== LamaPLC: VL53Lnn STMicroelectronics time-of-flight (ToF) laser-ranging sensors with I²C communication ====== {{ :sensor:vl53l0x.png?150|VL53L0X}} The STMicroelectronics VL53L1X is the successor to the STMicroelectronics VL53L0X, offering significant enhancements in range, speed, and functionality, while maintaining pin-to-pin compatibility. The most notable difference is the maximum distance measurement: the VL53L1X supports up to 4 meters, compared with 2 meters for its predecessor. **Feature Comparison:** \\ ^Feature^STMicroelectronics VL53L0X^STMicroelectronics VL53L1X| ^Max Range (Optimal)|Up to 2 meters|Up to 4 meters| ^Max Ranging Frequency|Typically around 20 Hz (50 ms per measurement)|Up to 50 Hz| ^Field of View (FoV)|25° fixed|27° typical full FoV, but programmable (15° to 27°)| ^Multi-zone Capability|No|Yes, via programmable Region of Interest (ROI)| ^Ambient Light Immunity|Good (uses 940nm VCSEL and physical IR filters)|Improved (better performance in high ambient light)| ^Pin-to-Pin Compatibility|N/A|Pin-to-pin compatible with the VL53L0X sensor| ^Responsive time|50ms|50ms| ^Package Size|4.4 x 2.4 x 1.0 mm|4.9 x 2.5 x 1.56 mm (slightly larger)| ^Interface|I²C, default addr.: 0x29|I²C, default addr.: 0x29| In summary, while the VL53L0X is a cost-effective choice for short-range applications, the VL53L1X offers enhanced performance and versatility for more demanding tasks, such as drone navigation, industrial automation, and gesture recognition, that require longer range and spatial awareness. {{page>:tarhal}} ==== Arduino & VL53L1X ==== * **VIN:** Power input (**2.8V - 5V**) * **GND:** Ground * **SCL:** I²C clock line * **SDA:** I²C data line * **XSHUT:** Shutdown pin, low-level shutdown, high-level normal operation * **GPIO1:** Programmable interrupt output The VL53L1X typically operates at 3.3V. Ensure your module includes a voltage regulator and level shifters when connecting to a 5V board, such as an Arduino Uno. ==== Arduino code ==== To interface the VL53L1X Time-of-Flight (ToF) sensor with an Arduino, the **Pololu VL53L1X** library is widely recommended for its simplicity and small memory footprint. #include #include VL53L1X sensor; void setup() { Serial.begin(115200); Wire.begin(); Wire.setClock(400000); // Use 400 kHz I2C for faster readings sensor.setTimeout(500); if (!sensor.init()) { Serial.println("Failed to detect and initialize sensor!"); while (1); } // Set distance mode: Long (up to 4m) or Short (up to 1.3m) sensor.setDistanceMode(VL53L1X::Long); // Timing budget is the time spent taking one measurement (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 (mm): "); Serial.println(distance); if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); } } ===== I²C topics on lamaPLC ===== {{topic>i2c}} \\ \\ {{tag>VL53L0X VL53L1X VL53L0/1XV2 GY-530 time-of-flight ToF laser-ranging i2c communication sensor arduino code}} This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}