Shop OBEX P1 Docs P2 Docs Learn Events
TCS230-DB Color Sensor — Parallax Forums

TCS230-DB Color Sensor

raejjraejj Posts: 14
edited 2009-04-23 18:58 in Learn with BlocklyProp
Hi all,

So, again I'm having trouble with the TCS230DB color sensor. For my capstone project, I want the sensor to identify different colors, and depending on the color of air hockey pucks, different musical patterns will be played. Right now, the color sensor easily identifies red but does not distinguish between green and blue. I believe it may be due to the paint I purchased from Lowe's. I have two cans of Valspar Plastic Paint (royal blue and hunter green). I'm thinking maybe the colors are too dark or the fact that I'm painting over the red hockey pucks.

Anyways, here is the readout from the debug terminal.

R000 G000 B006
R000 G000 B002
R000 G000 B002
R000 G000 B002
R000 G000 B002
R000 G000 B002
R017 G000 B003

The first three readings are the blue disk. The second three readings are the green disk, and the last reading is the red disk. My program is an attachment. Any suggestions as to how to improve the readability of the color sensor would be greatly appreciated.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-04-22 17:14
    Your color values are extremely low. Is your subject distance correct? It should be between 1" and 1 1/16" from the front surface of the TCS230-DB printed circuit board, so that the LED spots converge into one spot in front of the lens. If this is the case, you will need to increase the values of PRED, PGREEN, and PBLUE substantially in order to increase sample times and get usable readings.

    -Phil
  • raejjraejj Posts: 14
    edited 2009-04-23 16:59
    I increased the period of the readings for each color and the results are the same. With a red hockey the red value is over 200 while the green and blue values are close to zero. With a blue hockey puck the red value is 140s with blue and green values still single digits. The only way I can get a reading from the green filter is if I don't turn the white LEDs on. Then the value hovers around 5 or 6.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-04-23 18:58
    Something's just not adding up here. You should definitely be getting higher readings with the LED on than with it off. Double-check your wiring. Are S2, S3, ColorOutput, and WhiteLED connected the way you think they are? What are your current values for PRED, PGREEN, and PBLUE?

    -Phil
Sign In or Register to comment.