# Alternate ways of measuring distance (lateral)?

I'm working on a micromouse, a small autonomous robot that traverses a maze.
I need an efficient way to measure lateral distance to walls and I'm looking at the Sharp GP2D120 but looking at the datasheet, it has long typical response time of 39ms, is quite bulky, and has a minimum distance of 4cm.
Can you recommend a better sensor (that possibly has a lower minimum distance)?

I was wondering what are some alternate ways of measuring distance? I have seen other micromice use IR LEDs and it was interesting but I'm not sure how it works.

Any input is appreciated. Thanks!

-
+1 for mentioning IR LEDs. I was just planing to ask a question how to use them to measure distance. –  AndrejaKo Oct 30 '11 at 20:10

I have read somewhere (I think the Arduino forums) that sharp no longer manufactures these sensors (though that can be hearsay). I do know however that they are quite expensive compared to much simpler solutions.

The simplest would be a IR LED - IR phototransistor combination:

Phototransistor on left, led on right

You would power the IR LED (remeber the limiting resistor!) and then use the phototransistor to pick it up. The voltage drop over the phototransistor will be proportional to the intensity of the IR light it picks up which is proportional to the distance the emitter and detector are from the reflecting surface.

Pointers (Personal Experience):

• It will take some experimentation and calibration to find the correct voltage - distance relationship
• The voltage will vary depending on the reflectivity of the reflector to IR light.
• The detector and reflector will need to be shielded from each other in order to gain a accurate measurement.
• This type of sensor is only reasonaly accurate. Keep it in mind.
• The detector is susceptible to outside sources of IR light, including the sun, incandescent light and florescent light bulbs.

There are many links on the internet on how to use said components. Take a look here: http://letsmakerobots.com/node/2907

Lastly, this method (I have found) is only accurate over small distances (not more than 20cm I'd say). For longer ranges you should consider ultrasonics or those fancy Sharp sensors.

-

I suggest you look at how real mice measure close distances:

Could you arrange to have some flexible wire (piano wire) attached to microswitches to emulate the mouse's whisker?

This can even be purchased as an off-the-shelf part:

-
+1 just for the cute mousie –  Majenko Oct 31 '11 at 0:17