Obstacle detection
For obstacle detection my mobile robot will use two HC-SR04 ultrasonic sensors. One sensor will be mounted at the front of the truck and the other at the back of the truck so that obstacle detection will be possible in both forward and reverse mode.
This sensor module is advertised to provide a 2cm to 450cm range with an accuracy of 3mm. The sensor generates a 40 KHz ultrasonic burst. It works by measuring the propagation delay between the end of the burst and the start of the reflected acoustic signal. By multiplying the speed of sound with the propagation delay one can find out an estimate of the distance to the obstacle (actually this is twice the distance since the acoustic signal has to be reflected by the obstacle.)
Testing the sensors
I tested four different sensors. The next pictures show my testing setup. Since for my application an accuracy of one to two centimeters is acceptable, I was not very interested to find out how accurate (at millimeter range) the sensors are. I just wanted to make sure the sensors are functional. I tested the four sensors at distances that I plan to detect for my application: 30, 20 and 10 cm.
All sensors behaved OK, with an accuracy within one centimeter.