TOF Laser Range Sensor (D)

From Waveshare Wiki
Jump to: navigation, search
TOF Laser Range Sensor (D)
TOF-Laser-Range-Sensor-D-1.jpg

Laser Sensor
I/O / I2C / UART
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

Introduction

TOF Laser Range Sensor series are TOF-based (time of flight) laser ranging sensors with an embedded MCU and ranging algorithm, which is capable of offering up to 25m measuring range and an accuracy of ±3cm. It supports UART, I2C and I/O complementary level output communication, with an ultra small FOV angle, making it more resistant to light interference over longer distances. It is suitable for both indoor and outdoor environments, with a maximum resistance to ambient light of about 100K LUX illumination. It can be used as a distance measurement tool for distance detection, as well as for robot obstacle avoidance/route planning. It can also be used in fields such as drone height determination/ceiling detection and material level measurement.

Disclaimer

Life Support Policy
TOF Laser Range Sensor series are not authorized for use in safety-critical applications (such as life support), where a failure of the TOF Laser Range Sensor series products may cause severe personal injury or death. The Customers who use or sell the TOF Laser 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 Laser Range Sensor series products in such safety-critical applications.
Management Approval
The TOF Laser Range Sensor series supplied by Waveshare has been certified by the European Union for laser products, and it is the user's responsibility to confirm whether these certifications are applicable depending on the region in which they are used or sold. All products developed by users that include the TOF Laser Range Sensor series sensors must be approved by the relevant regulatory authorities responsible for managing laser products in any given jurisdiction before being sold or marketed within that jurisdiction, and users should be responsible for obtaining approval from the relevant regulatory authorities as needed.

Application Scenario

  • Drone altitude and ceiling height determination
  • Robot obstacle avoidance
  • Measurement and detection
  • Intelligent gesture control
  • Material Level Measurement

Operating Principle

TOF is an absolute distance detection technology, which means that the sensor emits near-infrared light that has been debugged and reflects it when it encounters an object. The sensor calculates the time difference or phase difference between the light emission and reflection, converts it into the distance of the captured object, and generates depth information. Compared to binocular and 3D structured light schemes, TOF has the advantages of longer working distance, wider applicability in various scenarios, and higher accuracy at longer distances. Therefore, it is often applied in situations such as personnel proximity detection, robot obstacle avoidance, and camera autofocus.

TOF Laser Range Sensor C 35.png

Parameters

Product TOF Laser Range Sensor TOF Laser Range Sensor (C) TOF Laser Range Sensor (D)

Typical range of distance measurement

Short distance: 0.012 ~ 2.16m 0.05 ~ 25.0m 0.05 ~ 50.0m
Medium distance: 0.012 ~ 3.60m
Long distance: 0.01 ~ 5.00m
Typical ranging accuracy Short distance: Accuracy ±1.0cm, Standard deviation <0.3cm ±3cm standard deviation <1.0cm @0.05~10m,<6.0cm @10~25m ±3cm standard deviation <1.0cm @0.05~10m,<6.0cm @10~50m
Medium distance: Accuracy ±1.0cm, Standard deviation <1.5cm
Long distance: Accuracy ±1.5cm, Standard deviation <[email protected]~3m,
Standard deviation <8cm@3~5m
Supply voltage 4.3 ~ 5.2V (Anti reverse connection protection)
Operation temperature -20°C ~ 65°C -10℃~60℃
Wavelength 940nm (Compliant with Class1 standard) 905nm (Wavelength under review)
Field of View (FOV) 15° ~ 27° (Multi-position adjustable) 1° ~ 2°
Communication interface UART (TTL signal cable electrical level 3.3V)
CAN (Two interfaces can simultaneously serve as CAN interfaces) I2C (Support parallel connection of multiple devices, with slave address 0x08+module ID)
I/O (Output complementary electrical level)
Baud rate UART:115.2Kbps ~ 3000Kbps (默认 921.6Kbps)
UART: 115.2Kbps ~ 3000Kbps (Default is 921.6Kbps) I2C: Up to 400Kbps
Cascade quantity UART interface supports up to 8 cascades, CAN interface supports up to 7 cascades Up to 8 can be connected in parallel through I2C
Anti environmental light Weak, about 10K LUX, only supports indoor use Approximately 100K LUX illumination (suitable for both indoor and outdoor use)
Product power consumption 290mW (UART active output, long-distance mode power supply voltage 5.0V, current 58mA) 250mW (UART active output, power supply voltage 5.0V, current 50mA)
Product weight 2.7g 7.5g
Length, Width and Height 35.58mm × 12mm × 8.05mm 22.7mm × 28mm × 13.6mm

