Index                                Light Sensors                                < Prev   Next >

Light sensors can be an important aid to navigation and a great way for your robotic creation to know something about it's surroundings without reaching out and touching it. Let's learn a little about how the light sensor works and some simple things we can do with it. You will notice that at one end of the sensor there are two round objects. The one on the left is a Light Emitting Diode (LED) the one on the right is the light detector (really a photostransistor).

Assuming that the sensor remains the same distance from the object it is spraying light on, the sensor reads a precentage (from 0-100) of the light being reflected back to it and sends it to the RCX. Darker objects reflect less light, lighter objects more light.

Seeing what the sensor sees

Let's do a little experiment. Attach the light sensor to sensor port 2 and download this simple program to the RCX.