September 2005: I developed a LEGO proximity sensor that can be stacked with other identical ones on the same RCX input port, till a maximum of 3 sensors. The limit of 3 sensors is due to current consumption, to avoid overloading the RCX input port. Every device is based on Sharp IS471F IR sensor, that outputs a high or low voltage depending on object presence. The complete IRPD sensor is fitted in a box made by a 2×4 brick.
It’s possible to stack 3 sensors on the same port, and still knowing which one has detected an object. Every sensor has different output resistor, that scales the reading for RCX (as passive sensor MUX on Michael Gasperi’s page). In the photo you can see the IR led and the hole through which sensor detects objects. It is completely insensitive to ambient light, because it only seeks modulated IR light reflected by objects. For the packaging, I thank Philo for his kind help: I developed this sensor basing on his prototype, built in SMD. You can see the schematic on the left.
To reduce space needed, I simplified the diode bridge: the sensor is thus polarized and can be used one way only (no damage if reversed). The circuit is a basic implementation of the schematic included in the IS471F datasheet. The Sharp sensor requires few external components: it drives the led with a modulated signal and reads the reflected light back. The resistor R2 sets the value read by RCX in case of detection (47k, 100k, 220k should work well). The value of 10uF for C1 is enough. Adjusting the value of R1, you can set the range of the sensor: with 100 ohm resistor, the maximum distance from a WHITE obstacle is about 13 cm.