RGB LED versus RGB sensor

15.03.2014 12:43

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.

Self-cycling LED from a New Year ornament.

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 sensor on a VESNA expansion board.

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.

Self-cycling LED measurements using TCS3772 sensor.

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.

Posted by Tomaž | Categories: Life

Comments

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.

Posted by Spencer

At least some of that time the ADC is probably integrating the value. You can set the integration time in software and I am not sure what exact settings the driver used.

However it seems unlikely to me that the sample time would be low enough to capture changes in pulse width. I would expect more noise in the signal if that would be the case.

Posted by Tomaž

Add a new comment


(No HTML tags allowed. Separate paragraphs with a blank line.)