Hempel Design Group / Home / lego / lightsensor /
Mindstorms Light Sensor Tricks

If you have played with the light sensor in the Mindstorms kit at all, you will probably have asked yourself "Why can't I use this to actually measure light levels?". The reason is that the emitter LED shines a bit of light onto the detector and it tends to saturate its output, resulting in a very narrow range of values the detector can put out.

Folks such as Michael Gasperi and Frank Angeli have described modifications to the light sensor or instructions for building your own, but this page describes a few easy, nondestructive steps you can take to make a "real" light sesnor out of the one supplied in the Mindstorms kit.

The key is simply blocking off the light from the emitter to the detector. Since I design embedded systems, I have lots of little bits of heat shrink tubing lying about, so I found one that fit (with a little shrinkage) and placed it over the emitter. Lo and behold, the light sensor now produces % values from about 10 in a dark box to 90 when pointed at a halogen lamp about 6 feet away. This is a useful range of values.

Now I had to find something that the rest of you are likely to have in your basement or the back of your desk drawer. It is surprisingly difficult to find a common material that is thin enough to slide over the LED, is stiff enough to be pushed, and is still opaque! Aluminum foil is a possibility, but I wouldn't want to accidentally short anything inside the sensor.

The material I ended up with is the thin vinyl plastic that covers many binders. If you can get it in black, great ... other colours may do the trick as well. You can cut a strip of the stuff from the inside of the spine and still use the binder.

If you cut a thin strip as shown in the picture above, you can "kink" it down the middle and slide it right over the emitter LED - that's the red one on the left. You can get it down far enough into the body that almost all of the light from the emitter is blocked off.

If you are just using it as an ambient light detector, you don't need to bend the flap over. If you need close range light/dark detection, then bend the flap over and secure it somehow, this will block all of the light from the LED.

Now, when you use the [Macro error: There is no glossary entry named "testlight.txt"] script under pbFORTH, the LCD should be constantly updated with the percent of scale values you can read.


For more information contact info@hempeldesigngroup.com


©2000 Ralph Hempel Modified at 8/17/00; 10:08:04 PM