Download Print this page

Software Notes; Module Pinout - Parallax TCS3200-DB Product Overview

Color sensor module

Advertisement

Software Notes

When used with a BASIC Stamp, the TCS3200's output frequency can be read using the Stamp's COUNT
statement, as shown in the example code on the front side of this sheet. In this example, S0 and S1
were both pulled "high", enabling the TCS3200's fastest output rate. However, this rate can be as much
as 600KHz or more at maximum light intensity, which is faster than the BS2 (limited to 120KHz) or the
BS2pe (limited to166KHz) can count. So, S0 and S1 need to be set according to the maximum expected
light intensity from the subjects being examined. On the MoBoStamp-pe, you can also measure the
output frequency using the AVR coprocessor. This function is built in to the GPIO3 firmware, which can
measure input frequencies up to 1MHz. See the GPIO3 documentation for the details. The TCS3200's
OUT signal will appear on the GPIO3 firmware's port 2.
In order to save power — especially when battery-operated — you can power off the TCS3200 chip by
setting S0 and S1 low. You can also operate the LEDs only when reading color. This works because the
LEDs come on almost instantly, having no warm-up time as incandescent lamps do. This can be
accomplished by strobing LED high only when you need to take a reading. This technique is also useful
for canceling the effects of ambient light. Take one reading with the LEDs on and another with them off,
then subtract the second reading from the first to get a more accurate color measure. This only works, of
course, when the ambient light doesn't change between readings. Also, if the ambient light comes from a
fluorescent light source, be sure that the measurement interval is a multiple of the mains period (1/60
sec. in the U.S.).
The S2 signal line includes a 0.047 F capacitor to ground. This can be used to identify the presence of
the TCS3200-DB or to determine which MoBoStamp-pe socket it's in, using the following PBASIC code:
LOW S2
PAUSE 20
RCTIME S2, 0, Id
If, after executing this code, the TCS3200-DB is present in the socket tested, the variable Id will have a
value of around 35. An empty socket will yield a value of 1, and other TAOS light-to-frequency
daughterboards will identify with different values.
Additional information, applications, and software examples can be found on both the TAOS and Parallax
websites listed in the header on the first page.

Module Pinout

Rear View
© Parallax, Inc.
TCS3200-DB (January 21, 2010)
Page 6 of 7

Advertisement

loading