VL53L0X Laser Ranging Sensor Module – UART Communication, Configurable Switch Output, GY-56 (ToF Distance Measurement)

SKU: FA3021-13
Sensor IC

STMicroelectronics VL53L0X

Measurement Range

3cm – 200cm (up to 2m)

Laser Wavelength

940nm (invisible infrared)

Communication Interface

UART (9600 baud, TTL)

Switch Output

Digital, threshold-configurable

Operating Voltage

3.3V – 5V DC (onboard regulator)

Laser Class

Class 1 (eye-safe)

Pin Count

4 pins (VCC, GND, TX, RX) + switch output

The VL53L0X Laser Ranging Sensor Module (GY-56) is a compact, high-precision Time-of-Flight (ToF) distance measurement module that features UART communication and configurable switch output, making it one of the most versatile VL53L0X variants available. Built around the STMicroelectronics VL53L0X sensor IC, it uses 940nm infrared laser technology to measure absolute distances from 3cm to 200cm with millimeter-level accuracy. The GY-56 module is designed for applications requiring simple serial communication and independent threshold-based switching without the need for complex I²C programming.

At the heart of the module is the VL53L0X, a fully integrated ToF sensor that emits invisible 940nm infrared laser pulses and measures the time required for the light to reflect back from a target object. This Time-of-Flight principle enables the sensor to measure absolute distance regardless of the target‘s color, surface texture, or reflectivity. Unlike ultrasonic sensors that are affected by soft or angled surfaces, the VL53L0X delivers consistent, reliable readings across a wide range of targets.

The GY-56 version distinguishes itself from standard VL53L0X modules through two key features:

  • UART Communication — Instead of I²C, the module communicates via a TTL serial UART interface at 9600 baud. It continuously outputs distance data as ASCII text (e.g., “1234mm”), making it easy to read with any microcontroller or USB-to-serial adapter without complex library installation. This is ideal for beginners and for integration into systems that lack I²C capability.

  • Configurable Switch Output — The module includes a digital switch output that activates when the measured distance crosses a user-configurable threshold. The threshold is set via the onboard potentiometer or through UART commands, allowing the module to function as a standalone proximity switch without any microcontroller. This makes it perfect for automatic door controls, robotic obstacle detection, and presence-sensing applications.

The module operates from 3.3V to 5V DC and includes an onboard voltage regulator and level shifter, ensuring compatibility with both 3.3V (ESP32, Raspberry Pi) and 5V (Arduino Uno) microcontrollers. The compact form factor with mounting holes allows easy integration into robot chassis, sensor arrays, and custom enclosures. The laser class is Class 1, meaning it is completely eye-safe under normal use.

The VL53L0X GY-56 is widely used in obstacle avoidance robots, automatic door systems, presence detection, liquid level sensing, industrial automation, security systems, and educational STEM projects. It is also popular in IoT devices and embedded systems where simple serial distance output or threshold-based switching is required.

Important Note: The VL53L0X uses laser light for measurement, which can pass through transparent objects (glass, clear plastic) without reflecting, so it may not detect them reliably. The maximum range of 200cm is achievable in low-ambient-light conditions; bright sunlight can reduce the effective range. The module is not waterproof and should be kept dry. The UART output format and switch threshold configuration may vary by firmware version — refer to the module documentation for specific command details.

Whether you are building an obstacle-avoidance robot, an automatic door controller, or a simple proximity switch, the VL53L0X GY-56 Laser Ranging Sensor Module provides a reliable, easy-to-use solution with UART output and configurable switching. It is suitable for individual makers, students, and businesses purchasing in bulk for product development or educational programs.

Features

  • VL53L0X Time-of-Flight sensor — Accurate distance measurement from 3cm to 200cm

  • UART communication — 9600 baud TTL serial output, ASCII distance format

  • Configurable switch output — Threshold-based digital output for standalone switching

  • 940nm infrared laser — Invisible, eye-safe Class 1 laser operation

  • Millimeter precision — Independent of target color and reflectivity

  • 3.3V/5V compatible — Onboard voltage regulator and level shifter

  • Compact form factor — With mounting holes for easy integration

  • Simple interface — UART TX/RX plus switch output for easy integration

  • Wide application range — Obstacle avoidance, automatic doors, presence detection

  • GY-56 version — UART and switch output in one module

Technical Specifications 