Function

ID

  • ID is a variable set to distinguish different sensors, and it is used to identify each sensor during cascade connection.

Interface & Baud rate

The TOF Laser Range Sensor (C) supports configuration in UART, IIC, and I/O communication modes:

UART Serial Port

The UART serial port communication baud rate settings are as follows:

UART Serial Port Baud Rate Description
115200,230400,460800,921600,1000000,1200000,2000000,3000000 The default baud rate is 921600

The UART interface mode supports "Active Output" and "Query Output", and the two output modes can be switched by modifying the data output mode on the Waveshare TOFAssistant software. Connect the TOF Laser Range Sensor series to the Waveshare TOFAssistant software via USB to TTL Module (cable sequence and supply voltage reference data sheet), and click TOF Laser Range Sensor C 1.png to enter the settings page. After configuring the parameters, you need to click the Write Parameter button to save the parameters, and after the parameters are successfully written, you can read the parameters once to confirm whether the parameters are written successfully. Host device download:

  • Active Output:
    • The UART active output mode can be used in a single module. The data output mode is set to ACTIVE. In this mode, the module actively outputs measurement information at a frequency of 50Hz (up to 100Hz). The output format follows the NLink_TOFSense_Frame0 protocol.
    • UART active output mode configuration diagram 1
UART active output mode configuration diagram 1
  • Query Output:
    • The UART query output mode can be used in a single module. The data output mode is set to INQUIRE. After writing parameters, the data will no longer be actively reported. In this mode, the controller sends an inquire command containing the module ID to the desired inquire module, and the module can output a frame of measurement information. The inquire frame format follows the protocol NLink_TOFSense_Read_Frame0, and the output frame format follows the protocol NLink_TOFSense_Frame0.
    • UART query output mode configuration diagram 2
UART query output mode configuration diagram 2

I2C integrated circuit bus

  • In I2C output mode, the baud rate setting range is shown in the table
I2C baud rate Description
Up to 400KHz Up to 400KHz, determined by the host
  • I2C Address
I2C address Description
0x08~0x77 The default address is 0x08 (7-bit address), and the slave address is 0x08+module ID. The slave address can be changed by changing the ID parameter of the module. When communicating, pay attention to shifting and adding read and write bits, that is, when the address is 0x08, the bytes sent with read and write bits are 0x10 (write), 0x11 (read)

In I2C communication mode, the controller can send a read frame to the expected inquire module at the specified slave address according to the I2C communication timing to obtain relevant information such as module distance. In addition, the output mode and other parameters of the module can also be changed through I2C communication. The format for reading and writing frames follows the protocol NLink_TOFSense-IIC_Frame0. When the module is in UART mode (note that Waveshare TOFAssistant cannot recognize modules in I2C mode), connect the TOF series product to the Wavshare TOFAssistant software through a USB TO TTL module (cable sequence and power supply voltage reference data manual). After successful recognition, click [File: TOF_Laser-Range_Sensor_C_1. png | 25px]] to enter the settings page. The I2C output mode configuration is shown in the following figure. You can change the module's I2C slave address by setting the module's ID (the 7-bit slave address is 0x08+module ID, and the ID setting range is 0~111). After configuring the parameters, you need to click the Write Parameter button to save the parameters. Note: After switching to I2C mode, you can refer to the FAQ section to change back to UART mode.

I2C output mode configuration diagram 3

I/O Output

  • In I/O output mode, it can only be used in a single module and cannot output distance measurement values. It only reverses the I/O port level when the distance increases from small to large and exceeds the high threshold or decreases from large to small and below the low threshold.

When the module is in UART mode (note that Waveshare TOFAssistant cannot recognize the module in I/O mode), connect the TOF series product to the Waveshare TOFAssistant software through the USB TO TTL module (cable sequence and power supply voltage reference data sheet). After successful identification, click TOF Laser Range Sensor C 1.png to enter the setting page. First set the hysteresis starting point Band Start and hysteresis width Band Width to determine the hysteresis interval. The I/O output mode configuration is shown in Figure 4. The distance value is converted into high and low level output through hysteresis comparison. I/O_L and I/O_H output complementary levels, and the hysteresis comparison diagram is shown in Figure 5. After configuring the parameters, you need to click the Write Parameter button to save the parameters. Note: After switching to I/O mode, you can refer to the FAQ chapter to change back to UART mode.

