Read color of a LED?
-
Hi all,
I need some advice. I need to be able to read the color of a LED (if its green or red).
All the examples on the web on read color is doing it with another led and reads colors of things that doesn't emitt light.Is it possible to do this with just a photoresitor/photocell or what do I need for hardware?
-
@Martin-Tellblom Maybe using a color sensor with ambient light LEDs removed/disabled.
If possible, it will be a lot easier/reliable by connecting the LED anodes directly to the Arduino and interpret them instead of the color of the LED.
A bi-color LED usually has a common cathode, shared by both red/green LEDs and a separate anode for each color:
-
I can't do that. They have the whole board in plastic and its not the actual LED i can see just the plastic attatchment that is placed on the led
-
@Martin-Tellblom well, then maybe the color sensor is an option?
-
COuld you perhaps just use an LDR - i would presume the RED light emitted is at a different level to that of the GREEN light emitted and thus just MAP the range you would expect each to be at.
You would need to handle ( block out ) any ambient light however...and then you wont be able to see the led anymore...
-
@Yveaux But the once I have seen uses light to measure the color. Will that work on a LED?
I thought that i wouldn't work if you "light a light"
-
@Martin-Tellblom The sensor used (TCS3200) converts colored light to a frequency.
I assume the breakout boards contain leds is to be able to determine the color of objects, by lighting them using the white leds on the board.
Presonally I don't have any experience with these sensors, but for less than $3 I would just give it a try!
-
@Yveaux said:
@Martin-Tellblom The sensor used (TCS3200) converts colored light to a frequency.
I assume the breakout boards contain leds is to be able to determine the color of objects, by lighting them using the white leds on the board.
Presonally I don't have any experience with these sensors, but for less than $3 I would just give it a try!I'll try that and desolder the leds
Thank you
-
Use this sensor S9706
https://github.com/jakalada/Arduino-S9706
-
@gregl I like this idea. Have you tried it out? Just put one of these ( http://www.ebay.de/itm/20Stks-GL5528-Photoresistor-LDR-Photo-Resistors-Light-Dependen-t-/272304382916?hash=item3f669b23c4:g:4XkAAOSw7XZXg-Iu ) over your led and see if you get different readings depending on the color. I would guess that red and green emitt different light intensities like gregl suggested. To block out ambient light you could use some black tape and punch just 2 little holes for the wires of the LDR.
-
Many things to try now I have ordered a couple of different solutions and will get back when they have arrived and I tried them.
-
If you are open for some expriments:
http://www.instructables.com/id/LEDs-as-light-sensors/
This might even be double usefull as different LED-Colors as "light sensor" would react different.
e.g. for your red/green led .. if you pick a red led as "light sensor" you might get a much stronger reading then from the green led and hopefully a distinctive zero reading if none of them is on.