IR or ultrasonic range finder?

I am new to Arduino and need to buy some range sensors with a range of 20-30ft. Any suggestions?

It depends on what you want to do and how much you want to spend; for most needs, a Sharp IR sensor or an ultrasonic sensor like Maxbotics or Parallax sells is enough. Neither are very expensive ($20-30.00 US).

If you are wanting to detect a small (or thin) object at that range, though, you may or may not be able to do it with those devices; they are good at picking up such objects closer to the sensor, but not when the object is further away (due to beam profile and spread over distance; the datasheets you can find on these sensors will detail these specs). Also note that the Sharp IR sensor will have issues with dark, matte colored objects...

If you want to go with ultra-cheap IR with some hacking, go down to the local Goodwill or thrift stores in your area, and see if you can find an old Polaroid Sun 660 (among other models) instant camera; these contained a custom Polaroid ultrasonic sensor and drive circuitry that, while kinda power-hungry, is also very well documented by robotic hobbyists, since it has been in use for over 20 years. It doesn't have very close ranging capability, though (designed to focus a camera, it didn't need to have the ability to range closer than about 5 feet or so). Such cameras shouldn't cost more than $2-5.00 US.

If you want higher accuracy, you will have to get to hacking: in theory, it is possible to use a high-resolution web camera (like a Logitech Orbit AF or similar) combined with a line laser (a laser with a lens on it to spread it into a thin line; you can find such modules cheap on ebay), scanned across the area in front of the camera's point of view (using a mirror and servo/stepper) to pick up irregularities (ie, objects, etc). You then capture the image for each scan line position, and use vision processing software (like OpenCV) to drop out all but the image of the line; offsets in the image of the line can then be re-constructed to give you a 3D view of what is in front of the camera (with more vision processing, you can determine distance, what the object is, its orientation, etc - not an easy task; volumes have been written on the subject). Of course, this is something meant more for a full-sized computer - although, in theory, with enough memory you could possibly do something like it on a Arduino; just not very fast.

Also (once again, in theory), you could get one of those laser distance measuring devices sold down at the home hardware big-box store (about $100.00 US), and hack it to give you distance to a point; all you would have to do then is rotate it or scan the point around to determine distances in a circle or arc (essentially acting as a laser radar/sonar; poor-man's lidar - yeah, $100.00 may seem like a lot, until you price COTS lidar units).

Good luck! :slight_smile:

I suspect you will have problems finding an ultrasonic distance sensor that works up to 30 feet. From the Parallax PING web site...

Provides precise, non-contact distance measurements within a 2 cm to 3 m range

The maximum distance is about 10 feet; a third of what you need.

The pir sensors work great for detecting people at 30 ft or more in a still environment. No good for range though.