Using 38 KHz IR receivers to measure distance

by gomek   Last Updated June 30, 2020 01:25 AM

Can I somehow use Vishay's TSOP series IR receivers and IR LEDs to measure the distance from an object? Has anyone done that before or has any idea how one could do it(clever programming or circuitry, maybe?)?



Answers 5


I doubt you could do better than just detect the obstacle this way. What you need is a device like Sharp GP2D12, which measures distance between 10cm and 80cm. About USD 10, IIRC.

stevenvh
stevenvh
November 27, 2010 18:56 PM

You will need to have to approach it one of a different ways. one method would be to sweep what power you are radiating with the LED (something like a digital potentiometer to control the current) so that different range of objects will be detected.

It is very important that you recognize different materials will reflect IR differently making it very hard to get accurate results unless you know what materials will exist. The Receivers also have automatic gain control that will remove a continuous signal at the frequency and can remove yours if you send it continuously.

Kortuk
Kortuk
November 27, 2010 19:07 PM

You can get some effective LED power control by adjusting the mark/space ratio of the 37khz carrier. However it isn't a good way to get any sort of repeatable distance info - could be useful for object detection and approach/retreat discrimination . Elmos's Halios can do IR ranging by comparing reflected light with a local reference signal, but unless you're designing high volumes there are cheaper and simpler ways.

mikeselectricstuff
mikeselectricstuff
November 27, 2010 22:56 PM

Sure, see paragraph 4 about Vishay's fixed-gain receivers:

Many other applications require a reflective sensor that detects not only presence but also proximity by measuring the strength or weakness of the reflected signal. Instead of a fixed detection threshold, analog information from the sensor is needed. This is possible with the TSOP4038, TSOP58038, and TSOP58P38 IR proximity sensors. The length of the sensor’s output pulse in response to the emitter signal varies in proportion to the amount of light reflected from the object being detected. For near objects, the output pulse approaches 100 % of the emitted pulse, for far objects the output pulse becomes shorter.

Eric
Eric
October 02, 2012 20:54 PM

Yes. You can sweep modulation of frequency of the transmitter and use the very sharp roll of of sensitivity around 38kHz of the receiver to estimate distance based on signal. It is not that accurate though and is influenced by ambient light as are other IR distance sensors that rely on output amplitude for distance measurement. You can also get interference from sunlight and Fluorescent lamps among other things. But you can derive a distance scale based on frequency ranges up the receiver sensitivity slope. You know what frequencies let an object be detected so can estimate how far based on prior calibration tests. I did this in 2012 using Parallax Arduino BOEBOT kit.

Nick
Nick
June 30, 2020 00:58 AM

Related Questions



Under water distance measurement

Updated April 22, 2015 20:10 PM