Home Robotics C++ Physics II AP Physics B Electronics AP Java Astronomy Independent Study Summer Session Contests  About
                                                       

Light Sensor

 

The Lego light sensor is well behaved as such sensors go but the physics of sensing light levels is much more complicated and not surprisingly so is the task of interpreting the values returned by light sensors.

The Lego light sensor can be used without an external source of light since it has an LED (Light Emitting Diode) that provides a source of light. Using it's self-contained light source, a downward pointing Lego light sensor can be used to distinguish between the colors painted on the horizontal surface of a playing field designed for robot competition. The principle used is the varying reflectivity of different colors. Variations on this basic idea give rise to robots that read marks on horizontal surfaces for a variety of applications from game playing and line following to object recognition.

In order to understand how the Lego light sensor works we have to consider how light of various wavelengths is transmitted, absorbed, reflected and converted into other forms of energy. Humans see in the the so-called visible light region of the electromagnetic spectrum.

 

The peak sensitivity for the Lego light sensor is in the infrared end of the spectrum. The human body radiates most strongly in the infrared range around 10 microns while the portion of the infrared spectrum used by TV remote control devices and the RCX tower is called near infrared (longer wave lengths) and does not feel warm at all. Human daylight vision works best in the blue-green region of the spectrum where the sun's energy is at a maximum. The light from a flashlight bulb is typically broad spectrum and tungsten bulbs tend toward a maximum at the red end of the spectrum.

The issue of the frequency response of sensors and the frequency spectrum of sources is complicated still further by the fact that in many cases we're interested in the light reflected from surfaces that are not perfectly reflective (they absorb some frequencies and reflect others) and for which the angle of incidence is often different than the angle of reflection. Some materials tend to behave like mirrors (they are said to be specular) and others tend to scatter light in all directions (they are said to be diffuse).

There are other complications that concern the characteristics of the phototransistor such as its response (current) as a function of the light falling on the surface of the sensor (irradiance). However, you are largely sheltered from these complications by the hardware and software of the RCX.

There are some other physical characteristics of the Lego light sensor that you should be aware of. The phototransistor used in the Lego sensor is enclosed in a plastic dome or lens which gives it a wide angular view. If you want to use the sensor as a directional finder you will probably want to use a tube or an arrangement of Lego bricks to restrict the angle of light falling on the sensor. This can be important when, for example, you want to use the light sensor to aim a robot toward a light source.

Here is the circuitry for the Lego light sensor. We're not going to go into details but there are a few things worth pointing out. The Lego light sensor is a powered sensor; it requires power to run its circuitry. Since Lego sensors only have two wires connecting them to the RCX these two wires must be used both to send power to and receive signals from the sensor. Polarity is also a problem given that the Lego connectors allow sensors (and motors) to be attached in any one of four different orientations. These complications are handled by a combination of a special circuit comprised of a diode bridge and a storage capacitor and special software that rapidly switches between driving the circuitry and reading off the sensed values. The capacitor stores enough power so that the circuit continues to function when the sensor is being read. The Lego light sensor is said to be an active sensor in that it not only senses light but it also provides a source of light, i.e., it does not rely passively on a source of light