Example:
Command:
0x55 0xaa 0xab 0x01 0x55 0x12 0x12 (Set Address to 0x12)
Return:
0x55 0xaa 0x12 0x01 0x55 0x01 0x69 (Address set sucessfully)
Trigger measurement
Command:
Return Value
None
PS: Trigger one measure. The distance data will be available after 30ms. This command do not
return any data. The distance data is stored in the buffer, and the Read Distance command can be
applied to get this distance data.
Example:
Command:
0x55 0xaa 0x00 0x01 0x00
Return:
None
Read Distance
Command:
Header Address Length Cmd SUM
55 aa AD 0 01 SUM
Header Address Length Cmd SUM
55 aa ADD 0 02 SUM
Header Address Length Cmd High Byte Low Byte SUM
55 aa ADD 2 02 H L SUM
PS: The command will return the measured distance value. The value consists of two bytes. If the
measurment is out of range or unsucessful, the return data will be “0xFF(H) 0xFF(L)”.
Example:
Command:
0x55 0xaa 0x11 0x00 0x02 0x12(SUM)
Return:
0x55 0xaa 0x11 0x02 0x02 0x01 0x0A 0x11 (Distance is 266 cm)
0x55 0xaa 0x11 0x02 0x02 0xFF 0xFF 0x1F (Out of Range)
Read tempeature
Command:
PS: The command will return the temperature reading. The return temperature reading is using
Celsius scale. If the temperature is above 0 Celsius, the first four bits of High will be all 0. If the
temperature is below 0 Celsius, the first four bits of High will be all 1. The last 4 bits of High together
with the Low bits stands for 12bits temperature. The resolution is 0.1. When the reading is invalid, it
returns 0xFF 0xFF
Example:
Command:
0x55 0xaa 0x11 0x00 0x03 0x13(SUM)
Return:
0x55 0xaa 0x11 0x02 0x03 0xF0 0x0A 0x11 (+1 Celsius Degree)
Header Address Length Cmd SUM
55 aa ADD 0 03 SUM
Header Address Length Cmd High Byte Low Byte SUM
55 aa ADD 2 03 H L SUM
0x55 0xaa 0x11 0x02 0x03 0x00 0x0A 0x20 (-1 Celsius Degree)
0x55 0xaa 0x11 0x02 0x03 0xFF 0xFF 0x20 (Out of Range)
Function to calculate the temperature:
IF(HightByte>=0xF0)
{
Temperature= ((HightByte-0xF0)*256-LowByte)/10
}
Else
{
Temperature= ((HightByte)*256-LowByte)/10
}
SensorConnectionDiagram
A
s the sensor uses RS485 interface which can not be connected directly to the MCU, a MAX485
chip will bridge the TTL interface to RS485, as shown in Figure 4.
For PC users, either a USB-RS485 or RS232-RS485 converter will bridge the gap. A diagram is
depicted in Figure 5 and 6.
Figure 4 Connect Sensor to MCU via MAX485

SEN0002

Mfr. #:
Manufacturer:
DFRobot
Description:
Distance Sensor Modules URM04 v2.0 Ultrasonic Sensor
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet