RGB LED versus RGB sensor
Recently two somewhat related things met on my desk:
- A self-cycling RGB LED extracted from a nose of a plastic deer, a kitschy New Year ornament and
- a VESNA sensor board with a TCS3772 RGB sensor.
Naturally, I had to see how they work together.
I have no idea what the LED part is. It's simply connected in series with a resistor to a lithium button cell. When voltage is applied it slowly cycles through a range of colors in an apparently random fashion. SparkFun sells something that looks similar.
TCS3772 is a surprisingly small (around 2 mm) component. It is the 6 pin package in the center of the photo above. It connects through I2C and reports values for red, green and blue light. It also has a sensor without a filter for over-all brightness and can do proximity detection when used together with an IR LED.
I used the default VESNA driver for it and it does not specify how these raw values translate to a physical unit. I haven't bothered to dig into the datasheet to find out.
This is what I got when I touched the sensor to the LED in a dark room and recorded its readings in a infinite loop.
The LED sequence repeats in around 30 seconds, which surprised me a bit. When I was just watching it, it looked random or at least with a much longer sequence.
I'm not sure why there is such a big difference in the amplitude of different colors. All three colors look equally bright by eye. It might be because the wavelengths of the LEDs are not aligned well with the pass bands of the color filters on the sensor.
It's also obvious that this sensor (at least with the settings used by VESNA's driver) isn't really made for recording fast changes. The values that can be read out through the I2C bus only change every once in 600 ms.
If you can only read it every 600ms, is it integrating over that duration or taking max/min/random readings? I've seen systems where the lower forward voltage needed for red was compensated for with lower PWM rather than a larger resistor, which could maybe explain the amplitudes if it's effectively sampling rather than integrating.