• sales

    +86-0755-88291180

TOF MINI 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 20K Lux.

Disclaimer

Life Support Policy

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

Regulatory Approval

The TOF MINI 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 MINI 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

ParameterSpecification
ModelTOF MINI Range Sensor
Typical ranging range0.02 m - 4 m
Accuracy± (1% - 3%)
Field of view25° - 30°
Refresh rate30 Hz (Batch customization supported, maximum up to 90 Hz)
Ambient light immunity20K Lux
Operating temperature-20℃ - +70℃
Operating humidity35% - 80%RH
Laser safety classLASER CLASS 1 (IEC 60825-1: 2014)
Wavelength940 nm
Communication interfaceUART
Baud rate115200
Data Bits8
Stop Bits1
ParityNONE
Supply voltage4 V - 5.6 V
Power consumption100 mW - 140 mW
Average current / Peak current25 mA / 26 mA
Product weight3 g
Housing materialPC
Storage temperature-40℃ - +80℃
Product dimensions17.37 × 13.00 × 6.88 (mm)
  • The sensor's IO level is 3.3 V. If using 5 V IO levels, a level shifter is required; otherwise, the sensor may be damaged.

Pinout

PinLabelDescription
1VCC5 V power positive
2RXDUART input
3TXDUART output
4GNDPower ground

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 MINI Range Sensor 1 PCS
    • Matching cables
  • Hardware Connection

    • Connect as shown in the figure below.


  • Start Testing

    • Connect the USB TO TTL (B) to the computer's USB port.
      • Open the serial debug assistant (SSCOM), select the corresponding COM port, set baud rate to 115200, data bits to 8, stop bits to 1, and parity to NONE.
      • Open the serial port to view the distance data output by the sensor.
  • ①Send query command

  • ②Obtain real-time data



Working with Raspberry Pi

This chapter includes the following sections:

Setting Up the Development Environment

1. Installation and Configuration

  • For Raspberry Pi system installation and usage instructions, please refer to the Raspberry Pi Documentation.
  • After successful boot, configure the Raspberry Pi environment.

2. Downloading the Example

# Download the Example
wget https://files.waveshare.com/wiki/TOF-MINIF-Range-Sensor/TOF_MINIF_Range_Sensor_Demo.zip
unzip TOF_MINIF_Range_Sensor_Demo.zip
cd TOF_MINIF_Range_Sensor_Demo/

3. Enabling UART on Raspberry Pi

  • Enter the command in the Raspberry Pi terminal: sudo raspi-config nonint do_serial 2.
  • In the pop-up window, select NO for the first option and YES for the second, then select OK.

      

Example

Hardware Connection

Connect as shown in the figure below.


Running the C Example

cd ~/TOF_MINIF_Range_Sensor_Demo/Raspberry/c/
make
./main

Below is the output of the C program:


Running the Python Example

cd ~/TOF_MINIF_Range_Sensor_Demo/Raspberry/python/example
python main.py

Below is the output of the Python program:



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_MINIF_Range_Sensor_Demo/TOF_MINIF_Range_Sensor_Demo/ESP32S3/Arduino/TOF_UART_Demo and double-click the TOF_UART_Demo.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_MINIF_Range_Sensor_Demo/TOF_MINIF_Range_Sensor_Demo/ESP32S3/python and double-click the TOF_UART_Demo.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_MINIF_Range_Sensor_Demo/TOF_MINIF_Range_Sensor_Demo/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_MINIF_Range_Sensor_Demo/TOF_MINIF_Range_Sensor_Demo/pico/python and double-click TOF_UART_Demo.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_MINIF_Range_Sensor_Demo/Pico/c 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_MINIF_Range_Sensor_Demo/TOF_MINIF_Range_Sensor_Demo/Arduino/TOF_UART_Demo and double-click the TOF_UART_Demo.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: NanoKVM-Lite-Quick-Start Raspberry Pi 5 Official Original AI Kit Hailo8l 13Tops/26Tops PCIe M.2 HAT+ Board For Pi5 Jetson Orin Nano Super AI Developer Kit Built in Jetson Orin Nano 8GB Memory Core board Milk-V Duo HUB Raspberry Pi Mini TV 1.3inch LCD USB Camera DC-DC Step-Down Mini voltage Moudle Input 5~36V voltage Output 5V/3.3V 4A MPS2280D Raspberry Pi 5 PCIe to M.2 NVMe Dual SSD Adapter Board HAT Pi5 Double 2280 GPS LCD Driver Board ESP32-S3 Development Board 1.47 inch LCD 1.47B Display 1.47inch Screen SD 172×320 RGB LED ESP32-S3 MAX AI Camera 3.5inch LCD Dual MIC Development Board Display 320x480 3.5 inch TouchScreen Voice Interruption Object Recognition Raspberry Pi Pico 2 RP2350 1.28 inch Round LCD TouchScreen Development Board 240x240 Display QMI8658 6-Axis $17.9 LuckFox SC3336 Sipeed NanoCluster Mini Cluster Board mini data center For Raspberry Pi CM45 / Computer /LM3H /M4N Mini TOF Time-of-Flight Laser Ranging Radar Sensor Compatible with Arduino Raspberry Pi ESP32 and Pico RS485 Interface Raspberry Pi 8inch LCD 768x1024 Capacitive TouchScreen HDMI Display Screen Pico-DALI2 Expansion Board For ESP32 C6 S3 DALI communication control multiple LED