URM37 V3.2 Ultrasonic Sensor uses an industrial level AVR processor as the main processing unit. It comes with a temperature correction which is very unique in its class.
- Power: +5V
- Current: <20mA
- Working temperature: -10??+70?
- Detecting range: 4cm-5m
- Resolution: 1cm
- Interface: RS232 (TTL), PWM
- Servo control: One servo control output
- Operating Mode: Serial (PWM) passive control mode; Autonomous Mode; On/OFF Mode
- Temperature sensor: 12 bits reading from serial port
- Size: 22mm × 51 mm
- Weight: 30g
- +VCC – +5V Power
- GND – Ground
- RST – Reset
- PWM – PWM Output 0?25000US?Every 50US represent 1cm
- MOTO – Servo control signal output
- COMP – On/OFF mode, when the detecting distance is smaller than a pre-set value, this pin pulls low.
- TRIG – PWM or RS232 trigger pin
- PWR_ON – Enable pin, enable the sensor when high
- RXD – RS232,TTL communication
- TXD – RS232,TTL communication
Working Mode Selection
The working mode can be changed by writing 0×00, 0×01 or 0×02 to EEPROM through serial port.
Mode 1: Serial passive control mode
Under this mode, the sensor is always waiting for command from serial port. Every time it receives a command, it will return the distance and wait for the next command. The degree in the command will be used to control a servo motor to rotate corresponding degree. Please note that this mode is always on. It can not be switch on or off.
Jumper setting for RS232 and TTL output
The selection of RS232 or TTL output level is switched by changing three jumpers (J1, J2, J3). A diagram below illustrates the setting:
Warning: Do not connect to TTL MCU when the output mode is set to RS232, doing so will permanently damage the unit.
This feature is only available for Rev2 and after. If there are no jumpers on the back of the sensor, the sensor is Rev1 and hence not supporting this feature.
Mode 2: Autonomous trigger mode
Under this mode, the sensor will make a sensor reading every 25ms and compare the reading with a threshold (pre-set, user is able to define this value by writing EEPROM), if the reading is equal or smaller than the threshold, pin COMP/TRIG will have low output. In the meantime, pin PWM will output the distance reading, every 50us low level stands for 1cm, by counting the number of these pulses, the distance can be calculated. This mode can be simply used as an ON/OFF switch.
Mode 3: PWM passive control mode
Under this mode, a low pull on pin COMP/TRIG will trigger a sensor reading. The width of the pulse is proportional to the servo rotating degree. After a successful sensor reading, Pin PWM will output pulses, every 50us represents 1cm. If the reading is invalid, a 50000us pulse will be returned.
Serial control protocol
Serial setting?Port rate: 9600; Parity: none; Stop bit: 1
Command: Control command consists of four bits, command+data0+data1+sum. Sum=Low 8 bit of the sum of command+data0+data1.
|0×11?NC?NC?Sum (Sample: 0×11 0×00 0×00 0×11)||Enable 16 bit temperature reading||Reading the temperature, the return data format will be:0×11+High(temperature)+Low(temperature)+SUM
If the temperature is above 0, the first four bits of High will be all 0. If the temperature is below 0, 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 0×11+0xFF+0xFF+SUM
|0×22?Degree?NC?SUM (Sample: 0×22 0×00 0×00 0×22 )||Enable 16 bit distance reading||The degree in the command is used to control a servo motor to rotate corresponding degree.
Degree: 0-46 stands for 0-270 degrees, for example, 3 stands for 18 degrees.
Return data format will be: 0×22?High(distance)?Low(distance)+SUM. When the reading is invalid, it returns 0×22+0xFF+0xFF+SUM
|0×33?Add?NC?SUM||Enable internal EEPROM reading||Return data will be 0×33?Add?Data?SUM.|
|0×44?Add?Data?SUM (Sample: 0×44 0×02 0xbb 0×01) Enable PWM mode||Enable internal EEPROM writing||Written data can only from 0-255.Address 0×00-0×02 is used to configure the mode. 0×00 – threshold distance (Low) 0×01 – threshold distance (High) 0×02 – Operation Mode (0xaa for autonomous mode) (0xbb for PWM passive control mode)
The return data format will be: 0×44?Add?Data?SUM
Note:NC stands for any data?SUM stands for sum, Add stands for address.
1? PWN_ON must be set to High to enable sensor.
Examples: Function to calculate the temperature:
Servo control command reference table:
V3.2 Help Mate Download: