Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: airman00 on February 21, 2008, 05:35:01 AM

Title: Detecting Color with Two LEDs and Pulling Pins Low
Post by: airman00 on February 21, 2008, 05:35:01 AM
I need to detect the following colors: black,white,green, aluminum foil(shiny tape)

Now admin used 3 LEDs with photoresistor , can I use only two and get acceptable readings?
(http://www.societyofrobots.com/images/sensors_color_3LEDs.jpg)
Also what color leds  for me  --  red and green?


Another ,unrelated question: When you pull a pin low ( logical 0) on a microcontroller ,that pin is now GND, and I can connect the negative lead of the LED to that pin and the positive pin of the LED to a positive source. Right?

Title: Re: Detecting Color with Two LEDs and Pulling Pins Low
Post by: gamefreak on February 21, 2008, 07:11:40 AM
With 2 different colors you could still detect some color, but not as much as with 3, and pulling the pin low on the controller would turn on the LED, but you need to be careful with current draw.
Title: Re: Detecting Color with Two LEDs and Pulling Pins Low
Post by: Soeren on February 21, 2008, 06:09:10 PM
Hi,

I need to detect the following colors: black,white,green, aluminum foil(shiny tape)
Black is NOT a color, but absense of light.
White is "all colors" concurrently.
Aluminum foil couldn't really be called a color either, since it's more like "pure" reflection.


can I use only two and get acceptable readings?
Depends on what you find acceptable.


Also what color leds  for me  --  red and green?
That would enable you to single out the green at least (green LED => reflectance, red LED => absorption), black should be OK as well (as long as you won't have to take any other colors than green into consideration) but the aluminum foil would read like the white, only the intensity of reflection will differ.

Aluminum foil could be tested by contact (since it conducts).
Title: Re: Detecting Color with Two LEDs and Pulling Pins Low
Post by: airman00 on February 21, 2008, 06:27:52 PM
Nice idea with the contacts to test for aluminum!!!!

I will use both green and red LEDS on my bot