Reading one row of pixels from camera

Look into "Linear CCD Array" modules - they are basically single line CCD arrays, where you essentially focus your image on (you will need to use a lens) and clock the data out; they come in different sizes and types - older models had maybe 256 elements, and black and white. Newer versions have several thousand elements, and color capability. Needless to say, the more elements you have, and color - means more complexity. Generally these newer versions are meant for scanners and such.

The problem is many such modules aren't in DIP packaging - most are in a SMT form which can be difficult to solder (especially the BGA packages out there - not impossible to do, but it takes more than a bit of skill). But you can still find DIP packaged modules that are black and white (which you want) and have only 512 or 1024 elements.

Your other option would be to try something like this:

http://letsmakerobots.com/node/2651

...in which you use a single photo-transistor and spin a mirror to scan the laser; when the photo-transistor "sees" the light, you know the angle of the mirror, and some simple trig and bob's your uncle.

Of course - if you read that whole article, you'll find that the author had issues with it, particularly sensitivity issues. Some suggestions to try to get around this:

  1. Put a filter in front of the photo-transistor to only allow the same wavelength of light as the laser to pass thru (ie, red filter if using a red laser). This will raise the "noise" floor of any ambient light in the area it is being used in.

  2. Match the laser to the photo-transistor - most photo-transistors are more sensitive to the IR region of the spectrum, rather than any visible light, but it is possible (with a lot of searching) to find both visible light sensitive photo-transistors, as well as ones sensitive to say, red or green laser light.

  3. Trade out the photo-transistor for a more sensitive device (and again, match the wavelength of light) - such as a PIN avalanche diode. You may or may not have to redesign the circuit to accommodate such a device, of course...

Now - the author used a fan, as noted - but what if you mounted a small and lightweight mirror on the workings of an analog meter, set to be balanced at a center point: Drive the meter with a sine wave at its resonant frequency, and set up a "timing" detector (another fixed photo-detector device of some sort), so you know when it is at one extreme of travel. Doing such a setup might reduce the size of the device a bit...

These are only a few of the ways I've thought about and studied to create a low cost LIDAR device; if I could just find a cheap and easy to use GHz speed oscillator to modulate a laser with, building a low-cost LIDAR system that used beam interference might be possible (basically, you can modulate a laser using AM or FM modulation - but you have to do it at GHz speeds to be able to have a useful resolution - you send out your modulated beam, and look for the beam with your detector (generally in-line with the laser; you use an optics system for this, like a convex lens with a hole drilled in the middle, and the detector behind the lens at the focal point), which should see (a very attenuated) version of the output beam, modulated of course. You compare that to your reference signal (taken off the oscillator); depending on what modulation method you used (and if you have enough speed in the oscillator - faster is better, especially as the distances grow smaller) - you'll either see "interference patterns" in the amplitude of the combined signals (if you used AM modulation) or "interference patterns" in the waveform itself (beat patterns - using FM modulation). The changes in these patterns are correlated with the distance to the target. A little (or a lot) of math later, you can get your distance.

The other method (which also involves the high-speed timer - and also high-speed and very sensitive detectors) is time-of-flight. Think of it as sonar, but with a light beam; same principle. You start a (high-speed - many GHz) counter as you "flash" a laser; when your sensor detects the flash off the target, you stop the counter. The amount of "clicks" of the counter correlates with the distance to the target, of course. Don't get your hope up of replicating this in a homebrew manner, though - not for anything approaching "inexpensive" at least.

Oh - one other method - which is essentially what the Microsoft Kinect does: Dot pattern displacement. Basically, the Kinect projects out a random (but known) dot pattern in IR on the "scene", and a B/W camera sensitive to IR reads the scene. Then a complex algorithm is run against the image of dots, and due to it knowing a "baseline" measurement of the dots without any obstacles (or something like that), it can calculate the 3D displacement of the dots.

A simpler solution as this would involve a webcam, and some method to generate dots or a grid; fortunately, they sell laser pointer diffraction gratings that do both. Project the dots/grid on a "flat" surface, model the results in 3D, then when an object is in the way, you can tell how the dot/line moved on a subsequent pass and calculate it's 3D displacement. At least, that's the idea.

With that, I'll leave you with this particular (and somewhat older) article which maybe you might be able to adapt - it is basically the same kind of displacement system as described above, but uses a laser projecting a line - and the line is scanned over the scene (maybe by a mirror or something):

http://www.seattlerobotics.org/encoder/200110/vision.htm

Good luck - hope these help!