예제는 플로라 (Flora)를 사용하였지만, 일반 아두이노 우노 혹은 나노 등과도 사용될 수 있습니다.
3.3v -> 3v (red wire)
GND -> GND (black wire)
SDA -> SDA (white wire)
SCL -> SCL (green wire)
그 다음 라이브러리를 다운로드 받습니다.
TCS34725 test를 실행하면 다음과 같이 결과르 얻을 수 있습니다.
Your electronics can now see in dazzling color with this lovely color light sensor. We found the best color sensor on the market, the TCS34725, which has RGB and Clear light sensing elements. An IR blocking filter, integrated on-chip and localized to the color sensing photodiodes, minimizes the IR spectral component of the incoming light and allows color measurements to be made accurately. The filter means you'll get much truer color than most sensors, since humans don't see IR. The sensor also has an incredible 3,800,000:1 dynamic range with adjustable integration time and gain so it is suited for use behind darkened glass or fabric.
To make sure you get consistent color, we specified a nice neutral 4150°K temperature LED with a MOSFET driver onboard to illuminate what you're trying to sense. The LED can be easily turned on during sensing and turned off afterwards to save power.
Connect to a Flora via I2C and our example code will quickly get you going with 4 channel readings. A detailed tutorial is in the works, till then, check out our Arduino library and follow our tutorial to install. Sew up the sensor by connecting 3V to 3V Flora output, Ground to common ground, SCL to I2C Clock and SDA to I2C Data on your Flora. All the pins line up and you can chain another sensor such as a lux sensor or accelerometer. Restart the IDE and select the example Flora sketch and start putting all your favorite fruit next to the sensor element!