Hacked Gadgets Forum

March 9, 2009

LEGO Color Sensor

at 9:52 am. Filed under DIY Hacks, Electronic Hacks, Toy Hacks


If you need to add color sensing to your next LEGO project have a look at this RCX Input Mux & Color Sensor. Full schematics and circuit description is provided.

"Color sensing depends on measuring the intensity of light at different wavelengths. A spectrometer does this by splitting the light with a prism or diffraction grating into its component wavelengths. However, spectrometers are complex and too difficult to build. Another approach measures the light intensity in three primary color bands: red, green, and blue. Then calculates the color or hue of the light in software.
Hue is a single number that describes the overall color of a light. It ranges from 0 to 360, much like the degrees of angle around a circle. In the case of hue: 0 is red, 120 is green, 240 is blue and 360 is back around to red again. Intermediate colors have hues like 60 for yellow, 180 for cyan and 300 for magenta. The calculation of hue from red, green and blue values is a simple algorithm described later.
After substantial experimentation, I found that the blue and green plates were too pale for use individually. Stacking two green and three blue plates created enough filter density for good color measurement. The actual color spectrum of the resulting filters can be seen by photographing sunlight shining through them with a diffraction grating"