# IR distance sensor

Discussion in 'General Electronics Chat' started by mik3, Feb 23, 2011.

1. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
Hi guys,

An IR distance sensor is to be made to measure distance from a wall (up to 30cm).

What IR emitter and IR receiver do you suggest, narrow or wide angle?

2. ### jpanhalt AAC Fanatic!

Jan 18, 2008
5,699
910
Are you measuring intensity or using triangulation?

Have you seen the Sharp GP2D12 group of sensors?

John

3. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
I am measuring intensity.

Yes, I have seen them but their response is quite slow, fastest is about 50Hz. I want samples at 1kHz.

4. ### jpanhalt AAC Fanatic!

Jan 18, 2008
5,699
910
I suspect when you are measuring intensity, for best accuracy, you want a collimated beam. For the detector, I suspect a narrow aperture, slit, or some other way to limit extraneous light would be best (analogous to eliminating "stray light" in absorption spectroscopy). I have no experience in using intensity for distance determination.

Vishay makes analog detectors. In case you haven't seen them, here is a link:

http://www.vishay.com/company/press/releases/2010/100628irsensors/

John

5. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
Their response is slower than Sharp's sensors!

6. ### jpanhalt AAC Fanatic!

Jan 18, 2008
5,699
910
300 µS (3.3 KHz) is slow? I don't think you are going to do much better than that with commercial IR, unless you go with straight carrier wave.

John

7. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
Where do you see that 300us?

The light intensity (distance) is represented by the width of the output pulses. The minimum pulse width is about 1ms.

8. ### hgmjr Moderator

Jan 28, 2005
9,030
214
What resolution do you need to be able to resolve? (+/- 1cm, +/- 2cm, other)

Since light travels approximately 30cm in 1 nanosecond. 1cm resolution would involve time measurements on the order of 32 femtoseconds (10e-15).

That is quite a stretch for most circuitry.

hgmjr

9. ### jpanhalt AAC Fanatic!

Jan 18, 2008
5,699
910
Well, I could be interpreting this entirely wrong:

As I interpret that, t$_{po}$ is the output pulse. It is greater than t$_{pi}$-5/f$_{o}$ and less than t$_{pi}$ +6/f$_{o}$. The minimum t$_{pi}$ is 10/f$_{o}$.

It may work with t$_{pi}$ = 10 pulses, but even with t$_{pi}$ = 15 pulses, the shortest pulse would be 10/38000 sec = 0.26 mS and the longest would be 21/38000 = 0.55 mS.

Capture time is 0.3 mS, so you are still greater than 1 KHZ, albeit not by much.

John

10. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
I won't measure the travel time but the intensity.

Feb 4, 2008
4,846
63
12. ### jpanhalt AAC Fanatic!

Jan 18, 2008
5,699
910
Sure, but that is with a 300 mS burst length. It doesn't have to be that long. In any event, I saved the Vishay datasheet not because of its speed of measurement, but because it gives an analog output. I saw it one day and thought, hey, this might help the next 100 FYP posters who want to measure distance with IR.

You could go completely analog (CW, as mentioned), but then you will have to contend with background noise that makes even beam-break detectors difficult to make work well. I suspect the noise problem would be even worse if you wanted to use intensity as your metric.

The triangulation alternative will still have a problem with speed, because it too depends on a modulated beam for noise rejection.

We don't know anything about the geometry of what you are trying to do, but I suspect a method based on intensity of reflection will give the poorest results unless the conditions of testing are very well controlled.

John

13. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
It will be used on a micromouse, thus it has to be fast to reduce the measuring error between the samples.

14. ### hgmjr Moderator

Jan 28, 2005
9,030
214
I get it. Time-of-flight is off the table.

hgmjr