Example Code for Arduino-Read Temperature (Single)
Last revision 2025/12/17
Default Address: 0x11; Default Baudrate: 19200 bps Leonardo GPIO Power Supply. (40mA) Code Description: Temperature measurement, the received data is not verified
Hardware Preparation
- DFRduino UNO (or similar) x 1
- URM07-UART Ultrasonic Sensor xn
- M-M/F-M/F-F Jumper wires
Software Preparation
- Arduino IDE Click to Download Arduino IDE from Arduino®
Wiring Diagram

Other Preparation Work
- With a single URM07 module, a generic device address 0xAB can be used instead if the device address is unknown.
- Before the power on the URM07 module is not started, set the TX port to high and lower the RX port, and maintaining more than 1s can enable the module parameters to revert to factory settings.
- After the factory reset, the module can not start normally to enter a normal communication state, the on-board LED light flash with 10Hz. The module starts normally when powered back on.
- After the module is started, the module on-board LED only lights up the indication during the process of receiving the data and processing, and the LED goes out when in the standby state.
Sample Code
// # Author: [email protected]
// # Date: 20.08.2016
// # Product Name: URM07-UART Ultrasonic Sensor
// # SKU: SEN0153
// # version number: 1.0
// # Code Description: Temperature measurement, the received data is not verified
// # Connection: Arduino LEonardo GPIO Power Supply
// # Pin VCC (URM07 V1.0) -> D3 (Arduino Leonardo)
// # Pin GND (URM07 V1.0) -> D2 (Arduino Leonardo)
// # Pin RX (URM07 V1.0) -> TX1/D1 (Arduino Leonardo)
// # Pin TX (URM07 V1.0) -> RX1/D0 (Arduino Leonardo)
#define header_H 0x55 //Header
#define header_L 0xAA //Header
#define device_Addr 0x11 //Address
#define data_Length 0x00 //Data length
#define get_Temp_CMD 0x03 //Command: Read Temperature
#define checksum (header_H+header_L+device_Addr+data_Length+get_Temp_CMD) //check sum
unsigned char i=0;
int temperature=0;
unsigned char Rx_DATA[8];
unsigned char CMD[6]={header_H,header_L,device_Addr,data_Length,get_Temp_CMD,checksum}; //Temperature Command package
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
digitalWrite(3, HIGH); // Ultrasonic Sensor VCC
digitalWrite(2, LOW); // Ultrasonic Sensor GND
Serial1.begin(19200); // Serial1: Ultrasonic Sensor Communication Serial Port, Baud rate: 19200
Serial.begin(19200); // Serial: USB Serial Monitor
}
void loop() {
for(i=0;i<6;i++){
Serial1.write(CMD[i]);
}
delay(50); //Wait Data Return
i=0;
while (Serial1.available()){ //Read returned Data (Note: Demo is just for Reference , no data verification)
Rx_DATA[i++]=(Serial1.read());
}
temperature=((Rx_DATA[5]<<8)|Rx_DATA[6]); //Read temperature Value (10 times)
Serial.print(temperature/10); //Print Temperature
Serial.print('.');
Serial.print(temperature%10);
Serial.println("C");
}
Result
Was this article helpful?
