Shop OBEX P1 Docs P2 Docs Learn Events
Detecting Color — Parallax Forums

Detecting Color

bxgirtenbxgirten Posts: 79
edited 2005-10-17 07:58 in BASIC Stamp
I searched the archives and couldn't find if a sensor exists that detects color. If I want the stamp to detect color, do I use IR? Help appreciated.

Thanks.

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-10-08 22:14
    Use a Parallax TCS230 Color Sensing Module.· Works great.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-10-10 09:17
    I have built a simple color detector that is capable to successfully recognize 8 basic colors using 3 ultrabright Leds (RED,GREEN,BLUE) and a simple photoresistor in the middle to measure the reflection of each color. And best of all its·all basic stamp controlled. The downside is that most of the description is in Greek! I guess you could easily figure it out how it works as all variables are in english...

    Take a look in the page below for photos and schematics and the program code is on the bottom of the page...

    http://users.sch.gr/xrysoxoidou/user_projects/Active_Color_Sensor/acs.htm


    The program code is here:· ·http://users.sch.gr/xrysoxoidou/user_projects/Active_Color_Sensor/color%20sensor%20LCD.bs2


    110_color_sns_close1.jpg
  • bxgirtenbxgirten Posts: 79
    edited 2005-10-11 00:03
    Thanks Newzed, Tronic!
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-10-12 07:14
    Here is a small video of it in operation:

    http://media.putfile.com/Activecolorsensor

    Its really cool!·· ·hop.gif·



    and of cource the code with english comments smile.gif

    Post Edited (Tronic (Greece)) : 10/12/2005 11:15:55 AM GMT
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-10-13 08:07
    That is very, very cool. It is only recently that the LEDs have been available.

    I see that Green and Orange are slower to respond. This is to be expected as they are generally much closer together on the Gray scale and our eyes are far more sensitive to variations in green and red.

    You might consider writting more detail into the code for selection of those colors.

    By the way, there is also a lot of work in linguistics about different cultures having different ideas about what word means which color. So, the real demonstration of accurate color would be to create a numerical output similar to what all the computers use. I think it is a combination of Yellow, Cyan, and Blue with a Grey scale added to it.

    You may be on to something with economic viability.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-10-13 08:44
    Well its a little difficult to find those colors YCB+G in simple leds so the RGB leds are great replacements. If you seen the code I'm also adding the ambient light to each color so than might count as the gray-scale you mentioned.·Anyway the photoresistor won't know the difference...

    Its not so slow as every cycle takes less than 100ms.·If I increase the time that each led stays on it makes a little difference in detection accuracy.

    I had left it behind for other project so as soon I·get it on my hands again I might put it toggether in·a small prototype board and·modify the code to be easier to calibrate it (or even·do self calibration smile.gif·against a white paper)

    Thanos
  • BeanBean Posts: 8,129
    edited 2005-10-13 14:08
    Thanos,
    You should put that in the projects forum.
    It is really cool, I'm surprised at how fast the LEDs flash.
    Is that a CDS cell in the middle ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    "Save your money. Pay with cash."
    ·
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-10-13 14:37
    Thanks. As I said I want to make it a solid sensor as its on a breadboard for now. I also want to rewrite the code to be able to self calibrate if possible so when its ready I might post it on projects too smile.gif

    ps. Yeah its·a simple CDS cell!!!
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-13 14:51
    Tronic,

    ·· Very nice!· When you have a working model with repeatable results, by all means post it in the projects.· Includes pics and code and bask in fame...That is very simple and yet powerful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-10-17 07:58
    I finally constructed it on a PCB with little extras like potentiometers attached to each led so to be easy to calibrate their luminance to be the same against a white surface. No cover needed to shield the CDS cell.

    Next is new code (more compact that the previous one). I was thinking to convert the code·for the Taos230 that so to be compatible with this little circuit cause I think its great and already supports·semi-automatic calibration. I hope I'll figure it out soon so to present it in projects (with lots of pics+video)

    BTW it costs·only 2 dollars!!! wink.gif

    Thanos

    ascv2pcb8kc.jpg


    acsboardfront3ys.jpg

    ·
Sign In or Register to comment.