Opto-Interrupter Sensor*

Rotation, and Linear Motion Sensor



    1. Hollow out the internal plastic construction of a 4 x 2 brick, drill out two pins, and cut a notch for the leads on the interrupter. Cut the top off of a second block.
    2. Build the circuit onto a board that is about 1 1/8" x 1/2" (small enough to fit inside a brick)
    3. Trim and solder the opto-interrupter leads to the board so that if the board is in the bottom brick (the one without the top) the leads will fit through the notch you made for them in the top brick.
    4. Solder two short wires to two short 3/16 pins and then connect the wires to the circuit where it is labeled "To RCX"
    5. Push the pins into the two holes to replace the pins you drilled out. Glue them into place with super glue or epoxy.
    6. Place the board into the lower brick.
    7. Glue the two bricks together and the opto-interrupter to the side of the bricks.


Plug this sensor to the RCX and set it on light sensor or rotation sensor. If it is on light sensor the value will hover around 15 to 30 and drop to 0 if there is something in the sensor. If it is on rotation it will normally read 0 and -1 if something is in the sensor. Here are some uses:

Rotation Sensor: The slot is wide enough to accommodate various Lego parts. In particular, a 0.95 inch wheel/pulley with six holes in it can be mounted so that it breaks the infrared beam six times in each rotation. The direction of rotation cannot be determined by monitoring the signal from the phototransistor, but this is not important if a motor is driving the wheel, as the direction of rotation of the motor will be known.

Linear Motion Sensor: A similar scheme can be used to monitor the position of a sliding component, e.g. a round ended strip with holes in it, if the it is mounted so that the holes slide in the slot in the sensor. Alternatively, a sliding component can be driven by a rack and pinion system with the rotation of the pinion shaft being monitored as in the rotation sensor example above.

The Sensor:

The opto-interrupter was found in an old floppy drive, but they can also be found in printers and many other devices with moving parts. You could even make your own. They contain an infrared LED on one side and a phototransistor on the other. Inserting something into the sensor will block the beam to the phototransistor.





*Most information was taken form http://www.umbra.demon.co.uk/sensor1.html