WSAL16131 – TCS34725 Color Sensor/en
Erscheinungsbild
Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.
Summary
The TCS34725 color sensor provides RGB and light intensity values over I2C. It is based on the TCS34725FN chip with an embedded ADC, an IR blocking filter, and an onboard supplemental LED.
Related products at JW Tech
Technical overview
- Sensor: TCS34725FN with embedded ADC
- Interface: I2C (SDA/SCL), address 0x29 (7-bit) or 0x52 after left shift
- Operating voltage: 3.3 V or 5 V
- Resolution: 4-channel RGBC, 16 bits per channel
- Recommended measuring distance: approx. 2 mm
- Module dimensions: 27 × 20 mm
- INT output is an open-drain interrupt with programmable thresholds
- Onboard LED acts as a fill light; brightness adjustable via PWM
- Onboard voltage level translator makes the module compatible with both 3.3 V and 5 V
Commands and examples – verify before use:
sudo raspi-config
sudo reboot
sudo wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
sudo tar zxvf bcm2835-1.71.tar.gz
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
sudo apt-get install wiringpi
wget https://files.waveshare.com/wiki/common/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
sudo git clone https://github.com/WiringPi/WiringPi
cd WiringPi
sudo ./build
sudo su
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
sudo apt-get update
sudo apt-get install python-pip
Notes and version constraints
- The Bookworm environment only supports the lgpio library; BCM2835 and wiringPi are not available there.
- For all-zero values or initialization failures, first verify the hardware connection and press RESET if needed.
- If all RGB values read 253, light intensity exceeds the measurement range; reduce the gain (e.g., TCS34725_Set_Gain(TCS34725_GAIN_16X)).
- Changing the integration time affects the maximum channel value limit and can produce darker or whiter colors; adjust LED brightness accordingly.
- If the interrupt does not trigger or keeps repeating, adjust the threshold value; pay special attention when using a fast sample rate.
- The STM32 examples are based on STM32F103RBT6/STM32H743; other boards require adapted connections and code porting.
- For STM32 serial output: confirm baud rate 115200 and select the correct COM port (USART2: PA2 TXD, PA3 RXD).
- The Arduino example is written for Arduino UNO; other boards need adapted pin mappings.
Source and revision record
- TCS34725 Color Sensor - Waveshare Wiki
- Source revision: 109812
- Captured: 2026-08-31T03:17:18+00:00
- SHA-256:
c9bce420bd4412cb770ac9616e76122d8c94b5d3062ece8d3249bace6c2935c1