For example, Band Start and Band Width are both set to 500, which corresponds to 0.5m. When the distance value is 0.3m, I/O_H is high and I/O_L is low. The distance value becomes 0.8m, I/O_H is high and I/O_L is low. When the distance value exceeds 1m, the level reverses, I/O_H is low and I/O_L is high. When the distance value drops from more than 1m to 0.8m, I/O_H is low and I/O_L is high. When the distance value drops below 0.5m, the level is reversed, I/O_H is high and I/O_L is Low.

I/O output mode configuration diagram 4

The value range of Band Start and Band Width of TOF (C) is [0~25000], unit: mm.

Hysteresis comparison diagram 5

Distance Status

The module can output the current distance status, and the user can perform data processing based on the distance status. The meaning of the distance status is as follows:

Value Description
0 Invalid measurement distance
1 Valid measurement distance

Signal Strength

  • It indicates the strength of the current return signal, with a higher value indicating a stronger return signal. When the distance from the object being measured is the same, different reflectivity on the surface of the object will cause changes in signal strength. The higher the reflectivity, the greater the signal strength, and vice versa.

Range Precision

  • It indicates the current ranging accuracy. The smaller the value, the better the ranging accuracy.

FOV

  • The size of the FOV (field of view) determines the field of view range of the TOF. The field of view angle of the TOF (C) module is 1~2°.

Mode Switch

  • If the module is in UART mode, you can connect Waveshare TOFAssistant software to switch to IIC or I/O mode. If the module is in IIC mode, you need to send instructions to the module through IIC communication to switch back to UART mode. In addition, when there is no IIC test environment or after switching to I/O mode, you can refer to the FAQ section of the user manual to switch back to UART mode.

Protocol Parsing

UART communication process

  • The default configuration of the serial port is: 8-bit data bit, 1-bit stop bit, no parity check, no flow control, and the default baud rate is 921600.
  • Each data frame containing distance under the UART interface consists of a hexadecimal number of 16 bytes.
  • The protocol consists of Frame Header, Function Mark, Data, and Sum Check.
    • Frame Header and Function Mark are fixed values. For details, please refer to the following table;
    • Data refers to the transmitted data content, including module ID, system time, measurement value dis, distance status dis_status, signal strength signal_strength, and ranging accuracy range_precision. The query protocol frame only contains the ID of the queried module;
    • Sum Check is the lowest byte after the sum of the Frame Header, Function Mark, and Data (i.e., the sum of all the previous bytes).
  • The protocol contains the following parts:
Frame Header + Function Mark + Data + Sum Check

Note: The protocol package follows the little-endian principle, that is, the low byte comes first, and the high byte comes last.

  • Overview of protocol
Protocol Type Overview
NLINK_TOFSENSE_FRAME0 Fixed-length UART output protocol, including node timestamp, distance, distance status, signal strength
NLINK_TOFSENSE_READ _FRAME0 Fixed length UART read protocol, including node ID
NLINK_TOFSENSE_IIC_FRAME0 Variable length IIC communication protocol, including distance, distance status, signal strength, etc.

NLink_TOFSense_Frame0

  • Data source: Connect the module to the host device, configure UART as active output mode, NLink_TOFSense_Frame0 protocol, and refer to the FAQ for distance data analysis
  • Raw data:
57 00 ff 00 9e 8f 00 00 ad 08 00 00 03 00 06 41
  • Parsing table:
Data Type Length (Bytes) Hex Result
Frame Header uint8 1 57 0x57
Function Mark uint8 1 00 0x00
reserved uint8 1 ff *
id uint8 1 00 0
System_time uint32 4 9e 8f 00 00 36766ms
dis*1000 uint24 3 ad 08 00 2.221m
dis_status uint8 1 00 0
signal_strength uint16 2 03 00 3
range_precision uint8 1 06 6cm
Sum Check uint8 1 41 0x41

NLink_TOFSense_Read_Frame0

  • Data source: Connect the module to the host device, configure it as the UART query output mode, with the id as 0, and send the following data through the host device to achieve data query. If you need to inquire modules with other IDs, just change the id and checksum bytes and send them.
  • Raw data:
