More on Robots:
Events
  Robogames 2012
  Killer Robots
  Robogames 2011
  Robogames 2010
  Robogames 2009
Robots
  Fluffy
  Kudu
  Peanut Tin of Terror
  Little Miss Destruction
  John Frizell's Robots
  Quokka
  Sterylite 6000
Videos
  Festo Robots
Parts
  Guide to Servos for Robots
  Notes on Robot Batteries
  Propeller Controller Boards
  Ultrasonic Rangefinding
How To
  Tools You Need to Build Robots
Also
  My Embarrassing Hobby
  Unintelligent Design
  The Five Best Places for Robot Parts

Search Robot Sites

A custom search of the best robot sites.
Custom Search
What is this?



Ultrasonic sonar is a great detection system for robots, and among the most popular for hobby robots. I put a Ping sensor on pretty much every robot I have made for the last ten years, so obviously I am a huge fan. There is a lot of good information on these devices and plenty of examples, but I thought I would try to gather together the information and some practical suggestions in one place. That way you can learn how to use these sensors if you haven't before, and if you have used them I would like to make some suggestions about how you can better use ultrasonic sensors.

Defining Some Terms

Sonar is the process of using sound waves propagated through a material to detect distance. Bats use sonar in the air and submarines use sonar in the water in a similar way to detect the location of objects, their distance, and sometime their direction of movement. Sonar can be active or passive. That means that you can have sonar where you propagate out a wave and listen for them to return (active) or where you listen to incoming waves and try to position them (passive). In the military they often use passive sonar to detect planes or submarines, because using active sonar is like looking for burglar with a flashlight. He's going to find you long before you find him. Animals use echo-location, which is a form of active sonar in the audible range.

Ping sensors, and all the echo-location devices I know of, use ultrasonic sound. Ultrasonic sound is higher frequency sound that is generally too high pitch to hear. That's why it is 'ultra' sonic. High frequency sound tends to scatter less and not propagate as far as audible sound. Audible sound doesn't affect these detectors, and since ultrasound doesn't travel far there usually aren't a lot of sources of interference.

A History of Sonar and Robots

Ultrasound sensors had been used for a long time in industrial applications, but I believe the first low cost application was in cameras. The Polaroid 680 used sonar detector to determine the range to an object and thereby auto-focus the camera. The sensors from a Polaroid camera were used as range finders on early robots. For example, some of the early Heathkit Hero robots had Polaroid sensors.


The Heathkit HERO JR. Note the big sonar disk in the head.

Now dual transducer rangefinders like the ones from Devantech are very popular. In particular the Ping sensor from Parallax is extremely popular. You can find software drivers for these devices on almost any platform. And there are about a thousand examples of robots that use them. Take a look on robotbox.net and you will see many robots with these distinctive sensors.

Why Ultrasound?

The earliest and simplest robot sensors were probably first bumper switches and then infrared detectors. Bumper switches are still an excellent detection method and I think in general touch is underused in robots. It looks cooler to have your robot avoid an obstacle without bumping into it. But you depend on touch from your hands and in particular your feet. There is all kinds of information your feet constantly collecting about the height, angle, and consistency of the ground that is detected by touch. Recently people have begun developing robots with pressure sensitive touch sensors, which is also very useful. Anyway, never discount touch sensing.

Infrared, or IR, is another popular basic robot sensor. It is still a very common range finding technique, mostly because it is the cheapest type of non-contact sensor. The reasons why I avoid it are: 1) it is very vulnerable to changes in ambient light, particularly outdoors. The most reliable IR sensors are very shielded. They work great when they point down under the robot body such that it occludes any other light source, as is often the case with line sensors. But to detect range in other situations may not work or may require calibration. 2) IR sensors have a very short range compared to ultrasound rangefinders. 3) IR can require calibration, where sonar tends to work the same regardless of the operating environment. Calibrating a robot or testing to see if it works in a particular environment is difficult and impractical. It means you have to have some sort of test sequence and some way to adjust your robots sensing or program wherever you use it. You want to just turn your robot on and know it will work.

Ultrasound is very reliable in any lighting conditions. You can use it indoors or out. It is reasonably fast. It is fast enough to take care of collision avoidance for a robot, but not fast enough to track a flying object like a ball. It can handle being moved or wobbling, as long as the the motion or the wobbling is not very fast. So you can reliably position it on a rolling or walking robot, or place it on a moving articulated sensor pod.

Ultrasound isn't as fast or as accurate as lidar, but lidar is extremely expensive. Lidar generates a lot more data, since it gives you many very accurate points of measurement. It takes a good deal of processing power to interpret that data. Microprocessor driven robots do not have the memory or the speed of floating point operations to model the environment based on lidar.

In terms of cost, ultrasound sensors sit in the middle of a continuum of cost that goes from infrared, to ultrasonic, to lidar-- with the costs going up by orders of magnitude. Infrared sensors can cost about $3-$10, ultrasonic is about $20-$30, and lidar is more like twenty to a thousand times that cost. It is hard to say how much lidar will cost in the long run because it is still relatively exotic. But the type of lidar sensors used in the Darpa Grand challenge probably ran from about $5,000 to $75,000 per sensor. Lidar will certainly get cheaper in the long run.

Trying to compare ultrasound sensing to visual sensing is even more complicated. Cameras are more expensive then ultrasound sensors, but the real cost in weight and power is a processing system that can interpret visual images. And like infrared, visual detection can be very dependent on environmental conditions. Usually the choice for hobby robot is touch, IR, and sonar.