Maker.io main logo

Arduino Color Recognition Using TCS34725 Color Sensor and Neopixels

2026-05-13 | By Ron Cutts

License: GNU Lesser General Public License LED Strips Arduino ESP32

In this tutorial, we are going to recognize the color of the paper and display this color on the NeoPixel strip (8 LED) using a TCS34725 Color Sensor & Arduino.

Watch the video!

Learn more about Visuino: What is Visuino

What You Will Need

What You Will Need

What You Will Need photo 2

What You Will Need photo 3

What You Will Need photo 4

What You Will Need photo 5

What You Will Need photo 6

The Circuit

  • Connect the Color Sensor pin VCC to Arduino pin 5V

  • Connect the Color Sensor pin GND to Arduino pin GND

  • Connect the Color Sensor pin SCL to Arduino pin SCL

  • Connect the Color Sensor pin SDA to the Arduino pin SDA

  • Connect the first LED strip pin VCC to Arduino pin 5V

  • Connect the first LED strip pin GND to the Arduino pin GND

  • Connect the first LED strip pin DIN to Arduino Digital pin 6

The Circuit

Start Visuino, and select the Arduino UNO board type.

Start Visuino as shown in the first picture. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino. When the dialog appears, select "Arduino UNO" as shown in Picture 2

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type photo 2

In Visuino, Add Components

  • Add "Color Sensor TCS34725" component

  • Add "NeoPixels" component

In Visuino Add Components

In Visuino Add Components photo 2

In Visuino Set Components

  • Double click on the "NeoPixels1" and in the "PixelGroups" window, drag "Single Color" to the left and in the properties window, set the "Count Pixels" to 8 <<this is the number of LEDs on the LED stripe; in this case, it is 8

  • Close the "PixelGroups" window

In Visuino Set Components

In Visuino Set Components photo 2

In Visuino Connect Components

  • Connect "ColorSensor1" pin I2C [Control] to Arduino pin I2C [In]

  • Connect "ColorSensor1" pin [Color] to "NeoPixels1" > "Color1" pin [Color]

  • Connect "NeoPixels1" pin Out to Arduino Digital pin 6

In Visuino Connect Components

Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom, click on the "Build" tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Generate, Compile, and Upload the Arduino Code

Play

If you power the Arduino module and put colored paper over the sensor, the Neopixel strip will display the paper color.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project that I created for this tutorial. You can download it and open it in Visuino: https://www.visuino.eu

Downloads

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.