57 10 FF FF 00 FF FF 63
  • Example: Inquire the module with ID=3, the command is: 57 10 FF FF 00 FF 63
  • Parsing table:
Data Type Length (Bytes) Hex Result
Frame Header uint8 1 57 0x57
Function Mark uint8 1 10 0x10
reserved uint8 2 FF FF *
id uint8 1 00 0
reserved uint8 2 FF FF *
Sum Check uint8 1 63 0x63
  • reserved: Reserved bit, placeholder, meaningless, but must be added
  • Use the host device to inquire, the operation is as follows:
TOF Laser Range Sensor C 6.png
  • 1. Confirm the port number and baud rate, and click Connect
  • 2. After successful connection, click Configure
  • 3. Select INQUIRE
  • 4. Write configuration
  • 5. Enter the inquire command. The ID here is 0, so it is 57 10 FF FF 00 FF FF 63
  • 6. Send inquire command
  • 7. Display the currently tested data

NLink_TOFSense_IIC_Frame0

  • Slave address: The module acts as a slave in the IIC bus. The default address is 0x08 (7-bit address), and the slave address is 0x08+module ID. The slave address can be changed by changing the ID parameter of the module. When communicating, pay attention to address shifting and adding read and write bits, that is, when the address is 0x08, the bytes sent with read and write bits are 0x10 (write) and 0x11 (read).
  • Register address: If there is no corresponding parameter in the register, the default output is 0xff
AD 08 00 00 03 00 FF FF
  • Parsing table:
NLink_TOFSense_IIC_Frame0 register parsing and communication flow chart

IIC Communication flowchart

NLink TOFSense IIC comunication4.png

NLink_TOFSense_Setting_Frame0

  • Data source: Set instructions.
  • Parsing table:

TOFSense-B-Setting-Frame.png

Software Description

TOF Assistant is a debugging software that comes with the TOF laser ranging module. Its main functions include configuration debugging, status display, functional application, and firmware upgrade:

  • Configure debugging: Used to configure node related parameters such as ID, working mode, baud rate, etc.
  • Functional application: Used for application development, such as data import and export, motion trajectory storage, historical trajectory playback, etc.
  • Firmware upgrade: Used to perform wired firmware upgrades for products.

Dimension

  • TOF-Laser-Range-Sensor-B-details-size.jpg

Raspberry Pi Usage

  • For information on the installation and use of the Raspberry Pi system, please refer to this link.
  • After successful startup, configure the Raspberry Pi environment

Download demo

wget https://files.waveshare.com/wiki/TOF-Laser-Range-Sensor-(C)/TOF_Laser_Range_Sensor_demo.zip
unzip TOF_Laser_Range_Sensor_demo.zip
cd TOF_Laser_Range_Sensor_demo/

UART example

Start Raspberry Pi UART

  • Enter the command on the Raspberry Pi terminal: sudo raspi-config nonint do_serial 2
  • Select NO in the first pop-up window, YES in the second one, and OK for the final one.

Configure UART on the host device

  • By default, it does not require configuration and can be used directly. If it was previously configured to I2C or I/O mode, you need to refer to the FAQ method to restore the sensor.
  • Refer to the following video for restoring:

[Video for Restoring]

Hardware connection

  • Refer to the following diagram for connection:

TOF-Laser-Range-Sensor-B-details-13.jpg

Run C demo

cd ~/TOF_Laser_Range_Sensor_demo/Raspberry/c/UART/
make
./main
  • The terminal will output relevant information, as shown below:

TOF Laser Range Sensor C 12.png

Run Python demo

cd ~/TOF_Laser_Range_Sensor_demo/Raspberry/python/UART/example
python main.py 
  • The terminal will output relevant information, as shown below:

TOF Laser Range Sensor C 13.png

I2C example

Start Raspberry Pi I2C

  • Enter the command on the Raspberry Pi terminal: sudo raspi-config nonint do_i2c 0

Configure I2C on the host device

  • For details on how to configure I2C mode, please refer to I2C integrated circuit bus section in the Function part

Hardware connection

To access the Raspberry Pi I2C, refer to the following: TOF-Laser-Range-Sensor-B-details-9.jpg

Run C demo

