Danny's Lego Mindstorms® compatible proximity sensor (IRPD)

Home/ Sensors/ Lego proximity sensor

Disclaimer
This page is not connected with or endorsed by The LEGO Company. LEGO, LEGOLAND, LEGO SYSTEM, LEGO TECHNIC, DUPLO, LEGO PRIMO and LEGO MINDSTORMS are trademarks of The LEGO Company.

 

 

On the left I put a photo of an old and primitive version of a "stereo" proximity detector: the central thing is a infrared lamp and on the sides there are two simple IR detectors made with phototranstors.

The suite worked quite well but it needed a motor port for the IR lamp, and two sensor ports for the detectors.

Too much for any single-RCX-owner, I think.

So I get down to work and I came up to this "mono"  version, that works like a Lego light sensor.

I'm still working on a dual proximity detector, that is an hard goal, as I don't want to use any programmable PIC.

(I don't want, maybe, 'cause I simply can't). 

 

 

Here's the complete IRPD sensor, assembled in a box made by two 2x4 bricks.

From the photo are visible the IR led and the little window through which phototransistor detects obstacles.

It is completely insensitive to ambient light variation, but only seeks modulated IR light reflected. 

 

It's a big assembly, I know, but it's the best I could.

 

 

 

Three shots of the internals:

 

Now, the interesting part, the schematics description.

 

 

All starts from the diode bridge that allows a correct alimentation for the sensor, however it is connected to RCX.

In this design, I saved one diode as explained by van Mattijs, Stef en Robbert Mientki , by combining the positive power supply and generating the output signal.

The square wave oscillator pilots the IR led. When an object is in sight, some IR light is reflected back and detected by IR phototransistor and amplified;

the peak detector (a simple AM demodulator) , converts IR light signal into DC voltage.

To interface with RCX a buffer is needed, that through the 10k resistor produces a variable current.

With no object detection, the RCX reads about 50 ( light sensor percentage value);

the value decreases in quite a linear way when an object is from 20-25 cm far away (value is 47) to 4 cm near the IRPD (value is now around 10) .

Better measures can be done with Raw values.