3. Ultrasonic Sensor


1. Overview

In this project, ultrasonic sensor is provided to measure the distance from obstacles to the robot. The ultrasonic device URM37 is shown in Figure 1 below. It has multiple serial communication protocols like TTL and RS232 to interface with micro-controllers.

urm37

Figure 1: URM 37 Ultrasonic Sensor


2. Interface Ultrasonic Sensor with Arduino

Even though this powerful device has multiple serial communication protocols like TTL and RS232, there are multiple problems to interface it with Arduino Uno. First, Arduino Uno does’t have RS232 protocol implemented in hardware. Second, the TTL serial port has already occupied by USB connection on Arduino Uno. Even though we could implement RS232 protocol or multi-channel TTL inside software, another easier solution is to collect the measured distance from the PWM pin on the ultrasonic sensor.

By collecting measured data from PWM pulse, two pins from Arduino need to connect with TRIG pin and PWM pin on the ultrasonic sensor. The TRIG is to trigger the sensor to read and then the sensor would return a PWM pulse which reflects the measured distance.


3. Performance Discussion

The ultrasonic sensor can read up to 2 meters, which is quite a lot compared with IR sensors. In addition, its readings are quite precise and don’t  need any post-processing. However, it has some problems to integrate into our robot.

The first problem is its resolution. Unlike infrared sensor just measuring a point in front, ultrasonic sensor will sense all the obstacles in front of it as shown in Figure 2 below. It could be easily seen from Figure 2 that it would always return a measurement from a nearest obstacle within the sensor range even though the obstacle may not be just in front of it. Hence, it could mislead the inference of where the measured obstacle is.

Ultrasonic Sensor RangeFigure 2: Resolution Problem of Ultrasonic Sensor

Another problem is echo problem. Because the sound wave’s sensing range may be wider than the obstacle length in front of it. Blocks nearer than the target obstacle would create echoes and interference with the sound wave reflected back by target obstacle. As a result, the reading distance is distorted and ultrasonic sensor would give a wrong measurement.