Comparison · Intermediate · 3 min read
Colour Sensors
TCS3200 vs TCS34725
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
Both sensors read the red, green and blue light reflected from an object. The TCS3200 (or TCS230) uses an array of filtered photodiodes and outputs a square wave whose frequency rises with light, selected with pins S2 and S3. The TCS34725 reads red, green, blue and clear channels as 16-bit numbers over I2C and has an IR-blocking filter, which gives more accurate colours. Both need calibration against white and black.
Key specs at a glance
- TCS3200 output
- Square wave, frequency proportional to light
- TCS3200 pins
- S0 and S1 (scaling), S2 and S3 (filter), OUT, OE
- TCS34725 output
- 16-bit R, G, B and clear over I2C (0x29)
- IR filter
- TCS34725 yes; TCS3200 no
- Light source
- White LEDs on most modules
- Supply
- TCS3200 2.7 to 5.5 V; TCS34725 modules 3.3 to 5 V
Which is better?
| TCS3200 / TCS230 | TCS34725 | |
|---|---|---|
| Interface | Frequency on one pin, 4 control pins | I2C (2 pins) |
| Accuracy | Fair, affected by IR | Better, IR-blocking filter |
| Pins used | 5 to 6 | 2 (plus optional LED and INT) |
| Range of light | Wide, adjustable scaling | Adjustable gain and integration time |
| Best for | Classroom colour sorting | Accurate colour matching, light colour temperature |
- Interface
- TCS3200 / TCS230:
- Frequency on one pin, 4 control pins
- TCS34725:
- I2C (2 pins)
- Accuracy
- TCS3200 / TCS230:
- Fair, affected by IR
- TCS34725:
- Better, IR-blocking filter
- Pins used
- TCS3200 / TCS230:
- 5 to 6
- TCS34725:
- 2 (plus optional LED and INT)
- Range of light
- TCS3200 / TCS230:
- Wide, adjustable scaling
- TCS34725:
- Adjustable gain and integration time
- Best for
- TCS3200 / TCS230:
- Classroom colour sorting
- TCS34725:
- Accurate colour matching, light colour temperature
Wiring
TCS3200: S0 and S1 HIGH and LOW for 20% scaling (good for Uno), S2 and S3 to two outputs, OUT to an input, OE to GND, VCC and GND. To read red, set S2 and S3 LOW, measure the pulse width with pulseIn(OUT, LOW), then switch filters for green (both HIGH) and blue (S2 LOW, S3 HIGH). A shorter pulse means more light.
TCS34725: VIN, GND, SDA, SCL; connect LED to a GPIO to switch the white LED. Use the Adafruit TCS34725 library: tcs.getRawData(&r,&g,&b,&c);. Its address 0x29 clashes with the VL53L0X.
Calibration and a sorting machine
Readings depend on distance, ambient light and the LED, so: 1. Fix the sensor 1 to 2 cm from the object and shield it from room light with a black tube or box. 2. Record readings for a white card and a black card, then map each channel from black (0) to white (255). 3. Teach the code each target colour (for example sweets or beads), then pick the nearest stored colour.
A simple sorter uses a servo to move each object under the sensor and a second servo to aim a chute.
Try it: Frequency wavelength calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Reading in open room light without a shield.
- Changing the distance between sensor and object.
- Skipping white and black calibration.
- Using a TCS34725 and VL53L0X on the same bus without handling the address clash.
- Expecting exact colour names from raw values.
Frequently asked questions
TCS3200 or TCS34725, which is more accurate?
The TCS34725, thanks to its IR-blocking filter and 16-bit digital output.
Why does my colour sensor give different values each time?
Ambient light and distance changes. Shield it and keep the object at a fixed distance.
How do I calibrate a TCS3200?
Record the pulse widths for white and black, then map each colour channel between those two values.
Can a colour sensor tell the colour of a light source?
The TCS34725 can estimate colour temperature and lux of a light pointed at it, with the LED off.
Can the TCS3200 work with ESP32?
Yes, at 3.3 V. Use pulseIn() or a counter on the OUT pin.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 6 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


