Distance sensors

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
I want to make a Distance Calibrating sensor using only IR emitter and photo diode. In short I need an electrical voltage as an output for the corresponding intensity of IR emitter that falls back on photo diode after reflection. Once a I get a voltage that is consistent to the distance of the object my purpose is served. The object to be detected is always a smooth white surfaced wall and my sensors at all times are perpendicular to the plane of the wall. All the external parameters like ambiance because of sun , camera flashes and other sources of noise should be considered. Kindly Help me with a circuitry or some really nice implementable ideas.
Thank you
 

beenthere

Joined Apr 20, 2004
15,819
This is very easy to experiment with. Although the fact that absolutely nobody uses this methodology to measure distance might give you a hint about how practical it is.

What range of distance did you have in mind? I think Panasonic sells side-by-side IR emitter/receiver pairs.
 

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
sir, I thought it was easy ( It is not like proximity detector although it looks really similar ) but the values are drastically affected by ambience and noise IR and hence they have to be eliminated ! my range is very specifice from 3.5cm to 5.5cm thats it , i need to work only in this range
 

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
readymade distance sensors like the sharp sensors cannot be used although discreete components like IR trans/receiver pair can be used
 

SgtWookie

Joined Jul 17, 2007
22,230
That's going to be tough using infrared, as even without sun, camera flashes, etc - small changes in temperature of the surface being measured will also affect your readings. Simply referencing a thermistor at your IR emitter wouldn't help, because the surface may be heated or cooled from behind, as in a refridgerator or oven.

Even the drafts from when heating or air conditioning units were cycled from on/off/on could make a substantial difference - and they generally cycle from between 3 to 8 times per hour during heating/cooling seasons.

But, enough of the naysaying - let's see what might be done ;)

Your I/R sensor (photodiode) should be shrouded in a tube, to minimize interference from surrounding influences; the open end of the tube pointed at the object.

With the IR emitter off, take a reading from the photodiode to establish a baseline (zero calibration.) Then turn the IR emitter on, wait for the propagation delay to be complete, and take another reading from the photodiode. Then turn the IR emitter off, wait for propagation delay to expire, and take another reading. It should very close to equal the first reading.

With a bare, non-focused emitter of light (as the sun, or an ordinary household lightbulb), the intensity of light diminishes as the square of the distance. But if your IR emitter is an LED-type (which I'm virtually certain it is) then it will have "somewhat" of a focusing lens, the effectiveness of which may be quite variable. You'll need to consult the datasheet for your particular IR emitter. Some are tightly focused for long range, some moderate, and some have quite a wide spread. You may also find that the consistency is quite variable, even in the same lot.

Try mapping out the radiation pattern of your IR emitter using your photodiode as the center. Mount your IR emitter on a protractor, pointing out at the 90 degree mark.

This is just a start; it's getting late here and I have to get up early in the morning.
 

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
sir , your idea absolutely right , but sir my application gets slower overall cos of this , cant i use some kind of modulation technique or something that distinguishes the IR from transmitter to IR noise ?
 

Ron H

Joined Apr 14, 2005
7,063
sir , your idea absolutely right , but sir my application gets slower overall cos of this , cant i use some kind of modulation technique or something that distinguishes the IR from transmitter to IR noise ?
In your bandpass filter thread, you said the resulting sine wave would not work. Can you tell us why you think this is true?
 

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
consider my original input is a square wave of 3V and after passing it through the filters
1 -> Amplitude of sine wave output reduces as corresponds to square input
for eg 3V is reduced to 2.7V, but then that is also not a problem as long as they reduce proportionately.
2 -> As i work at frequency of 1khz and my application is going to be interfaced to a uC , my uC working at around 8Mhz will detect the instantaneous voltage of the sine wave and not the rms voltage. the instantaneous voltage would be very unreliable and hence my circuitary will not be consistent
 

Ron H

Joined Apr 14, 2005
7,063
consider my original input is a square wave of 3V and after passing it through the filters
1 -> Amplitude of sine wave output reduces as corresponds to square input
for eg 3V is reduced to 2.7V, but then that is also not a problem as long as they reduce proportionately.
2 -> As i work at frequency of 1khz and my application is going to be interfaced to a uC , my uC working at around 8Mhz will detect the instantaneous voltage of the sine wave and not the rms voltage. the instantaneous voltage would be very unreliable and hence my circuitary will not be consistent
How were you planning to interface the 1kHz square wave to the uC?
 

SgtWookie

Joined Jul 17, 2007
22,230
Now I see why you were using the filter; you were driving the IR illuminator from an output of the uP, and wanted to ensure that the high frequencies were eliminated.

Rather than driving the illuminator directly from the uP, consider using the uP's output to turn on a precision analog switch, like the MAX333. This device has a low ON state resistance (typically < 17 Ohms) and can handle 20mA continuously from an output.

It DOES have a turn-on time of 90nS, and a turn-off time of 45nS; you'd have to figure that into your total propagation delay times.

If you had an input pin connected to the Vcc and bypassed it well (using perhaps a 10uF and 0.1uF cap right at the input pin) and your output had the IR illuminator and the current limiting resistor with short leads to ground, you would eliminate most of the bandwidth problem and noise interference.

You would still have to have your uP turn off the IR illuminator, wait for the switch to turn off (>45nS), then read the off-state ambient light, then turn the IR illuminator on, wait for the switch to turn ON (>90nS), take another reading, then turn the switch back off, wait for >45nS, and take another reading. It sounds like a lot of waiting, but since each tick of your CPU's clock is 100nS... ;)

Layout of the circuit will be your biggest concern. The CPU will put noise on the power supply. Having the analog side well-bypassed will help a great deal in eliminating the noise. You could use your filter circuit to filter the supply for the MAX333 and IR illuminator. Any capacitance or inductance in the switch enable line will slow turn-on times, but you may have to add series resistance to reduce "ringing" or overshoot/undershoot.
 

gootee

Joined Apr 24, 2007
447
consider my original input is a square wave of 3V and after passing it through the filters
1 -> Amplitude of sine wave output reduces as corresponds to square input
for eg 3V is reduced to 2.7V, but then that is also not a problem as long as they reduce proportionately.
2 -> As i work at frequency of 1khz and my application is going to be interfaced to a uC , my uC working at around 8Mhz will detect the instantaneous voltage of the sine wave and not the rms voltage. the instantaneous voltage would be very unreliable and hence my circuitary will not be consistent
Hi prodigyaj,

I don't know what the best overall approach would be, offhand. But if you do decide to use the modulation and filter method, you could then run the filter's output through an RMS-to-DC converter. I posted more about that in your older bandpass filter thread, earlier today. You could make such a converter with a dual opamp and some diodes, resistors, and capacitors. Or, you could buy an RMS-to-DC converter IC.

- Tom Gootee

http://www.fullnet.com/~tomg/index.html
 
Top