cd ~/TOF_Laser_Range_Sensor_demo/Raspberry/c/I2C/
make
./main
  • The terminal will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 15.png

Running Python demo

cd ~/TOF_Laser_Range_Sensor_demo/Raspberry/python/I2C/example
python main.py 
  • The terminal will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 14.png

I/O example

Configure I/O using the host device

  • For details on how to configure the I/O mode, please refer to I/O output section in the Function part

Hardware connection

To access the Raspberry Pi I/O, refer to the following: TOF Laser Range Sensor C 18.jpg

Install C library

sudo apt-get update
sudo apt install gpiod libgpiod-dev

Run C demo

cd ~/TOF_Laser_Range_Sensor_demo/Raspberry/c/IO/
make
./main
  • The terminal will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 16.png

Run Python demo

cd ~/TOF_Laser_Range_Sensor_demo/Raspberry/python/IO/
python TOF_IO_Demo.py 
  • The terminal will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 17.png

ESP32S3 Usage

  • For the environment setup and basic usage of ESP32S3, please refer to this link.
  • After the environment is set up, the sensor can be connected, Download demo.

Hardware connection

  • Refer to the following diagram for connection:

TOF Laser Range Sensor C 21.png

Arduino esp32 example

UART

  • Configure UART on the host device, which does not require configuration by default and can be used directly. If it was previously configured to I2C or I/O mode, refer to the FAQ method to restore the sensor.
  • Refer to the following video for restoring:

Video for Restoring

  • Go to TOF_Laser_Range_Sensor_demo\ESP32S3\UART\Arduino\TOF_URAT_Demo, double-click TOF_URAT_Demo.ino file
  • Select development board:

TOF Laser Range Sensor C 19.png

  • Select the port of ESP32S3, and then compile and upload it
  • After the upload is completed, open the serial port monitor and relevant information will be output, as shown in the following figure:

TOF Laser Range Sensor C 20.png

I2C

  • For details on how to configure I2C mode, please refer to I2C integrated circuit bus section in the Function part
  • Go to TOF_Laser_Range_Sensor_demo\ESP32S3\I2C\Arduino\TOF_I2C_Demo, double-click TOF_I2C_Demo.ino file
  • Select development board:

TOF Laser Range Sensor C 19.png

  • Select the port of ESP32S3, and then compile and upload it
  • After the upload is completed, open the serial port monitor and relevant information will be output, as shown in the following figure:

TOF Laser Range Sensor C 18.png

IO

  • For details on how to configure the I/O mode, please refer to I/O output section in the Function part
  • Go to TOF_Laser_Range_Sensor_demo\ESP32S3\IO\Arduino\TOF_IO_Demo, double-click TOF_IO_Demo.ino file
  • Select development board:

TOF Laser Range Sensor C 19.png

  • Select the port of ESP32S3, and then compile and upload it
  • After the upload is completed, open the serial port monitor and relevant information will be output, as shown in the following figure:

TOF Laser Range Sensor C 22.png

Micropython example

UART

  • Configure UART on the host device, which does not require configuration by default and can be used directly. If it was previously configured to I2C or I/O mode, refer to the FAQ method to restore the sensor.
  • Refer to the following video for restoring:

Video for Restoring

  • Go to TOF_Laser_Range_Sensor_demo\ESP32S3\UART\micropython, double-click TOF_URAT_Demo.py file
  • Select development board:

TOF Laser Range Sensor C 26.png

  • Select the port of ESP32S3 and run the demo
  • Shell will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 25.png

I2C

  • For details on how to configure I2C mode, please refer to I2C integrated circuit bus section in the Function part
  • Go to TOF_Laser_Range_Sensor_demo\ESP32S3\I2C\micropython, double-click TOF_I2C_Demo.py file
  • Select development board:

TOF Laser Range Sensor C 26.png

  • Select the port of ESP32S3 and run the demo
  • Shell will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 24.png

IO

  • For details on how to configure the I/O mode, please refer to I/O output section in the Function part
  • Go to TOF_Laser_Range_Sensor_demo\ESP32S3\IO\micropython, double-click TOF_IO_Demo.py file
  • Select development board:

TOF Laser Range Sensor C 26.png

  • Select the port of ESP32S3 and run the demo
  • Shell will output relevant information, as shown in the following figure:

TOF Laser Range Sensor C 23.png

