Reference
Last revision 2025/12/18
Communication Protocol Description
UART Mode (Modbus-RTU)
In UART mode, the sensor is regarded as a Modbus slave, the Master needs to communicate with the sensor by Modbus protocol.
| Register Address | Number | Name | Read/Write | Data Range | Default Value | Data Description |
|---|---|---|---|---|---|---|
| 0x00 | 1 | Module PID Register | R | 0x0000-0xFFFF | 0x0003 | Product check (Detect module type) |
| 0x01 | 1 | Module VID Register | R | 0x0000-0xFFFF | 0x0010 | Version check (0x0010 represents V0.0.1.0) |
| 0x02 | 1 | Module Address Register | R/W | 0x0001-0x00F7 | 0x000D | When the sensor address is unknown, write to the register through the broadcast address 0x00, at this time, the sensor will not have data output Save when powered off, take effect after restarting |
| 0x03 | 1 | Serial parameter control register 1 | R/W | 0x0000-0xFFFF | 0x0005 | Module Baudrate: 0x0001---2400 0x0003---9600 0x0004---14400 0x0005---19200 0x0006---38400 0x0007---57600 0x0008---115200 Other----115200 Save when powered off, take effect after restarting |
| 0x04 | 1 | Serial parameter control register 2 | R/W | 0x0000-0xFFFF | 0x0001 | Module check bit H: Stop bit L: 0x00---None 0x00---0.5byte 0x01---Even 0x01---1byte 0x02---Odd 0x02---1.5byte other---none 0x03---2byte Other---1byte Save when powered off, take effect after restarting |
| 0x05 | 1 | Distance register | R | 0x0000-0xFFFF | 0xFFFF | The distance value LSB measured by the module represents 1mm |
| 0x06 | 1 | Onboard temperature data register | R | 0x0000-0xFFFF | 0x0000 | The temperature value measured by the onboard temperature sensor represents 0.1℃ (with unit symbol) |
| 0x07 | 1 | External temperature compensation data register | R/W | 0x0000-0xFFFF | 0x0000 | write ambient temperature data to this register for external temperature compensation, LSB represents 0.1℃ (with unit symbol) |
| 0x08 | 1 | Control register | R/W | 0x0000-0xFFFF | 0x0004 | bit0: 0-use onboard temperature compensation function 1-use external temperature compensation function(Users need to write temperature data to external temperature compensation data register) bit1: 0-enable temperature compensation function 1-disable temperature compensation function bit2: 0-auto detection 1-passive detection bit3: In passive detection mode, write 1 to this bit, then it will measure distance once. The distance value can be read from distance register about 100ms later. This bit is reserved in passive detection mode. This bit will be auto cleared when set to 1 bit4: 0-Large measuring range(40-900cm) 1-Small measuring range(15-150cm) Save when powered off, take effect after restarting |
| 0x09 | 1 | Electrical noise degree register | R | 0x0000-0x0A | 0x0000 | 0x0000-0x000A corresponds to noise degree 0 to 10. This parameter can reflect the influence of power supply and environment on the sensor. The smaller the noise level, the more accurate the distance value detected by the sensor. |
| 0x0A | 1 | Ranging Sensitivity Setting register | R/W | 0x0000-0x0A | 0x0000 | 0x0000-0x000A corresponds to sensitivity level 0 to 10. Set the ranging sensitivity in large measuring range. The smaller the value, the higher the sensitivity. Save when powered off, take effect after restarting |
I2C Mode
| Register Address | Name | Read/Write | Data Range | Default Value | Data Description |
|---|---|---|---|---|---|
| 0x00 | Sensor Address Register | R | 0x01-0xF7 | 0x12 | I2C Slave address Save when powered off, take effect after restarting |
| 0x01 | Sensor PID Register | R | 0x00-0xFF | 0x02 | Product check (detect sensor type) |
| 0x02 | Sensor VID Register | R | 0x00-0xFF | 0x10 | Firmware Version: 0x10 for V1.0 |
| 0x03 0x04 |
Distance value register high bit Distance value register low bit |
R R |
0x00-0xFF 0x00-0xFF |
0xFF 0xFF |
LSB is 1cm, 0x0064 = 100cm |
| 0x05 0x06 |
Onboard temperature value register high bit Onboard temperature value register low bit |
R R |
0x00-0xFF 0x00-0xFF |
0xFF 0xFF |
LSB is 0.1℃(with unit symbol). For example, TEMP_H = 0x00, TEMP_L = 0xfe, the actual measured temperature 0x00fe / 10 = 25.4℃ |
| 0x07 0x08 |
External temperature compensation data value register high bit External temperature compensation data register low bit |
R/W R/W |
0x00-0xFF 0x00-0xFF |
0x00 0x00 |
Write ambient temperature data to this register for external temperature compensation, LSB is 0.1℃(with unit symbol) |
| 0x09 | Configuration register | R/W | 0x00-0xFF | 0x04 | bit5-bit7: reserved bit4(Max measuring distance set bit): 0: large measuring range (40 - 900cm) 1: small measuring range(15-150cm) bit 3: resvered: bit2: 0:0-auto detection, sensor do measurement all the time and the distance in register is constantly updated 1:passive detection, send the ranging command once, the sensor do the measurement once and store the distance value in distance register bit1: 0: enable temperature compensation 1: distable temperature compensation bit0: 0-use onboard temperature compensation function 1-use external temperature compensation function. Save when powered off, take effect after restarting |
| 0x0A | Command register | R/W | 0x00-0xFF | 0x00 | bit7-bit6: reserved bit0: Write 1 to this bit to trigger one measurement. 0 will be ignored |
| 0x0B | Electrical noise degree register | R | 0x00-0x0A | 0x00 | 0x00-0x0A corresponds to noise degree 0 to 10. This parameter can reflect the influence of power supply and environment on the sensor. The smaller the noise level, the more accurate the distance value detected by the sensor. |
| 0x0C | Ranging Sensitivity Setting register | R/W | 0x00-0x0A | 0x00 | 0x00-0x0A corresponds to sensitivity level 0 to 10. Set the ranging sensitivity in large measuring range(40-900cm). The smaller the value, the higher the sensitivity. Save when powered off, take effect after restarting |
Mode Switch (UART and I2C)
The URM13 sensor is set to UART mode by default, and users can switch it between UART and I2C by the short-circuit of different pins before powering on.
- Short circuit pin TRIG and ECHO, then power on, the LED will falsh twice, represeting that the sensor is in I2C mode.
- Short circuit pin TRIG and BUSY, then power on, the LED will flash once, representing that the sensor is in UART mode.
After the mode is successfully switched, users can disconnect the short circuit. The switched mode will be recorded by the sensor permanently.
Onboard LED State Indication
- When powered on, the sensor LED flashes once, which means that it is in UART mode now, and the LED will flash once every time the sensor receives correct command from Master.
- When powered on, the sensor LED flashes twice, which means that it is in I2C mode now, and the LED will flash once when the sensor starts ranging.
Other Supplementary Information
The physical attributes of ultrasonic sensors inherently beget irregular detection zones. Consequently, the precise definition of the detection angle for ultrasonic ranging sensors poses a challenge. We conducted tests on various sample products using two distinct reference obstacles, and the respective reference detection zones for these targets are as illustrated in the diagrams below:
Was this article helpful?
