TCS230-DB color sensor with arduino duemilanove
hscriber
Posts: 2
I am trying to make a robot that actively hunts down and retrieves golf balls off a driving range. I have a PING sensor to measure distance and tell my robot how far to move, but I want to use the TCS230-DB to determine if what I have found is in fact a golf ball. All the code I can find for it is in basic stamp, and I have no clue how to read that, let alone convert it to the arduino language. Does anyone have a sample code that they used with this sensor that I could look at to see where to even start? I have looked at the manual, it means nothing to me. I am a basic beginner, and haven't yet delved into schematics and things. All the codes I have written I have had a basic starting code that I modified to make do what I want. Please help.
Comments
Could you please be a little more explicit about how your system is going to operate? How is your PING being used to find golf balls or to determine movement toward golf balls? What distance is the PING supposed to be measuring - distance to golf balls or distance from some sort of reference point? I seriously doubt the PING, by itself, could detect golf balls in the grass.
Are all the golf balls the same color? Are they uniform in color or might they have stripes or logos on them? How will your system move through the grass and look for the balls? How fast does this thing have to work?
The TCS230 senses color by comparing different sensor signals as measured through various filters. Do you really need to sense color or could some sort of contrast comparison be good enough? In which case could you use the TSL230? http://www.parallax.com/tabid/768/txtSearch/TSL230/List/0/SortField/4/Default.aspx
As for reading the data sheet of the TCS230, it's fairly straightforward insofar as data sheets go. Are you sure you are ready for tackling a problem of this complexity? To me, it doesn't sound like a task for a beginner. It does, however, sound like a splendid job for a Propeller chip. Have you looked at those? http://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/423/Default.aspx?txtSearch=propeller+proto+board
http://www.mouser.com/_/?Keyword=TCS230&FS=True
if (distance<=36){
rightservo.writeMicroseconds(1400);
leftservo.writeMicroseconds(1600);
delay(t);
}
t is a variable I defined as distance divided by the speed of my servos.
I want to be able to roll over the object the PING detects and see what color it is. If this sensor doesn't see white very well (the color of my golf balls), then I have thought about spray painting them neon green or something. I just need to know how to use this sensor.
For the light sensor, look at the Downloads and Resources for this, especially the Nuts and Volts articles: http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/TSL230/List/0/SortField/4/ProductID/88/Default.aspx
The concepts behind the TSL230 are about the same except you might need to shift which color filters you are "looking" through for the TCS230. You basically control this chip by making pins go high and low, then read the output frequency.
But as for my other point about the PING not "seeing" the golf balls.... have you tried your PING yet? Do you know of any one who has managed to get the PING to detect a golf ball in the grass? I very much doubt that it is possible, at least not from any significant distance. However, you might get the TCS230 or TSL230 to scan the grass and detect changes in light, but it's going to be a tedious process, scanning each patch of grass inch by inch.