Color sensor w lynx 5 arm

This question could best be answered by BETH FRYE. So if you are around can you explain this for me…

I am looking to interface a color sensor (RGB) into the Lynx 5 arm like you have (Beth) in your project. My question to you is how did you get the arm to know what colored object it is picking up. I looked at your sensor schematic, makes total sense…but I can’t seem to figure out how the arm knew what color the object was

Did you use a visioning system of some sorts ?

Any feed back is appreciated thanks.

I plan to build a color sensor in my project for an engineering class.

THANKS

Wow, it’s been a long time since I’ve looked at that project! I’ll answer as best as I can remember. :laughing:

Ok, first of all, the schematic. It shows the tri-color LED (Red, Green, Blue) and a CDS photocell. The CDS cell is what is used to get color information to the BS2. I turned on each color of the LED separately, and got the information from the CDS. Then I did a bit of creative math, and then a bit more. Then I did a bunch of if-thens and came up with the colors.

Here’s the code for the BS2 that I used. You should be able to get a general grasp of how it works if you study it. :wink:

Let me know if you have any more questions and I’ll try to be a bit more helpful. :smiley:

Another one for you…

So the CDS photocell was placed underneath the colored M&M right?

I just can’t grasp how the photocell would detect the different colors. Was
there some sort of light shining on the M&M, that was then detected by the CDS?

Ah, I see what you’re asking now. The light comes from the tri-color LED. The LED has RED, GREEN, and BLUE light that it can shine at different times. So the program will make the LED shine RED, then check the CDS photocell. Then the LED will shine GREEN and the program will check the photocell. Then finally BLUE and check the photocell again.

Then those numbers are used to determine the color of the M&M.

Does that make it a bit more clear?

The basic idea being that a red m&m reflects more red light than a green or yellow one, and as you test with red, green, and blue and have a fairly narrow sample set you can build associations based on that data.

Nice relatively inexpensive way to go about it. :wink:

Any chance of getting a quick sketch of the internal physical construction of your LED/photocell unit?

I’m working on something similar at the moment, and have a pretty good idea of how to go about building it mechanically, but it certainly never hurts to listen to advice and/or caveats from someone who’s “been there, done that” before jumping in and reinventing the wheel.

Hi,

Is what somebody has try this sensor? which model took for the cds (photocell) ?
:question:

I helped with that project, so I will try and assist.

The LED and CDS cell are set in a hole, mounted side by side, and are separated by heatshrink to prevent any LED light from hitting the CDS cell directly. For M&M’s it’s impossible to get the piece to cover the opening of the hole perfectly. This allows some ambient light into the opening and will effect the values from the CDS cell. Bu if you run the values through a software filter you can get how the values compare to each other, which is more useful. Sorry I don’t know the terminology, I think it’s a scaling filter. He he I wrote it, but am not sure what it’s called. LOL Anyway, hope this helps!