Arduino Color Recognition Tcs34725 Color Sensor And Neopixel

About the project

In this tutorial we are going to recognize a color of the paper and display this color on the Neopixel strip (8 led) using a TCS34725 Sensor

Project info

Difficulty: Easy

Platforms: ArduinoDFRobotVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Breadboard (generic) Breadboard (generic) x 1
Jumper wires (generic) Jumper wires (generic) x 1
Arduino UNO Arduino UNO x 1
DFRobot Gravity: TCS34725 RGB Color Sensor For Arduino DFRobot Gravity: TCS34725 RGB Color Sensor For Arduino x 1
LED Stick, NeoPixel Stick LED Stick, NeoPixel Stick x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE


Step 1: What You Will Need

1 / 6

  • Arduino UNO (or any other Arduino or ESP)
  • WS2812 LED strip (8 led) or WS2812 LED Ring
  • TCS34725 Color Sensor
  • Jumper wires
  • Breadboard
  • Visuino program: Download Visuino

Step 2: 

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

Step 3: The Circuit

  • Connect Color Sensor pin VCC to Arduino pin 5V
  • Connect Color Sensor pin GND to Arduino pin GND
  • Connect Color Sensor pin SCL to Arduino pin SCL
  • Connect Color Sensor pin SDA to Arduino pin SDA
  • Connect First LedStrip pin VCC to Arduino pin 5V
  • Connect First LedStrip pin GND to Arduino pin GND
  • Connect First LedStrip pin DIN to Arduino Digital pin 6

Start Visuino, and Select the Arduino UNO Board Type

1 / 2

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 on Picture 2

Step 5: In Visuino Add Components

1 / 2

  • Add "Color Sensor TCS34725" component
  • Add "NeoPixels" component

Step 6: In Visuino Set Components

1 / 2

  • 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

Step 7: 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

Step 8: 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.

Step 9: Play

If you power the Arduino module, and put a colored paper over the sensor the Neopixels stripe 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:

Schematics, diagrams and documents

Visuino File


Visuino File


Photo of Ron


Arduino Developer


Leave your feedback...