1 minute read
You Will Need
198 Hacking Electronics
The easiest way to use the chip is to buy a module like the one shown in Figure 8-7.
This module, which cost less than USD 10, also has four white LEDs that illuminate the object whose color you want to measure, as well as convenient header pins.
Table 8-1 shows the connections on the module and their purpose. With the exception of the power to the LEDs, these connections are taken straight from the IC, so any module you find that uses the TCS3200 is likely to have the same connections, even if they are not quite in the same place.
The IC does not produce an analog output, but instead varies the frequency of a train of pulses. You choose which color the pulse frequency corresponds to by changing the values on the digital inputs S2 and S3.
Figure 8-7 A light-sensing module
You Will Need
Quantity Item Appendix Code 1 Arduino Uno/Leonardo M2/M21 1 USB lead; Type B for Uno, Micro USB for Leonardo 1 Color-sensing module M12 1 Male-to-female jumper set T12
Pin Description S0 S0 and S1 select the frequency S1 range. Both should be set HIGH. S2 Red—S2 and S3 LOW Green—S2 and S3 HIGH S3 Blue—S2 LOW, S3 HIGH White—S2 HIGH, S3 LOW
OUT The output pulses.
TABLE 8-1 Color-Sensing Module Pinout Description 2.5V to 5.5V Ground Output Enable—set to LOW to effectively turn the chip on. Tie to ground with the attached jumper to turn the LEDs on. Pin
VCC GND OE
LED
GND