• sales

    +86-0755-88291180

TOF MINIS Range Sensor User Guide

Features

This laser ranging module is based on a D-TOF single-point laser sensor, with a built-in MCU and housed in a compact enclosure. It supports sunlight rejection and dirt compensation algorithms to measure target distance. With optical collimation design, it can measure distances to various targets under ambient light up to 100K Lux.

Disclaimer

Life Support Policy

The TOF MINIS Range Sensor series is not authorized for use in safety-critical applications where failure could impact personal safety (e.g., life support). In such applications, failure of the TOF MINIS Range Sensor series could cause severe personal injury or death. The Customers who use or sell the TOF MINIS Range Sensor series products in such a manner do so entirely at their risk and agree to fully indemnify Waveshare and its representatives against any damages arising out of the use of TOF MINIS Range Sensor series products in such safety-critical applications.

Regulatory Approval

The TOF MINIS Range Sensor series provided by Waveshare has obtained EU laser product certification. Before using or selling these products, verify whether these certifications apply in your region. Products incorporating the TOF MINIS Range Sensor series must obtain approval from the relevant authorities in accordance with local laser product regulations before being sold in that region.

Applications

  • Distance detection for smart devices
  • Robot obstacle avoidance
  • Drone altitude measurement
  • Liquid level detection
  • Industrial automation ranging

Working Principle

TOF is an absolute distance detection technology. The sensor emits modulated near-infrared light, which reflects off objects. The sensor calculates the time difference or phase difference between emission and reflection, converts it into target distance, and generates depth information. TOF is commonly used in people proximity detection, robot obstacle avoidance, camera autofocus, and similar scenarios.

Specifications

ParameterTOF MINIS Range Sensor
Typical ranging range0.02 m - 5 m
Field of view (FOV)1.48°
Refresh rate30 Hz (Batch customization supported, maximum up to 90 Hz)
Ambient light immunity100K Lux
Operating temperature-20°C - +70°C
Operating humidity35% - 80%RH
Laser safety classLASER CLASS 1 (IEC 60825-1: 2014)
Protection ratingIP68
Wavelength940 nm
Communication InterfaceRS485
Baud rate115200
Supply voltage4 V - 5.6 V
Power consumption100 mW - 140 mW
Average current / Peak current25 mA / 26 mA
Product weightApprox. 15.8 g
Housing materialPC
Storage temperature-40℃ - +80℃
Product dimensionsDiameter 29.5 mm, Height 18.00 mm, Cable length 60 cm

Pinout

PinIDDescription
1VCCPower positive
2GNDPower ground
3B-RS485 B
4A+RS485 A

Protocol Analysis

Click to expand

Quick Test

  • Use the test software Serial Debug Assistant together with the USB TO TTL (B) for quick viewing of serial output.

  • Test Preparation

    • Windows computer
    • USB TO TTL (B) 1 PCS
    • TOF MINIS Range Sensor 1 PCS
    • Matching cables
  • Hardware Connection

    • Connect as shown in the figure below.


  • Start testing

    • After connecting the hardware as shown above, open the corresponding software, select the appropriate port, then click OPEN and then Start Polling. Observe the data under Values to see if they match the measurement result:



Working with Raspberry Pi

Hardware Wiring

Raspberry Pi Header (UART)

  • Physical pin 8: TX (Raspberry Pi transmit)
  • Physical pin 10: RX (Raspberry Pi receive)
  • GND: → TTL-to-RS485 module GND (ground must be common)

RS485 Bus Side

  • TTL-to-RS485 module A → Device A+
  • TTL-to-RS485 module B → Device B-

If no data is read, try swapping A/B first (A/B labeling may differ between modules/devices).


1. Enable Serial Hardware (do once)

sudo raspi-config

Navigate to:

  • Interface Options → Serial Port
  • For "Login shell over serial?" select No
  • For "Enable serial hardware?" select Yes



Then reboot:

sudo reboot

2. Install Dependencies (do once)

sudo apt update
sudo apt install -y python3-pip
pip3 install pyserial

3. Copy This Folder to the New Raspberry Pi

Copy the entire pi5_minis2_rs485_example/ folder to any directory on the new Raspberry Pi (e.g., Desktop or home directory).

4. Find the Correct Serial Port Name (Critical)

The header UART device name may vary across different Raspberry Pi models or system configurations. List them:

ls -l /dev/ttyAMA* /dev/ttyS* /dev/serial*

Common order (from most common to alternatives):

  1. /dev/ttyAMA0
  2. /dev/serial0
  3. Other /dev/ttyAMA* entries

5. Run the Example (recommended to specify the port manually)

For example, if the port is /dev/ttyAMA0:

python3 pi5_minis2_rs485_example.py --port /dev/ttyAMA0

Normal output looks like:

Distance: 100 mm, Confidence: 100


Shortest Troubleshooting Order When No Data Is Read

  1. Try a different port: --port /dev/ttyAMA0 ↔ --port /dev/serial0 ↔ other ttyAMA*
  2. Swap RS485 A/B
  3. Verify TX/RX are not reversed: 8 -> DI10 -> RO
  4. Verify power and common ground are correct (power the device according to its manual)