# Parameter Specification
1 Sensor IC STMicroelectronics VL53L0X
2 Measurement Range 3cm – 200cm (up to 2m)
3 Laser Wavelength 940nm (invisible infrared)
4 Communication Interface UART (9600 baud, TTL)
5 Switch Output Digital, threshold-configurable
6 Operating Voltage 3.3V – 5V DC (onboard regulator)
7 Laser Class Class 1 (eye-safe)
8 Pin Count 4 pins (VCC, GND, TX, RX) + switch output

Usage

Getting Started

  1. Connect power — Supply 3.3V or 5V DC to the VCC pin and GND to ground. The module includes an onboard regulator for 5V compatibility.

  2. Connect UART lines — Connect the module‘s TX pin to your microcontroller’s RX pin and the module‘s RX pin to your microcontroller’s TX pin. Configure your serial port to 9600 baud, 8-N-1.

  3. Read distance data — The module continuously outputs distance data in ASCII format (e.g., “1234mm”). Use Serial.readString() or similar functions to read the data.

  4. Configure switch output (optional) — Adjust the onboard potentiometer to set the distance threshold for the switch output. When the measured distance crosses the threshold, the switch output changes state.

  5. Implement control logic — Use the UART distance data or the switch output for your application.

Pin Connections

Module Pin Function
VCC Power (3.3V–5V)
GND Ground
TX UART Transmit (to MCU RX)
RX UART Receive (from MCU TX)
OUT Switch output (threshold-based)

UART Output Format (Typical)

Data Example
Distance “1234mm”
Update Rate Continuous (varies by firmware)

Example Arduino Code

cpp
#include <SoftwareSerial.h>

SoftwareSerial sensorSerial(10, 11);  // RX, TX

void setup() {
  Serial.begin(9600);
  sensorSerial.begin(9600);
}

void loop() {
  if (sensorSerial.available()) {
    String data = sensorSerial.readStringUntil('\n');
    Serial.print("Distance: ");
    Serial.println(data);
  }
  delay(100);
}

Typical Applications

  • Obstacle avoidance robots — Detect objects in the robot‘s path

  • Automatic doors — Detect approaching people with switch output

  • Presence detection — Monitor room occupancy

  • Liquid level sensing — Measure liquid surface without contact

  • Industrial automation — Proximity detection on production lines

  • Security systems — Intrusion detection with threshold switching

  • Educational STEM projects — Teaching ToF sensing and UART communication

Notes for Business Buyers

  • UART simplicity — No I²C programming required; simple serial output.

  • Standalone switch output — Configurable threshold for independent operation.

  • Class 1 laser — Eye-safe, no special safety precautions required.

  • Suitable for bulk purchasing — Ideal for robotics manufacturers, industrial automation integrators, and educational institutions.

Q: What is the VL53L0X GY-56 Laser Ranging Sensor used for?

It is a high-precision Time-of-Flight distance sensor with UART output and configurable switch output, used for obstacle avoidance, automatic doors, presence detection, and industrial automation.

Q: What is the difference between the GY-56 and standard VL53L0X modules?

The GY-56 features UART communication (instead of I²C) and a configurable switch output. Standard VL53L0X modules typically use I²C only and lack the standalone switch output.

Q: What is the measurement range and accuracy?

The module measures from 3cm to 200cm with millimeter-level precision and ±3% typical accuracy.

Q: How do I read the distance data?

Connect the module‘s TX and RX to your microcontroller’s RX and TX, configure the serial port to 9600 baud, and read the ASCII distance data (e.g., “1234mm”).

Q: What is the switch output used for?

The switch output activates when the measured distance crosses a user-configurable threshold. It can be used for standalone proximity switching without a microcontroller.

Q: How do I adjust the switch threshold?

Use the onboard potentiometer to set the distance threshold. Alternatively, some firmware versions allow threshold configuration via UART commands.

Q: Is the laser safe for the eyes?

Yes. The module uses a Class 1 laser at 940nm, which is eye-safe under normal use. No special safety precautions are required.

Q: What voltage does the module require?

It operates from 3.3V or 5V DC thanks to its onboard voltage regulator and level shifter.

Q: Can the sensor detect transparent objects?

Not reliably. The laser light can pass through glass and clear plastic without reflecting, so the sensor may not detect them. Test with your specific target.

Q: Can I purchase in bulk for a product development project?

Yes. This module is suitable for both individual users and business purchasing, including robotics manufacturers, industrial automation integrators, and educational institutions.