Arduino Usage

  • For the environment setup and basic usage of Arduino, please refer to this R4 link, R3 is the default installation.
  • After the environment is set up, the sensor can be connected, download demo

Arduino example

UART

  • Configure UART on the host device, which does not require configuration by default and can be used directly. If it was previously configured to I2C or I/O mode, refer to the FAQ method to restore the sensor.
  • Refer to the following video for restoring:

[Video for Restoring]

Hardware connection

  • Refer to the following diagram for connection:

Run demo

  • Go to TOF_Laser_Range_Sensor_demo\Arduino\UART\TOF_URAT_Demo, double-click TOF_URAT_Demo.ino file
  • Select development board:
  • Select the port of the development board, and then compile and upload it
  • After the upload is completed, open the serial port monitor and relevant information will be output, as shown in the following figure:

TOF Laser Range Sensor C 27.png

I2C

  • For details on how to configure I2C mode, please refer to I2C integrated circuit bus section in the Function part

Hardware connection

  • Refer to the following diagram for connection:

TOF Laser Range Sensor C 30.png

Run demo

  • Go to TOF_Laser_Range_Sensor_demo\Arduino\I2C\TOF_I2C_Demo, double-click OF_I2C_Demo.ino file
  • Select development board:
  • Select the port of the development board, and then compile and upload it
  • After the upload is completed, open the serial port monitor and relevant information will be output, as shown in the following figure:

TOF Laser Range Sensor C 28.png

IO

  • For details on how to configure the I/O mode, please refer to I/O output section in the Function part

Hardware connection

  • Refer to the following diagram for connection:

TOF Laser Range Sensor C 30.png

Run demo

  • Go to TOF_Laser_Range_Sensor_demo\Arduino\IO\TOF_IO_Demo, double-click TOF_IO_Demo.ino file
  • Select development board:
  • Select the port of the development board, and then compile and upload it
  • After the upload is completed, open the serial port monitor and relevant information will be output, as shown in the following figure:

TOF Laser Range Sensor C 22.png

FAQ


Q1. Can it be used under outdoor (strong light) conditions?

  The module can resist certain natural light influences. So it can be used outdoors.

Q2. Are there interferences from multiple modules?

  When multiple modules work at the same time, even if the infrared rays cross each other or hit the same position, it will not affect the actual measurement. If two modules are at the same level and face each other, the measurement will affect both sides.

Q3. Why does the module have no data output?

  Each module has been strictly tested before delivery. If there is no data available, please check the mode, wiring (whether the power supply voltage, cable sequence is correct, and it is recommended to use a multimeter to test whether the pins on both ends of the communication are conducting), baud rate, and other configurations are correct. For the IIC output mode, the host needs to use IIC communication to read data from the set slave address according to the communication timing in the manual. For the I/O output mode, please refer to the relevant sections on I/O mode.

Q4. What should I pay attention to when installing?

Avoid obstruction within the FOV angle during installation. In addition, attention should be paid to the height above the ground to avoid ground obstruction or similar reflective surfaces within the FOV. If the installation height is close to the ground, it may be considered to tilt the module slightly upwards for installation.

Q5. Are the UART, IIC and I/O of the module the same interface?

The UART, IIC, and I/O interfaces of the module share the same physical interface, and the corresponding cable sequence can be converted for different communication modes.

Q6. Why can't Waveshare TOFAssistant software recognize modules after switching to IIC or I/O mode? How to switch between different communication modes?

