Core Product Comparison
Waveshare offers several versions to match different distances and environmental requirements:
| Model | Range | Accuracy | Interface | Best For |
|---|---|---|---|---|
| Standard TOF | 0.01 – 5m | ±1.5cm | UART / CAN | Indoor robots, obstacle avoidance |
| TOF (B) | 0.10 – 15m | ±2% | UART / I2C Long-range indoor/outdoor use | |
| TOF (C) | 0.05 – 25m | ±3cm | UART / I2C | Outdoor navigation, material levels |
| TOF (D) | 0.05 – 50m | ±3cm | UART / I2C | Extreme long-distance detection |
| TOF Mini | 0.02 – 7.8m | ±4cm | UART / I2C | Ultra-compact builds (1g weight) |
Key Technical Features
| Specification | Data |
|---|---|
| Typical measuring range | 0.05..25 m / 0.05..50 m |
| Measuring accuracy | +-3 cm |
| Wavelength | 905 nm |
| Field of view | 1°..2° |
| Communication interface | default: UART (3.3V TTL) I²C Addr: 0x08 |
| Baudrate | UART: 4.8 kbps .. 3000 kbps (921.6 kbps default) I²C: up to 400 kbps |
| Power supply | 4.3 .. 5.2 V |
| Power consumption | 250 mW (UART active output, 5.0 V power supply, 50 mA current) |
| Operation temperature | -10 °C .. 60 °C |
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.
The sensor operates at 3.3V TTL signal levels, but the module has voltage translation for 5V compatibility.
| Waveshare Pin | Arduino Uno/Nano Pin | Description |
|---|---|---|
| VCC | 5V (or 3.3V) | Power Supply |
| GND | GND | Ground |
| TX | D10 | Arduino RX (SoftwareSerial pin) |
| RX | D11 | Arduino TX (SoftwareSerial pin) |
This example utilizes the SoftwareSerial library to actively read distance data from the sensor, which outputs at the default baud rate of 115200.
#include <SoftwareSerial.h> SoftwareSerial TOFSerial(10, 11); // RX, TX pins for the sensor unsigned char TOF_data[32] = {0}; // Buffer to store the data frame unsigned char TOF_length = 16; unsigned long TOF_distance = 0; unsigned char TOF_check = 0; void setup() { Serial.begin(9600); // Initialize hardware serial for monitoring TOFSerial.begin(115200); // Initialize software serial for the sensor Serial.println("Waveshare TOF Sensor Test"); } void loop() { if (TOFSerial.available() > 0) { // Read the incoming bytes from the sensor if (readTOFData()) { Serial.print("Distance: "); Serial.print(TOF_distance); Serial.println(" mm"); } } } // Function to read and parse the data frame based on Waveshare protocol bool readTOFData() { if (TOFSerial.available() >= TOF_length) { for (int i = 0; i < TOF_length; i++) { TOF_data[i] = TOFSerial.read(); } // Verify the checksum TOF_check = 0; for (int k = 0; k < TOF_length - 1; k++) { TOF_check += TOF_data[k]; } if (TOF_check == TOF_data[TOF_length - 1] && TOF_data[0] == 0x57) { // Check header 0x57 // Data is valid. Distance is a 3-byte value (little-endian) TOF_distance = (TOF_data[8]) | (TOF_data[9] << 8) | (TOF_data[10] << 16); return true; } } return false; }
This page has been accessed for: Today: 1, Until now: 62