some help making an IR rangefinder, using a seperate emitter and sensor.

hi everyone, first off, i'm new to arduino so, hello arduinoites. just got a kit from hk and have recently been playing with it, and loving it. made a binary led counter, with variable counting speed (via potentiometer), also got the LCD working, to display the output from an analog in, and also built a basic EM detector with a bar graph of LEDs.

now i'm looking for some thing to do with the IR emitter and the IR detector that came with the kit. so far i have just managed to make an IR detector, with a piezzo buzzer (which doesn't actually use the computational power of the arduino at all, and in fact requires no code, just 5v) what i would like to make is a IR proximity sensor (as i also have an emitter), or ideally a tape measure, or 'range finder'.

it seems however that all the info i can find on this uses an actual rangefinder ir sensor (a three pin affair in a small black rectangular box), rather than just a separate emitter and sensor. so, i was hoping someone might suggestions for building a rangefinder without an integrated unit.

thanks for all and any replies.

Speed of light is just under 3 billion m/s. That's about 1 meter every 1/3 microsecond, about 5 clock ticks at 16 MHz? To be off by a few is not bad if it's the same few every time but to vary a few ticks would be bad.

If you fill small cap and resistor through digital output HIGH digital out then switch to LOW on one analog pin, then flash the light and have the sensor interrupt another digital pin, then read the analog pin to see how much charge was left.... maybe you could get consistently close numbers.

If your IR beam is tight then you might get some idea of range by the strength of the return, assuming the whole dot reflects and what it hits always has the same IR reflectivity. I have found that white paper printed black still reflects IR but not with A/D, just the strength of a led indicator.

You can't make an IR range finder with the sensor you have. Those work on the reflected angle and have a line of sensors closely packed in one package, sometimes called a linear sensor.

I'll tell you what though with your IR emitter and sensor you could make this project of mine:- http://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.html Shown off at this years NY Maker Faire.

GoForSmoke: Speed of light is just under 3 billion m/s.

Nay. It's just under 300 million m/s [299,792,458].

Grumpy_Mike: You can't make an IR range finder with the sensor you have. Those work on the reflected angle and have a line of sensors closely packed in one package, sometimes called a linear sensor.

I'll tell you what though with your IR emitter and sensor you could make this project of mine:- http://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.html Shown off at this years NY Maker Faire.

thanks for this reply (and thanks to the other posters too). i wondered if some thing like this might be the case (otherwise i'm sure similar projects would be easy to come across). i may give your game a go (although i'm not sure if with my jaded sensibilities i will be able to maintain the suspension of disbelief, we shall see).

At the Maker Faire I had candy as the prize and if you got it out without setting the alarm off you got to keep it. The kids with the guy on the stand opposite got very good at it. :)