Currently, Waveshare TOFAssistant only supports identifying modules in UART mode. When in UART mode, the module can be configured to IIC or I/O communication mode by entering the settings page after successful recognition by the host device; In IIC communication mode, commands can be sent to the module through IIC communication according to the IIC communication protocol to switch back to UART or I/O mode; In addition, in the absence of an IIC testing environment or after switching to I/O mode, the following methods can be used to switch back to UART mode:
1. The user needs to prepare a USB to TTL module (recommended CP2102) that supports 921600 baud rate and install the corresponding driver. Connect the TX, RX, and GND wires of the USB to TTL module to the corresponding pins of the TOF module, temporarily disconnect the VCC pin, and then plug the USB to TTL module into the computer.
2. Open the NAssistant software, click on the icon to enter the serial debugging assistant, change the baud rate to 921600, select the COM port corresponding to the USB to TTL module, and then click the connection button to connect to the COM port (which will automatically connect in most cases). Enter 54 20 00 ff 00 ff ff ff 00 ff ff 00 ff ff 10 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 ff ff ff ff ff ff ff 7c in the text box for Single Transmit, change the sending interval to 20ms in the Timed send column in the bottom right corner, and then check the Timed Send option.
3. At this point, connect the 5V of the USB to TTL module to the VCC pin of the TOF module. The module will switch to UART mode and start outputting data. Uncheck the timed send button, then unplug the USB to TTL module and power it on again. Click the identify button on the main page to identify the module.
If the switch fails, unplug the USB to TTL module and repeat the entire process. Do not repeatedly plug and unplug the VCC pin while sending commands. If the module can be recognized normally but the serial port output data is abnormal, it can be manually changed to UART mode in the settings page.
PS: If the VCC pin of the TOF module is connected to the 5V of the USB to TTL module and the module keeps sending protocol data such as 80 00 8000, click the connection button to temporarily disconnect the COM port, change the baud rate to 115200, and then click the connection button to reconnect to the COM port. If the data in the serial debugging assistant starts with b3 b1 at this time, you need to enter de ed 00 05 04 3b 01 00 10 in the text box for Single Transmit, click Send, then unplug the USB to TTL module and power it on again. Click the identify button on the main page to identify the module. If the data still starts with b3 b1 after plugging it in again, repeat the steps of PS.

Q7. What data will the module output when it exceeds the ranging limit?

When the range exceeds 25 meters, the distance output is fixed at 0 meters. At this time, you can refer to the distance status indication in the data sheet to determine whether the data is valid.

Q8. Does the module support the output of point cloud information?

The module can only output one distance at a time and does not currently support the output of point cloud information.

Q9. What is the serial communication terminal model used by the module? What should I do if there is no interface of this terminal on the flight controller and single-chip microcomputer?

The module uses GH1.25 terminals. You can purchase an adapter cable from GH1.25 to other terminals, or cut off the GH1.25-GH1.25 cable that comes with the product and solder other terminals yourself. Please refer to the data sheet for cable sequence, power supply voltage, signal cable level, etc.

Q10. How to resolve the received ad 08 00 into a distance value?

The data in the protocol frame is stored in little-endian mode, and is multiplied by a certain magnification when encoding. For example, ad 08 00 is first restored to hexadecimal data 0x0008ad, then converted to decimal 2221 and divided by 1000 to 2.221m. 

Q11. How is the checksum calculated?

The checksum is to add all the previous bytes and then take the lowest byte of data. For example, the checksum of 55 01 00 ef 03 is 0x55+0x01+0x00+0xef+0x03=0x0148, then the checksum is 48, so the complete data of this frame is 55 01 00 ef 03 48.

Q12. Why is communication not possible in IIC mode?

In IIC mode, it is recommended to use open drain mode output for the SDA and SCL pins of the device, and a pull-up resistor is required on the bus at this time. When communicating, it is necessary to write functions such as start, stop, read, write, and reply according to the standard IIC communication timing. When communicating with the TOF module, refer to the NLink_TOFSense-IIC_Frame0 protocol in the user manual to read and write the register. In particular, pay attention to the shift of the 7-bit slave address and the addition of read and write bits to send.

Q13. When opening the software, an error message "Because the MSVC***.dll file cannot be found..." may be caused by the computer lacking the corresponding Microsoft runtime components. Is this usually solved by downloading and installing the corresponding bits of the system?

Visual C++ Redistributable for Visual Studio 2017, if the above installation fails or shows success but still prompts that the dll file is missing when opening the TOFAssistant program, try to install KB2999226 patch. Note, please select the corresponding version patch program for your computer system. 

Q14. When I open the software, I get an error message "Because Qt***.dll cannot be found..."?

Please check whether the installation file is silently intercepted by the security software. Please exit the security software and reinstall it. Run with administrator rights.

Q15. Does the reflectivity of an object's surface affect the sensor?

In actual use, the sensor's range and accuracy may be affected by the reflectivity of the measured object. In the same environment, the measurement results may be different for measured objects with different reflectivities. Therefore, when using the sensor, it is recommended that users conduct sufficient testing in actual scenarios, and calibrate for specific scenarios if they need to obtain more accurate measurement results. It is recommended to compare the test data of the cardboard and the actual measured object, analyze, compensate and optimize the test data based on the signal strength.

Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)