Using the TCS3430 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the Adafruit_TCS3430 library, and running the provided example code.
Wiring
Wire as shown for a 5V board like an Uno. If you are using a 3V board, like an Adafruit Feather, wire the board's 3V pin to the sensor VIN.
Here is an Adafruit Metro wired up to the sensor using the STEMMA QT connector:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
Here is an Adafruit Metro wired up using a solderless breadboard:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
Library Installation
You can install the Adafruit_TCS3430 library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit TCS3430, and select the Adafruit TCS3430 library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!
/*!
* @file basictest.ino
*
* Basic test sketch for TCS3430 XYZ Tristimulus Color Sensor.
* Polls the ALS interrupt flag to know when new data is ready
* instead of using a fixed delay.
*
* Limor 'ladyada' Fried with assistance from Claude Code
* MIT License
*/
#include "Adafruit_TCS3430.h"
Adafruit_TCS3430 tcs = Adafruit_TCS3430();
void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}
Serial.println(F("TCS3430 Basic Test"));
if (!tcs.begin()) {
Serial.println(F("Failed to find TCS3430 chip"));
while (1) {
delay(10);
}
}
Serial.println(F("TCS3430 found!"));
// --- Tweak these settings for your environment ---
tcs.setALSGain(TCS3430_GAIN_64X); // 1X, 4X, 16X, 64X, or 128X
tcs.setIntegrationTime(100.0); // 2.78ms to 711ms
// Enable ALS interrupt so we can poll AINT for data ready
tcs.enableALSInt(true);
tcs.setInterruptPersistence(TCS3430_PERS_EVERY);
tcs.clearALSInterrupt();
}
void loop() {
// Wait for new data
if (tcs.isALSInterrupt()) {
uint16_t x, y, z, ir1;
if (!tcs.getChannels(&x, &y, &z, &ir1)) {
Serial.println(F("Failed to read channels"));
} else {
Serial.print(F("X: "));
Serial.print(x);
Serial.print(F(" Y: "));
Serial.print(y);
Serial.print(F(" Z: "));
Serial.print(z);
Serial.print(F(" IR1: "));
Serial.println(ir1);
}
tcs.clearALSInterrupt();
}
// Do something else!
delay(10);
}
Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You'll see the TCS3430 recognized over I2C. Then, the reading values of different light channels will be printed out to the Serial Monitor.
Page last edited March 17, 2026
Text editor powered by tinymce.