Ball Color Identifier

Present today: Daphne & Mezel
Daily Work Plan (9/27/2025):
- Web site updates
- Try quiz program (challenge.cybotzrobotics.org/)
- Discuss creating FTC Open Alliance profile (ftcopenalliance.org/)
- Discuss posting on Chief Delphi (www.chiefdelphi.com/)
- Work on color sensor ball classification
- FTC Sim practice (ftcsim.org)
- T-shirt design drafts
As part of our robot, we really want to include a ball sorter. That should allow a quick intake to pull in balls and then choose specific artifact colors for scoring patterns even in auto! A critical element is having a mechanism to actually identify the color. We wanted to use a Rev color sensor to identify the balls.
We created a Blocks program to identify the color of an artifact using a RevRobotics v3 ColorSensor. We found rules to use the measured distance, red, green, and blue values from the sensor that separate the different balls.

We have data from our testing, along with the calculations in our open Google Spreadsheet Color Testing.
We found that with no ball, our distance value is always greater than 3. We assigned that an ID of 0.
The second case is that the raw color values have some overlap. To make them stand out more, we found that dividing green by red cleanly separated the green ball from the purple and yellow balls (yellow being the "fuel" from the 2017 FRC challenge). Our rule for green is if green/red is greater than 3, then the ball color is green. We assigned that an ID of 1.
The third case is that if (blue+red)/green > 1.6 then the ball is purple. We assigned that an ID of 2.
Finally, if the ball doesn't match any of the above, then the ball is yellow. We assigned that an ID of 3.

This code very reliably identifies the balls using the color sensor!