Working with ESP32-S3

This chapter includes the following sections:

Setting Up the Development Environment

1. Installation and Configuration

Example

Hardware Connection

Connect as shown in the figure below.


Running the Arduino ESP32 Example

  • Navigate to TOF-MINIS-Range-Sensor/example/ESP32/esp32s3-arduino_example and double-click the esp32s3-arduino_example.ino file.

  • Select the development board:


  • Select the ESP32-S3 port, then compile and upload.

  • After upload is complete, open the Serial Monitor to view the output.

Running the MicroPython Example

  • Navigate to TOF-MINIS-Range-Sensor/example/ESP32/esp32s3-python_example and double-click the esp32s3-python_example.py file.

  • Set the chip model to ESP32 and select the corresponding port:

  • Select the ESP32-S3 port, then run the example.

  • The shell will display the relevant output.



Working with Raspberry Pi Pico

This chapter includes the following sections:

Setting Up the Development Environment

1. Installation and Configuration

  • For Raspberry Pi Pico environment setup and basic usage, please refer to the following links:
  • After setting up the environment, connect the sensor and download the example package.

Example

Hardware Connection

Connect as shown in the figure below.


Running the Arduino Pico Example

  • Navigate to TOF-MINIS-Range-Sensor/example/pico/Arduino/TOF_UART_Demo and double-click TOF_UART_Demo.ino to open the project.

  • Select the chip model and port.


  • After upload is complete, open the Serial Monitor to view the output.

Running the MicroPython Example

  • First flash the MicroPython firmware to the Raspberry Pi Pico.

  • Navigate to TOF-MINIS-Range-Sensor/example/pico/pico-pico_micropython_example and double-click main.py to open the project in Thonny.

  • Select the development board.

  • Select the Raspberry Pi Pico port, then run the example.

  • The shell will display the relevant output.


Running the C Example

  • Navigate to TOF-MINIS-Range-Sensor/example/pico/pico_sdk_example and open this folder in VS Code.

  • Import this project in the Pico tools.


  • After import succeeds, click "Compile" to build. After compilation, put the Pico into BOOT mode and copy the UF2 firmware to the RP2040 disk.

  • Open a serial debug tool to view the output.



Working with Arduino

This chapter includes the following sections:

Setting Up the Development Environment

1. Installation and Configuration

  • For setting up the Arduino environment and basic usage, please refer to this R4 link; R3 comes pre-installed by default.
  • After setting up the environment, connect the sensor and download the example package.

2. Hardware Configuration

  • The IO level of the Arduino board must be 3.3 V. If using 5 V IO levels, a level shifter is required; otherwise, the sensor may be damaged.
  • When using Waveshare R3/R4, set the following jumpers to 3.3 V.
ImageDescription


Arduino UNO R3


Arduino UNO R4


Arduino UNO R4 WIFI

Example

Hardware Connection

Connect as shown in the figure below.

ImageDescription

Arduino UNO R3

Arduino UNO R4

Running the Example

  • Navigate to TOF-MINIS-Range-Sensor/example/Arduino/uno_r3_arduino_example and double-click the uno_r3_arduino_example.ino file.

  • Select the development board:

    ImageDescription


    Arduino UNO R3


    Arduino UNO R4
  • Select the board port, then compile and upload.

  • After upload is complete, open the Serial Monitor to view the output.



Example Showcase

Real-time distance data is output by default. To use other examples, set the corresponding example value to 1.

Arduino


MicroPython


Raspberry Pi



Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Email: services01@spotpear.com


TAG: Raspberry Pi 12.3 inch LCD HDMI /Type C Display In-Cell Capacitive TouchScreen 1920x720 For Jetson Nano/mini Computer PC ESP32-S3 ST7789 Raspberry Pi 10.1 inch DSI MIPI LCD TouchScreen Display 10.1inch 720x1280 For Luckfox Lyra RK3506/ESP32-P4/Luckfox Omni3576 DPI Interface Raspberry Pi Monitor Official Original DisplayScreen 15.6 inch LCD Full HD 1920x1080 15.6inch Camera EchoEar ESP32 S3 AI Development Board with 1.85-inch LCD Display Cute Cat Pet Chatting Robot N32R16 USB to SPI ESP32 Development Board WiFi+Bluetooth Ultra Low Power Dual Core ESP 32S ESP 32 Similar ESP8266 Raspberry Pi 5 PD Trigger Jetson Nano NVIDIA-acess User Guide Raspberry Pi Camera Case 1.85inch LCD TouchScreen Display 360×360 ST77916 For Arduino /Raspberry Pi /ESP32 /Pico /STM32 Program ESP32 ST7789 configuration Pi5 Power Luckfox Pico SPI 5inch Raspberry Pi 7.5 inch e-Paper link (H) RYBW 800x480 For Arduino / Jetson Nano / STM32